From 8d6e2c8a89d40f6ac47af81551361551a0304331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 16 May 2011 12:04:39 +0200 Subject: [PATCH] xvimagesink: Update for negotiation related API changes --- sys/xvimage/xvimagesink.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 66601c4337..f1984954ab 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1509,18 +1509,29 @@ gst_xvimagesink_xcontext_clear (GstXvImageSink * xvimagesink) /* Element stuff */ static GstCaps * -gst_xvimagesink_getcaps (GstBaseSink * bsink) +gst_xvimagesink_getcaps (GstBaseSink * bsink, GstCaps * filter) { GstXvImageSink *xvimagesink; xvimagesink = GST_XVIMAGESINK (bsink); - if (xvimagesink->xcontext) - return gst_caps_ref (xvimagesink->xcontext->caps); + if (xvimagesink->xcontext) { + if (filter) + return gst_caps_intersect_full (filter, xvimagesink->xcontext->caps, + GST_CAPS_INTERSECT_FIRST); + else + return gst_caps_ref (xvimagesink->xcontext->caps); + } - return - gst_caps_copy (gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD - (xvimagesink))); + if (filter) { + return gst_caps_intersect_full (filter, + gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD (xvimagesink)), + GST_CAPS_INTERSECT_FIRST); + } else { + return + gst_caps_copy (gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD + (xvimagesink))); + } } static gboolean