gst_stream_get_caps() returns a reffed caps.
The caps passed to gst_query_set_caps_result() are not transfered.
The caps in gst_parse_pad_stream_start_event() was either acquired
using gst_pad_get_current_caps() which returns a new ref or
explicitly reffed.
https://bugzilla.gnome.org/show_bug.cgi?id=768811
for (i = 0; i < gst_stream_collection_get_size (collection); i++) {
GstStream *stream = gst_stream_collection_get_stream (collection, i);
const GstTagList *taglist;
for (i = 0; i < gst_stream_collection_get_size (collection); i++) {
GstStream *stream = gst_stream_collection_get_stream (collection, i);
const GstTagList *taglist;
GST_DEBUG (" Stream '%s'", gst_stream_get_stream_id (stream));
GST_DEBUG (" type : %s",
GST_DEBUG (" Stream '%s'", gst_stream_get_stream_id (stream));
GST_DEBUG (" type : %s",
GST_DEBUG (" tags : %" GST_PTR_FORMAT, taglist);
caps = gst_stream_get_caps (stream);
GST_DEBUG (" caps : %" GST_PTR_FORMAT, caps);
GST_DEBUG (" tags : %" GST_PTR_FORMAT, taglist);
caps = gst_stream_get_caps (stream);
GST_DEBUG (" caps : %" GST_PTR_FORMAT, caps);
GstDecodebin3 *dbin = slot->dbin;
DecodebinOutputStream *output = NULL;
const gchar *stream_id;
GstDecodebin3 *dbin = slot->dbin;
DecodebinOutputStream *output = NULL;
const gchar *stream_id;
/* If we already have a configured output, just use it */
if (slot->output != NULL)
/* If we already have a configured output, just use it */
if (slot->output != NULL)
stream_id = gst_stream_get_stream_id (slot->active_stream);
caps = gst_stream_get_caps (slot->active_stream);
GST_DEBUG_OBJECT (dbin, "stream %s , %" GST_PTR_FORMAT, stream_id, caps);
stream_id = gst_stream_get_stream_id (slot->active_stream);
caps = gst_stream_get_caps (slot->active_stream);
GST_DEBUG_OBJECT (dbin, "stream %s , %" GST_PTR_FORMAT, stream_id, caps);
/* 0. Emit autoplug-continue signal for pending caps ? */
GST_FIXME_OBJECT (dbin, "emit autoplug-continue");
/* 0. Emit autoplug-continue signal for pending caps ? */
GST_FIXME_OBJECT (dbin, "emit autoplug-continue");
case GST_QUERY_CAPS:
{
GST_DEBUG_OBJECT (pad, "Intercepting CAPS query");
case GST_QUERY_CAPS:
{
GST_DEBUG_OBJECT (pad, "Intercepting CAPS query");
- gst_query_set_caps_result (query, gst_caps_new_any ());
+ gst_query_set_caps_result (query, GST_CAPS_ANY);
ret = GST_PAD_PROBE_HANDLED;
}
break;
ret = GST_PAD_PROBE_HANDLED;
}
break;
{
GList *res;
GstElement *element = NULL;
{
GList *res;
GstElement *element = NULL;
g_mutex_lock (&dbin->factories_lock);
gst_decode_bin_update_factories_list (dbin);
g_mutex_lock (&dbin->factories_lock);
gst_decode_bin_update_factories_list (dbin);
+ caps = gst_stream_get_caps (stream);
if (ftype == GST_ELEMENT_FACTORY_TYPE_DECODER)
res =
gst_element_factory_list_filter (dbin->decoder_factories,
if (ftype == GST_ELEMENT_FACTORY_TYPE_DECODER)
res =
gst_element_factory_list_filter (dbin->decoder_factories,
- gst_stream_get_caps (stream), GST_PAD_SINK, TRUE);
+ caps, GST_PAD_SINK, TRUE);
else
res =
gst_element_factory_list_filter (dbin->decodable_factories,
else
res =
gst_element_factory_list_filter (dbin->decodable_factories,
- gst_stream_get_caps (stream), GST_PAD_SINK, TRUE);
+ caps, GST_PAD_SINK, TRUE);
g_mutex_unlock (&dbin->factories_lock);
if (res) {
g_mutex_unlock (&dbin->factories_lock);
if (res) {
GST_DEBUG ("Created element '%s'", GST_ELEMENT_NAME (element));
gst_plugin_feature_list_free (res);
} else {
GST_DEBUG ("Created element '%s'", GST_ELEMENT_NAME (element));
gst_plugin_feature_list_free (res);
} else {
- GST_DEBUG ("Could not find an element for caps %" GST_PTR_FORMAT,
- gst_stream_get_caps (stream));
+ GST_DEBUG ("Could not find an element for caps %" GST_PTR_FORMAT, caps);
if (output->slot != NULL && output->slot != slot) {
GST_WARNING_OBJECT (dbin,
"Output still linked to another slot (%p)", output->slot);
if (output->slot != NULL && output->slot != slot) {
GST_WARNING_OBJECT (dbin,
"Output still linked to another slot (%p)", output->slot);
+ gst_caps_unref (new_caps);
GST_PAD_LINK_CHECK_NOTHING);
output->linked = TRUE;
}
GST_PAD_LINK_CHECK_NOTHING);
output->linked = TRUE;
}
+ gst_caps_unref (new_caps);
if (!gst_ghost_pad_set_target ((GstGhostPad *) output->src_pad, NULL)) {
GST_ERROR_OBJECT (dbin, "Could not release decoder pad");
if (!gst_ghost_pad_set_target ((GstGhostPad *) output->src_pad, NULL)) {
GST_ERROR_OBJECT (dbin, "Could not release decoder pad");
+ gst_caps_unref (new_caps);
output->decoder = NULL;
}
output->decoder = NULL;
}
+ gst_caps_unref (new_caps);
+
/* If a decoder is required, create one */
if (needs_decoder) {
/* If we don't have a decoder yet, instantiate one */
output->decoder = create_decoder (dbin, slot->active_stream);
if (output->decoder == NULL) {
/* If a decoder is required, create one */
if (needs_decoder) {
/* If we don't have a decoder yet, instantiate one */
output->decoder = create_decoder (dbin, slot->active_stream);
if (output->decoder == NULL) {
SELECTION_UNLOCK (dbin);
/* FIXME : Should we be smarter if there's a missing decoder ?
* Should we deactivate that stream ? */
SELECTION_UNLOCK (dbin);
/* FIXME : Should we be smarter if there's a missing decoder ?
* Should we deactivate that stream ? */
+ caps = gst_stream_get_caps (slot->active_stream);
gst_element_post_message (GST_ELEMENT_CAST (dbin),
gst_element_post_message (GST_ELEMENT_CAST (dbin),
- gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin),
- gst_stream_get_caps (slot->active_stream)));
+ gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps));
+ gst_caps_unref (caps);
SELECTION_LOCK (dbin);
goto cleanup;
}
SELECTION_LOCK (dbin);
goto cleanup;
}
gst_object_replace ((GstObject **) & parsepad->active_stream,
(GstObject *) stream);
}
gst_object_replace ((GstObject **) & parsepad->active_stream,
(GstObject *) stream);
}
gst_parse_pad_update_caps (parsepad, caps);
gst_parse_pad_update_caps (parsepad, caps);
+ gst_caps_unref (caps);
+ }
event = gst_event_make_writable (event);
gst_event_set_stream (event, stream);
event = gst_event_make_writable (event);
gst_event_set_stream (event, stream);