/* Check if stream format is compatible */
srcpad = gst_element_get_static_pad (sgroup->smartencoder, "src");
- tmpcaps = gst_pad_get_caps (srcpad);
+ tmpcaps = gst_pad_get_caps (srcpad, NULL);
if (!gst_caps_can_intersect (tmpcaps, format)) {
GST_DEBUG ("We don't have a smart encoder for the stream format");
gst_object_unref (sgroup->smartencoder);
static GstFlowReturn gst_smart_encoder_chain (GstPad * pad, GstBuffer * buf);
static gboolean smart_encoder_sink_event (GstPad * pad, GstEvent * event);
-static GstCaps *smart_encoder_sink_getcaps (GstPad * pad);
+static GstCaps *smart_encoder_sink_getcaps (GstPad * pad, GstCaps * filter);
static GstStateChangeReturn
gst_smart_encoder_change_state (GstElement * element,
GstStateChange transition);
}
static GstCaps *
-smart_encoder_sink_getcaps (GstPad * pad)
+smart_encoder_sink_getcaps (GstPad * pad, GstCaps * filter)
{
GstCaps *peer, *tmpl, *res;
GstSmartEncoder *smart_encoder = GST_SMART_ENCODER (gst_pad_get_parent (pad));
- /* Try getting it from downstream */
- peer = gst_pad_peer_get_caps_reffed (smart_encoder->srcpad);
-
/* Use computed caps */
if (smart_encoder->available_caps)
tmpl = gst_caps_ref (smart_encoder->available_caps);
else
tmpl = gst_static_pad_template_get_caps (&src_template);
+ /* Try getting it from downstream */
+ peer = gst_pad_peer_get_caps (smart_encoder->srcpad, tmpl);
+
if (peer == NULL) {
res = tmpl;
} else {
- res = gst_caps_intersect (peer, tmpl);
- gst_caps_unref (peer);
+ res = peer;
gst_caps_unref (tmpl);
}
}
static GstCaps *
-gst_stream_combiner_sink_getcaps (GstPad * pad)
+gst_stream_combiner_sink_getcaps (GstPad * pad, GstCaps * filter)
{
GstStreamCombiner *stream_combiner =
(GstStreamCombiner *) GST_PAD_PARENT (pad);
- return gst_pad_peer_get_caps_reffed (stream_combiner->srcpad);
+ return gst_pad_peer_get_caps (stream_combiner->srcpad, filter);
}
static gboolean
}
static GstCaps *
-gst_stream_splitter_sink_getcaps (GstPad * pad)
+gst_stream_splitter_sink_getcaps (GstPad * pad, GstCaps * filter)
{
GstStreamSplitter *stream_splitter =
(GstStreamSplitter *) GST_PAD_PARENT (pad);
resync:
if (G_UNLIKELY (stream_splitter->srcpads == NULL)) {
- res = gst_caps_new_any ();
+ res = (filter ? gst_caps_ref (filter) : gst_caps_new_any ());
goto beach;
}
STREAMS_UNLOCK (stream_splitter);
if (res)
- gst_caps_merge (res, gst_pad_peer_get_caps_reffed (srcpad));
+ gst_caps_merge (res, gst_pad_peer_get_caps (srcpad, filter));
else
- res = gst_pad_peer_get_caps (srcpad);
+ res = gst_pad_peer_get_caps (srcpad, filter);
STREAMS_LOCK (stream_splitter);
if (G_UNLIKELY (cookie != stream_splitter->cookie)) {
GstCaps *peercaps;
STREAMS_UNLOCK (stream_splitter);
- peercaps = gst_pad_peer_get_caps_reffed (srcpad);
+ peercaps = gst_pad_peer_get_caps (srcpad, NULL);
if (peercaps) {
res = gst_caps_can_intersect (caps, peercaps);
gst_caps_unref (peercaps);