gst/ffmpegcolorspace/gstffmpegcolorspace.c: Enable buffer alloc passthrough if the...
authorWim Taymans <wim.taymans@gmail.com>
Wed, 18 May 2005 09:59:28 +0000 (09:59 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 18 May 2005 09:59:28 +0000 (09:59 +0000)
Original commit message from CVS:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
Enable buffer alloc passthrough if the source and dest
formats are the same.

ChangeLog
gst/ffmpegcolorspace/gstffmpegcolorspace.c

index 7ddaaad..cd0d35b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-05-18  Wim Taymans  <wim@fluendo.com>
+
+       * gst/ffmpegcolorspace/gstffmpegcolorspace.c:
+       (gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
+       (gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
+       (gst_ffmpegcsp_chain):
+       Enable buffer alloc passthrough if the source and dest
+       formats are the same.
+
 2005-05-17  Wim Taymans  <wim@fluendo.com>
 
        * ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
index fd4a4bd..9c247a5 100644 (file)
@@ -394,7 +394,12 @@ gst_ffmpegcsp_bufferalloc (GstPad * pad, guint64 offset, guint size,
 
   space = GST_FFMPEGCSP (GST_PAD_PARENT (pad));
 
-  buf = gst_pad_alloc_buffer (space->srcpad, offset, size, caps);
+  if ((space->from_pixfmt == space->to_pixfmt) &&
+      space->from_pixfmt != PIX_FMT_NB) {
+    buf = gst_pad_alloc_buffer (space->srcpad, offset, size, caps);
+  } else {
+    buf = NULL;
+  }
   return buf;
 }
 
@@ -409,6 +414,7 @@ gst_ffmpegcsp_chain (GstPad * pad, GstBuffer * buffer)
 
   GST_STREAM_LOCK (pad);
 
+  GST_DEBUG ("from %d -> to %d", space->from_pixfmt, space->to_pixfmt);
   if (space->from_pixfmt == PIX_FMT_NB || space->to_pixfmt == PIX_FMT_NB)
     goto unkown_format;