[pitivi] factories: make VideoTestSourceFactory link to the video elements created by the base factory.



commit f2909e5e63281bf3384e522a1d07657474045fa1
Author: Alessandro Decina <alessandro d gmail com>
Date:   Tue Sep 7 16:35:26 2010 +0200

    factories: make VideoTestSourceFactory link to the video elements created by the
    base factory.

 pitivi/factories/test.py |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/factories/test.py b/pitivi/factories/test.py
index 2fda4fa..ddbea3b 100644
--- a/pitivi/factories/test.py
+++ b/pitivi/factories/test.py
@@ -41,18 +41,28 @@ class VideoTestSourceFactory(SourceFactory):
         bin = gst.Bin()
         videotestsrc = gst.element_factory_make('videotestsrc')
         videotestsrc.props.pattern = self.pattern
-        capsfilter = gst.element_factory_make('capsfilter')
+        capsfilter = gst.element_factory_make('capsfilter',
+                "videotestsrc-capsfilter")
         capsfilter.props.caps = output_stream.caps.copy()
 
         bin.add(videotestsrc)
         bin.add(capsfilter)
         videotestsrc.link(capsfilter)
 
-        target = capsfilter.get_pad('src')
+        return bin
+
+    def _makeStreamBin(self, output_stream):
+        video_bin = SourceFactory._makeStreamBin(self, output_stream)
+        capsfilter = video_bin.get_by_name("videotestsrc-capsfilter")
+        queue = video_bin.get_by_name("internal-queue")
+        capsfilter.link(queue)
+
+        capsfilter = video_bin.get_by_name("capsfilter-proj-settings")
+        target = capsfilter.get_pad("src")
         ghost = gst.GhostPad('src', target)
-        bin.add_pad(ghost)
+        video_bin.add_pad(ghost)
 
-        return bin
+        return video_bin
 
     def _releaseBin(self, bin):
         pass



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]