/* see if any more pending dynamic connections exist */
more = gst_decode_bin_is_dynamic (decode_bin);
- caps = gst_pad_get_caps (pad);
+ caps = gst_pad_get_caps (pad, NULL);
close_pad_link (element, pad, caps, decode_bin, more);
if (caps)
gst_caps_unref (caps);
GST_OBJECT_NAME (pad));
/* continue autoplugging on the pads */
- caps = gst_pad_get_caps (pad);
+ caps = gst_pad_get_caps (pad, NULL);
close_pad_link (element, pad, caps, decode_bin, more);
if (caps)
gst_caps_unref (caps);
* be fixed in some cases, in which case analyze_new_pad will set up a
* notify::caps signal to continue autoplugging. */
if (caps == NULL)
- caps = gst_pad_get_caps_reffed (pad);
+ caps = gst_pad_get_caps (pad, NULL);
return caps;
}
GST_DEBUG ("play base: new decoded pad. Last: %d", last);
/* first see if this pad has interesting caps */
- caps = gst_pad_get_caps (pad);
+ caps = gst_pad_get_caps (pad, NULL);
if (caps == NULL || gst_caps_is_empty (caps) || gst_caps_is_any (caps))
goto no_type;
guint i, num_raw = 0;
gboolean res = FALSE;
- caps = gst_pad_get_caps (pad);
+ caps = gst_pad_get_caps (pad, NULL);
if (caps == NULL)
return FALSE;
GstCaps *caps;
/* could not link this stream */
- caps = gst_pad_get_caps (srcpad);
+ caps = gst_pad_get_caps (srcpad, NULL);
capsstr = gst_caps_to_string (caps);
g_warning ("could not link %s: %d", capsstr, linkres);
GST_DEBUG_OBJECT (play_bin,
GstCaps *caps;
/* could not link this stream */
- caps = gst_pad_get_caps (subtitle_pad);
+ caps = gst_pad_get_caps (subtitle_pad, NULL);
GST_WARNING_OBJECT (play_bin, "subtitle link failed when adding sink, "
"caps = %" GST_PTR_FORMAT ", reason %d", caps, linkres);
gst_caps_unref (caps);
playbin = group->playbin;
- caps = gst_pad_get_caps_reffed (pad);
+ caps = gst_pad_get_caps (pad, NULL);
s = gst_caps_get_structure (caps, 0);
name = gst_structure_get_name (s);
if (GST_STATE (sink) < GST_STATE_READY)
gst_element_set_state (sink, GST_STATE_READY);
- sinkcaps = gst_pad_get_caps_reffed (sinkpad);
+ sinkcaps = gst_pad_get_caps (sinkpad, NULL);
if (!gst_caps_is_any (sinkcaps))
ret = !gst_pad_accept_caps (sinkpad, caps);
gst_caps_unref (sinkcaps);
if (GST_STATE (sink) < GST_STATE_READY)
gst_element_set_state (sink, GST_STATE_READY);
- sinkcaps = gst_pad_get_caps_reffed (sinkpad);
+ sinkcaps = gst_pad_get_caps (sinkpad, NULL);
if (!gst_caps_is_any (sinkcaps))
ret = !gst_pad_accept_caps (sinkpad, caps);
gst_caps_unref (sinkcaps);
if (GST_STATE (sink) < GST_STATE_READY)
gst_element_set_state (sink, GST_STATE_READY);
- sinkcaps = gst_pad_get_caps_reffed (sinkpad);
+ sinkcaps = gst_pad_get_caps (sinkpad, NULL);
if (!gst_caps_is_any (sinkcaps))
ret = !gst_pad_accept_caps (sinkpad, caps);
gst_caps_unref (sinkcaps);
static void gst_selector_pad_reset (GstSelectorPad * pad);
static gboolean gst_selector_pad_event (GstPad * pad, GstEvent * event);
-static GstCaps *gst_selector_pad_getcaps (GstPad * pad);
+static GstCaps *gst_selector_pad_getcaps (GstPad * pad, GstCaps * filter);
static GstFlowReturn gst_selector_pad_chain (GstPad * pad, GstBuffer * buf);
enum
}
static GstCaps *
-gst_selector_pad_getcaps (GstPad * pad)
+gst_selector_pad_getcaps (GstPad * pad, GstCaps * filter)
{
GstStreamSelector *sel;
GstCaps *caps;
sel = GST_STREAM_SELECTOR (gst_pad_get_parent (pad));
GST_DEBUG_OBJECT (sel, "Getting caps of srcpad peer");
- caps = gst_pad_peer_get_caps (sel->srcpad);
+ caps = gst_pad_peer_get_caps (sel->srcpad, filter);
if (caps == NULL)
- caps = gst_caps_new_any ();
+ caps = (filter ? gst_caps_ref (filter) : gst_caps_new_any ());
gst_object_unref (sel);
static void gst_stream_selector_release_pad (GstElement * element,
GstPad * pad);
static GstIterator *gst_stream_selector_pad_iterate_linked_pads (GstPad * pad);
-static GstCaps *gst_stream_selector_getcaps (GstPad * pad);
+static GstCaps *gst_stream_selector_getcaps (GstPad * pad, GstCaps * filter);
static GstElementClass *parent_class = NULL;
}
static GstCaps *
-gst_stream_selector_getcaps (GstPad * pad)
+gst_stream_selector_getcaps (GstPad * pad, GstCaps * filter)
{
GstPad *otherpad;
GstObject *parent;
if (!otherpad) {
GST_DEBUG_OBJECT (parent,
"Pad %s:%s not linked, returning ANY", GST_DEBUG_PAD_NAME (pad));
- caps = gst_caps_new_any ();
+ caps = (filter ? gst_caps_ref (filter) : gst_caps_new_any ());
} else {
GST_DEBUG_OBJECT (parent,
"Pad %s:%s is linked (to %s:%s), returning peer caps",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (otherpad));
/* if the peer has caps, use those. If the pad is not linked, this function
* returns NULL and we return ANY */
- if (!(caps = gst_pad_peer_get_caps (otherpad)))
- caps = gst_caps_new_any ();
+ if (!(caps = gst_pad_peer_get_caps (otherpad, filter)))
+ caps = (filter ? gst_caps_ref (filter) : gst_caps_new_any ());
gst_object_unref (otherpad);
}
}
static GstCaps *
-gst_stream_synchronizer_getcaps (GstPad * pad)
+gst_stream_synchronizer_getcaps (GstPad * pad, GstCaps * filter)
{
GstPad *opad;
GstCaps *ret = NULL;
opad = gst_stream_get_other_pad_from_pad (pad);
if (opad) {
- ret = gst_pad_peer_get_caps (opad);
+ ret = gst_pad_peer_get_caps (opad, filter);
gst_object_unref (opad);
}
if (ret == NULL)
- ret = gst_caps_new_any ();
+ ret = (filter ? gst_caps_ref (filter) : gst_caps_new_any ());
GST_LOG_OBJECT (pad, "Returning caps: %" GST_PTR_FORMAT, ret);
if (peer) {
subcaps = gst_pad_get_negotiated_caps (peer);
if (!subcaps) {
- subcaps = gst_pad_get_caps_reffed (peer);
+ subcaps = gst_pad_get_caps (peer, NULL);
if (!gst_caps_is_fixed (subcaps)) {
gst_caps_unref (subcaps);
subcaps = NULL;
video_caps = gst_pad_get_negotiated_caps (video_peer);
if (!video_caps) {
- video_caps = gst_pad_get_caps_reffed (video_peer);
+ video_caps = gst_pad_get_caps (video_peer, NULL);
if (!gst_caps_is_fixed (video_caps)) {
gst_caps_unref (video_caps);
video_caps = NULL;
}
static GstCaps *
-gst_subtitle_overlay_subtitle_sink_getcaps (GstPad * pad)
+gst_subtitle_overlay_subtitle_sink_getcaps (GstPad * pad, GstCaps * filter)
{
GstSubtitleOverlay *self = GST_SUBTITLE_OVERLAY (gst_pad_get_parent (pad));
GstCaps *ret;
g_mutex_lock (self->factories_lock);
if (G_UNLIKELY (!gst_subtitle_overlay_update_factory_list (self)))
ret = GST_CAPS_NONE;
+ else if (filter)
+ ret =
+ gst_caps_intersect_full (filter, self->factory_caps,
+ GST_CAPS_INTERSECT_FIRST);
else
ret = gst_caps_ref (self->factory_caps);
g_mutex_unlock (self->factories_lock);
static gboolean
gst_subtitle_overlay_subtitle_sink_acceptcaps (GstPad * pad, GstCaps * caps)
{
- GstCaps *othercaps = gst_subtitle_overlay_subtitle_sink_getcaps (pad);
+ GstCaps *othercaps = gst_subtitle_overlay_subtitle_sink_getcaps (pad, NULL);
gboolean ret = gst_caps_can_intersect (caps, othercaps);
gst_caps_unref (othercaps);
caps = gst_pad_get_negotiated_caps (peer);
if (!caps) {
- caps = gst_pad_get_caps_reffed (peer);
+ caps = gst_pad_get_caps (peer, NULL);
if (!gst_caps_is_fixed (caps)) {
gst_caps_unref (caps);
caps = NULL;
gint capssize;
gboolean res = FALSE;
- caps = gst_pad_get_caps_reffed (pad);
+ caps = gst_pad_get_caps (pad, NULL);
if (caps == NULL)
return FALSE;