pitivi r1322 - in trunk: . pitivi pitivi/ui



Author: edwardrv
Date: Thu Oct 16 14:20:02 2008
New Revision: 1322
URL: http://svn.gnome.org/viewvc/pitivi?rev=1322&view=rev

Log:
	* pitivi/Makefile.am:
	* pitivi/bin.py:
	* pitivi/plumber.py:
	* pitivi/ui/Makefile.am:
	* pitivi/ui/viewer.py:
	Move plumber up one directory, since it's not ui-specific.
	Use auto*sink instead of gconf*sink since it's now works better

Added:
   trunk/pitivi/plumber.py
      - copied, changed from r1321, /trunk/pitivi/ui/plumber.py
Removed:
   trunk/pitivi/ui/plumber.py
Modified:
   trunk/ChangeLog
   trunk/pitivi/Makefile.am
   trunk/pitivi/bin.py
   trunk/pitivi/ui/Makefile.am
   trunk/pitivi/ui/viewer.py

Modified: trunk/pitivi/Makefile.am
==============================================================================
--- trunk/pitivi/Makefile.am	(original)
+++ trunk/pitivi/Makefile.am	Thu Oct 16 14:20:02 2008
@@ -22,6 +22,7 @@
 	playground.py 	\
 	plugincore.py	\
 	pluginmanager.py \
+	plumber.py	\
 	project.py 	\
 	projectsaver.py	\
 	serializable.py	\

Modified: trunk/pitivi/bin.py
==============================================================================
--- trunk/pitivi/bin.py	(original)
+++ trunk/pitivi/bin.py	Thu Oct 16 14:20:02 2008
@@ -26,7 +26,7 @@
 import gobject
 import gst
 from elements.smartscale import SmartVideoScale
-from ui import plumber
+import plumber
 from threads import CallbackThread
 
 class SmartBin(gst.Pipeline):

Copied: trunk/pitivi/plumber.py (from r1321, /trunk/pitivi/ui/plumber.py)
==============================================================================
--- /trunk/pitivi/ui/plumber.py	(original)
+++ trunk/pitivi/plumber.py	Thu Oct 16 14:20:02 2008
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # PiTiVi , Non-linear video editor
 #
-#       ui/plumber.py
+#       plumber.py
 #
 # Copyright (c) 2005, Edward Hervey <bilboed bilboed com>
 #
@@ -30,57 +30,58 @@
 # This is a required level of abstraction for the many different sinks that
 # exist out there
 #
+# They should be provided by a generic sink provider
 
 import gobject
 import gst
-import gst.interfaces
+from gst import interfaces
 
 def get_video_sink():
     """ Returns a video sink bin that can be used in the Discoverer """
-    try:
-        gconfsink = gst.element_factory_make("gconfvideosink")
-    except:
-        gconfsink = gst.element_factory_make("autovideosink")
-    gconfsink.realsink = None
-
-    gconfsink.set_state(gst.STATE_READY)
-
-    if not gconfsink.implements_interface(gst.interfaces.XOverlay):
-        gconfsink.info("doesn't implement XOverlay interface")
-        realsink = gconfsink.get_by_interface(gst.interfaces.XOverlay)
+    autovideosink = gst.element_factory_make("autovideosink")
+    autovideosink.realsink = None
+
+    autovideosink.set_state(gst.STATE_READY)
+
+    if not autovideosink.implements_interface(interfaces.XOverlay):
+        autovideosink.info("doesn't implement XOverlay interface")
+        realsink = autovideosink.get_by_interface(interfaces.XOverlay)
         if not realsink:
-            gst.info("%s" % list(gconfsink.elements()))
-            gconfsink.warning("couldn't even find an XOverlay within!!!")
+            gst.info("%s" % list(autovideosink.elements()))
+            autovideosink.warning("couldn't even find an XOverlay within!!!")
         else:
             realsink.info("implements XOverlay interface")
