appsink: Update for the negotiation related API changes

This commit is contained in:
Sebastian Dröge 2011-05-16 10:47:02 +02:00
parent 97f18beaeb
commit 8598775951

View file

@ -180,7 +180,7 @@ static GstFlowReturn gst_app_sink_render (GstBaseSink * psink,
GstBuffer * buffer); GstBuffer * buffer);
static GstFlowReturn gst_app_sink_render_list (GstBaseSink * psink, static GstFlowReturn gst_app_sink_render_list (GstBaseSink * psink,
GstBufferList * list); 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 GstMiniObject *gst_app_sink_pull_object (GstAppSink * appsink);
static guint gst_app_sink_signals[LAST_SIGNAL] = { 0 }; static guint gst_app_sink_signals[LAST_SIGNAL] = { 0 };
@ -846,15 +846,19 @@ gst_app_sink_render_list (GstBaseSink * sink, GstBufferList * list)
} }
static GstCaps * static GstCaps *
gst_app_sink_getcaps (GstBaseSink * psink) gst_app_sink_getcaps (GstBaseSink * psink, GstCaps * filter)
{ {
GstCaps *caps; GstCaps *caps;
GstAppSink *appsink = GST_APP_SINK_CAST (psink); GstAppSink *appsink = GST_APP_SINK_CAST (psink);
GstAppSinkPrivate *priv = appsink->priv; GstAppSinkPrivate *priv = appsink->priv;
GST_OBJECT_LOCK (appsink); GST_OBJECT_LOCK (appsink);
if ((caps = priv->caps)) if ((caps = priv->caps)) {
if (filter)
caps = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
else
gst_caps_ref (caps); gst_caps_ref (caps);
}
GST_DEBUG_OBJECT (appsink, "got caps %" GST_PTR_FORMAT, caps); GST_DEBUG_OBJECT (appsink, "got caps %" GST_PTR_FORMAT, caps);
GST_OBJECT_UNLOCK (appsink); GST_OBJECT_UNLOCK (appsink);