[pitivi: 5/28] factories/base.py: force all images to the same resolution



commit 3d63f6936822b23b54a3408a9654900879e101e3
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Thu Jan 28 13:08:50 2010 -0800

    factories/base.py: force all images to the same resolution

 pitivi/factories/base.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/factories/base.py b/pitivi/factories/base.py
index b1f766f..1f192ae 100644
--- a/pitivi/factories/base.py
+++ b/pitivi/factories/base.py
@@ -418,15 +418,20 @@ class SourceFactory(ObjectFactory):
             else:
                 b.scale = gst.element_factory_make("videoscale", "scale")
                 b.scale.props.method = 2
+            b.filter = gst.element_factory_make("capsfilter")
+            b.filter.props.caps = gst.Caps("video/x-raw-rgb,"
+                "width=320,height=240;video/x-raw-yuv,width=320,"
+                "height=240")
 
-            b.add(b.queue, b.scale, b.csp, b.alpha)
-            gst.element_link_many(b.queue, b.scale, b.csp)
+            b.add(b.queue, b.scale, b.filter, b.csp, b.alpha)
+            gst.element_link_many(b.queue, b.scale, b.filter, b.csp)
             if child_bin:
                 gst.element_link_many(b.csp, b.child, b.alpha)
                 b.child.sync_state_with_parent()
             else:
                 gst.element_link_many(b.csp, b.alpha)
             b.scale.sync_state_with_parent()
+            b.filter.sync_state_with_parent()
             b.queue.sync_state_with_parent()
             b.csp.sync_state_with_parent()
             b.alpha.sync_state_with_parent()
@@ -449,7 +454,8 @@ class SourceFactory(ObjectFactory):
             pad.link(topbin.aconv.get_pad("sink"))
             topbin.ghostpad = gst.GhostPad("src", topbin.volume.get_pad("src"))
         elif hasattr(topbin, "alpha"):
-            for element in [topbin.queue, topbin.scale, topbin.csp, topbin.alpha]:
+            for element in [topbin.queue, topbin.scale, topbin.filter,
+                topbin.csp, topbin.alpha]:
                 element.sync_state_with_parent()
 
             pad.link(topbin.queue.get_pad("sink"))



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