From: Thomas Vander Stichele Date: Thu, 10 Nov 2005 18:57:17 +0000 (+0000) Subject: gst/ffmpegcolorspace/gstffmpegcolorspace.c: Prefer passthrough in transform_caps X-Git-Tag: 1.19.3~511^2~12568 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f560885c22f48caac0ee47e7949a8bc11afb300;p=platform%2Fupstream%2Fgstreamer.git gst/ffmpegcolorspace/gstffmpegcolorspace.c: Prefer passthrough in transform_caps Original commit message from CVS: * gst/ffmpegcolorspace/gstffmpegcolorspace.c: (gst_ffmpegcsp_transform_caps): Prefer passthrough in transform_caps --- diff --git a/ChangeLog b/ChangeLog index 5f47a14..6fd7014 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-11-10 Thomas Vander Stichele + * gst/ffmpegcolorspace/gstffmpegcolorspace.c: + (gst_ffmpegcsp_transform_caps): + Prefer passthrough in transform_caps + +2005-11-10 Thomas Vander Stichele + * ext/alsa/gstalsasink.c: (gst_alsasink_open): check for ALSA errors properly, instead of relying on ALSA's error strings to serve to the user. diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index c170a72..17c134c 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -85,6 +85,7 @@ static GstElementClass *parent_class = NULL; /*static guint gst_ffmpegcsp_signals[LAST_SIGNAL] = { 0 }; */ +/* copies the given caps */ static GstCaps * gst_ffmpegcsp_caps_remove_format_info (GstCaps * caps) { @@ -122,17 +123,26 @@ gst_ffmpegcsp_caps_remove_format_info (GstCaps * caps) return caps; } +/* The caps can be transformed into any other caps with format info removed. + * However, we should prefer passthrough, so if passthrough is possible, + * put it first in the list. */ static GstCaps * gst_ffmpegcsp_transform_caps (GstBaseTransform * btrans, GstPadDirection direction, GstCaps * caps) { GstFFMpegCsp *space; + GstCaps *template; GstCaps *result; space = GST_FFMPEGCSP (btrans); - result = gst_ffmpegcsp_caps_remove_format_info (caps); + template = gst_ffmpegcsp_codectype_to_caps (CODEC_TYPE_VIDEO, NULL); + result = gst_caps_intersect (caps, template); + gst_caps_append (result, gst_ffmpegcsp_caps_remove_format_info (caps)); + + GST_DEBUG_OBJECT (btrans, "transformed %" GST_PTR_FORMAT " into %" + GST_PTR_FORMAT, caps, result); return result; }