[pitivi] Port to new Caps API and use Gst1 raw caps



commit 551cfc029a389160075bd1303977bbf4cb05f9d0
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Mon Jul 2 17:12:46 2012 -0400

    Port to new Caps API and use Gst1 raw caps

 pitivi/clipproperties.py       |    2 +-
 pitivi/render.py               |    4 ++--
 pitivi/settings.py             |    2 +-
 pitivi/timeline/thumbnailer.py |    8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index 69d3b01..4677f97 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -643,7 +643,7 @@ class TransformationProperties(gtk.Expander):
             self._current_tl_obj.add_track_object(effect)
             tracks = self.app.projectManager.current.timeline.get_tracks()
             for track in tracks:
-                if track.get_caps().to_string() == "video/x-raw-yuv; video/x-raw-rgb":
+                if track.get_caps().to_string() == "video/x-raw":
                     track.add_object(effect)
             effect = self._findEffect(name)
             # disable the effect on default
diff --git a/pitivi/render.py b/pitivi/render.py
index e6d37c4..7d415be 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -211,8 +211,8 @@ def encoders_muxer_compatible(encoders, muxer, muxsinkcaps=[]):
     return res
 
 
-raw_audio_caps = gst.Caps("audio/x-raw-float;audio/x-raw-int")
-raw_video_caps = gst.Caps("video/x-raw-yuv;video/x-raw-rgb")
+raw_audio_caps = gst.caps_from_string("audio/x-raw")
+raw_video_caps = gst.caps_from_string("video/x-raw")
 
 
 def muxer_can_sink_raw_audio(muxer):
diff --git a/pitivi/settings.py b/pitivi/settings.py
index 05eb876..25b4215 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -407,7 +407,7 @@ class MultimediaSettings(Signallable, Loggable):
                 videowidth, videoheight,
                 self.videopar.num, self.videopar.denom,
                 self.videorate.num, self.videorate.denom)
-        caps_str = "video/x-raw-yuv,%s;video/x-raw-rgb,%s" % (vstr, vstr)
+        caps_str = "video/x-raw,%s" % (vstr, vstr)
         video_caps = gst.caps_from_string(caps_str)
         if self.vencoder:
             return get_compatible_sink_caps(self.vencoder, video_caps)
diff --git a/pitivi/timeline/thumbnailer.py b/pitivi/timeline/thumbnailer.py
index 8f8906e..2764732 100644
--- a/pitivi/timeline/thumbnailer.py
+++ b/pitivi/timeline/thumbnailer.py
@@ -476,7 +476,7 @@ class RandomAccessVideoPreviewer(RandomAccessPreviewer):
 
         # Use a capsfilter to scale the video to the desired size
         # (fixed height and par, variable width)
-        caps = gst.Caps("video/x-raw-rgb, height=(int)%d, pixel-aspect-ratio=(fraction)1/1" %
+        caps = gst.Caps("video/x-raw, height=(int)%d, pixel-aspect-ratio=(fraction)1/1" %
             self.theight)
         capsfilter = gst.element_factory_make("capsfilter", "thumbnailcapsfilter")
         capsfilter.props.caps = caps
@@ -717,10 +717,10 @@ class CairoSurfaceThumbnailSink(gst.BaseSink):
         }
 
     __gsttemplates__ = (
-        gst.PadTemplate("sink",
+        gst.PadTemplate.new("sink",
                          gst.PAD_SINK,
                          gst.PAD_ALWAYS,
-                         gst.Caps("video/x-raw-rgb,"
+                         gst.caps_from_string("video/x-raw,"
                                   "bpp = (int) 32, depth = (int) 32,"
                                   "endianness = (int) BIG_ENDIAN,"
                                   "alpha_mask = (int) %i, "
@@ -747,7 +747,7 @@ class CairoSurfaceThumbnailSink(gst.BaseSink):
         self.log("padcaps %s" % self.get_pad("sink").get_caps().to_string())
         self.width = caps[0]["width"]
         self.height = caps[0]["height"]
-        if not caps[0].get_name() == "video/x-raw-rgb":
+        if not caps[0].get_name() == "video/x-raw":
             return False
         return True
 



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