From 8d8f17a4ff0f4e8b78a9e097aed816392e37084d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 18 May 2005 09:59:28 +0000 Subject: [PATCH] gst/ffmpegcolorspace/gstffmpegcolorspace.c: Enable buffer alloc passthrough if the source and dest formats are the same. 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 | 9 +++++++++ gst/ffmpegcolorspace/gstffmpegcolorspace.c | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7ddaaad12c..cd0d35b39c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-05-18 Wim Taymans + + * 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 * ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain), diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index fd4a4bd511..9c247a5d95 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -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;