From 8598775951f74847124efc9e23d5a68e9f22f197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 16 May 2011 10:47:02 +0200 Subject: [PATCH] appsink: Update for the negotiation related API changes --- gst-libs/gst/app/gstappsink.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/app/gstappsink.c b/gst-libs/gst/app/gstappsink.c index 7d4445b2ed..76cff42c67 100644 --- a/gst-libs/gst/app/gstappsink.c +++ b/gst-libs/gst/app/gstappsink.c @@ -180,7 +180,7 @@ static GstFlowReturn gst_app_sink_render (GstBaseSink * psink, GstBuffer * buffer); static GstFlowReturn gst_app_sink_render_list (GstBaseSink * psink, GstBufferList * list); -static GstCaps *gst_app_sink_getcaps (GstBaseSink * psink); +static GstCaps *gst_app_sink_getcaps (GstBaseSink * psink, GstCaps * filter); static GstMiniObject *gst_app_sink_pull_object (GstAppSink * appsink); static guint gst_app_sink_signals[LAST_SIGNAL] = { 0 }; @@ -846,15 +846,19 @@ gst_app_sink_render_list (GstBaseSink * sink, GstBufferList * list) } static GstCaps * -gst_app_sink_getcaps (GstBaseSink * psink) +gst_app_sink_getcaps (GstBaseSink * psink, GstCaps * filter) { GstCaps *caps; GstAppSink *appsink = GST_APP_SINK_CAST (psink); GstAppSinkPrivate *priv = appsink->priv; GST_OBJECT_LOCK (appsink); - if ((caps = priv->caps)) - gst_caps_ref (caps); + if ((caps = priv->caps)) { + if (filter) + caps = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + else + gst_caps_ref (caps); + } GST_DEBUG_OBJECT (appsink, "got caps %" GST_PTR_FORMAT, caps); GST_OBJECT_UNLOCK (appsink);