-            gconfsink.set_xwindow_id = realsink.set_xwindow_id
-            gconfsink.expose = realsink.expose
-            gconfsink.realsink = realsink
+            autovideosink.set_xwindow_id = realsink.set_xwindow_id
+            autovideosink.expose = realsink.expose
+            autovideosink.realsink = realsink
     else:
-        gconfsink.realsink = gconfsink
-    if gconfsink.realsink:
-        if "force-aspect-ratio"in [prop.name for prop in gobject.list_properties(gconfsink.realsink)]:
-            gconfsink.realsink.set_property("force-aspect-ratio", True)
-        if "qos"in [prop.name for prop in gobject.list_properties(gconfsink.realsink)]:
-            gconfsink.realsink.set_property("qos", False)
-        if "max-lateness"in [prop.name for prop in gobject.list_properties(gconfsink.realsink)]:
-            gconfsink.realsink.set_property("max-lateness", -1)
-    return gconfsink
+        autovideosink.realsink = autovideosink
+    # FIXME : YUCK, I'm guessing most of these issues (qos/max-lateness)
+    # have been solved since
+    if autovideosink.realsink:
+        if "force-aspect-ratio"in [prop.name for prop in gobject.list_properties(autovideosink.realsink)]:
+            autovideosink.realsink.set_property("force-aspect-ratio", True)
+        if "qos"in [prop.name for prop in gobject.list_properties(autovideosink.realsink)]:
+            autovideosink.realsink.set_property("qos", False)
+        if "max-lateness"in [prop.name for prop in gobject.list_properties(autovideosink.realsink)]:
+            autovideosink.realsink.set_property("max-lateness", -1)
+    return autovideosink
 
 def get_audio_sink():
     """ Returns an audio sink bin that can be used in the Discoverer """
-    try:
-        realsink = gst.element_factory_make("gconfaudiosink")
-    except:
-        realsink = gst.element_factory_make("autoaudiosink")
+    autoaudiosink = gst.element_factory_make("autoaudiosink")
 
     audiosink = gst.Bin("pitivi-audiosink")
     aconv = gst.element_factory_make("audioconvert","audiobin-convert")
     ares = gst.element_factory_make("audioresample", "audiobin-resample")
 
-    audiosink.add(aconv, ares, realsink)
+    audiosink.add(aconv, ares, autoaudiosink)
     aconv.link(ares)
-    ares.link(realsink, gst.Caps("audio/x-raw-int,channels=2,rate=44100,depth=16;audio/x-raw-float,channels=2,rate=44100"))
+    # FIXME : This is really bad
+    # For starters... it means we can't edit/preview multi-channel audio
+    # Also, most hardware cards do internal resampling much better
+    audiocaps = "audio/x-raw-int,channels=2,rate=44100,depth=16;audio/x-raw-float,channels=2,rate=44100"
+    ares.link(autoaudiosink, gst.Caps(audiocaps))
 
     audiosink.add_pad(gst.GhostPad("sink", aconv.get_pad("sink")))
 

Modified: trunk/pitivi/ui/Makefile.am
==============================================================================
--- trunk/pitivi/ui/Makefile.am	(original)
+++ trunk/pitivi/ui/Makefile.am	Thu Oct 16 14:20:02 2008
@@ -12,7 +12,6 @@
 	mainwindow.py		\
 	netstream_managerdialog.py \
 	pluginmanagerdialog.py	\
-	plumber.py		\
 	projectsettings.py	\
 	ruler.py		\
 	screencast_managerdialog.py \

Modified: trunk/pitivi/ui/viewer.py
==============================================================================
--- trunk/pitivi/ui/viewer.py	(original)
+++ trunk/pitivi/ui/viewer.py	Thu Oct 16 14:20:02 2008
@@ -27,7 +27,7 @@
 import gst.interfaces
 from glade import GladeWindow
 
-import plumber
+import pitivi.plumber as plumber
 import pitivi.instance as instance
 from pitivi.bin import SmartTimelineBin
 import pitivi.dnd as dnd



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