From 948d06e4b3674a35c9247c7480c8afdd8faee5d9 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 6 May 2010 09:14:25 +0300 Subject: [PATCH] videorate: trucate own caps, instead of copying and using the first only We got the caps from an intersect, it is our own, hence we can truncate it. Besides gst-indent has chooses to line-up all caps in one line again :/. --- gst/videorate/gstvideorate.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index 7d84837..fe04dc6 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -104,24 +104,16 @@ static GstStaticPadTemplate gst_video_rate_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "video/x-raw-yuv;" - "video/x-raw-rgb;" - "video/x-raw-gray;" - "image/jpeg;" - "image/png") + GST_STATIC_CAPS ("video/x-raw-yuv;" + "video/x-raw-rgb;" "video/x-raw-gray;" "image/jpeg;" "image/png") ); static GstStaticPadTemplate gst_video_rate_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "video/x-raw-yuv;" - "video/x-raw-rgb;" - "video/x-raw-gray;" - "image/jpeg;" - "image/png") + GST_STATIC_CAPS ("video/x-raw-yuv;" + "video/x-raw-rgb;" "video/x-raw-gray;" "image/jpeg;" "image/png") ); static void gst_video_rate_swap_prev (GstVideoRate * videorate, @@ -314,7 +306,6 @@ gst_video_rate_setcaps (GstPad * pad, GstCaps * caps) ret = TRUE; } else { GstCaps *peercaps; - GstCaps *intersect; GstCaps *transform = NULL; ret = FALSE; @@ -330,15 +321,14 @@ gst_video_rate_setcaps (GstPad * pad, GstCaps * caps) GST_DEBUG ("transform %" GST_PTR_FORMAT, transform); /* filter against our possibilities */ - intersect = gst_caps_intersect (peercaps, transform); + caps = gst_caps_intersect (peercaps, transform); gst_caps_unref (peercaps); gst_caps_unref (transform); - GST_DEBUG ("intersect %" GST_PTR_FORMAT, intersect); + GST_DEBUG ("intersect %" GST_PTR_FORMAT, caps); /* take first possibility */ - caps = gst_caps_copy_nth (intersect, 0); - gst_caps_unref (intersect); + gst_caps_truncate (caps); structure = gst_caps_get_structure (caps, 0); /* and fixate */ -- 2.7.4