mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
decodebin3: Store GstStreamCollection from upstream
If upstream provides stream collection, use/store them as soon as possible Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
This commit is contained in:
parent
64d775a44f
commit
d14c14dcc4
1 changed files with 26 additions and 0 deletions
|
@ -491,6 +491,8 @@ gst_decodebin3_select_stream (GstDecodebin3 * dbin,
|
||||||
|
|
||||||
static GstPad *gst_decodebin3_request_new_pad (GstElement * element,
|
static GstPad *gst_decodebin3_request_new_pad (GstElement * element,
|
||||||
GstPadTemplate * temp, const gchar * name, const GstCaps * caps);
|
GstPadTemplate * temp, const gchar * name, const GstCaps * caps);
|
||||||
|
static void handle_stream_collection (GstDecodebin3 * dbin,
|
||||||
|
GstStreamCollection * collection, DecodebinInput * input);
|
||||||
static void gst_decodebin3_handle_message (GstBin * bin, GstMessage * message);
|
static void gst_decodebin3_handle_message (GstBin * bin, GstMessage * message);
|
||||||
static GstStateChangeReturn gst_decodebin3_change_state (GstElement * element,
|
static GstStateChangeReturn gst_decodebin3_change_state (GstElement * element,
|
||||||
GstStateChange transition);
|
GstStateChange transition);
|
||||||
|
@ -1062,6 +1064,30 @@ sink_event_function (GstPad * sinkpad, GstDecodebin3 * dbin, GstEvent * event)
|
||||||
dbin->upstream_selected = TRUE;
|
dbin->upstream_selected = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GST_EVENT_STREAM_COLLECTION:
|
||||||
|
{
|
||||||
|
GstStreamCollection *collection = NULL;
|
||||||
|
gst_event_parse_stream_collection (event, &collection);
|
||||||
|
if (collection) {
|
||||||
|
INPUT_LOCK (dbin);
|
||||||
|
handle_stream_collection (dbin, collection, input);
|
||||||
|
gst_object_unref (collection);
|
||||||
|
INPUT_UNLOCK (dbin);
|
||||||
|
SELECTION_LOCK (dbin);
|
||||||
|
/* Post the (potentially) updated collection */
|
||||||
|
if (dbin->collection) {
|
||||||
|
GstMessage *msg;
|
||||||
|
msg =
|
||||||
|
gst_message_new_stream_collection ((GstObject *) dbin,
|
||||||
|
dbin->collection);
|
||||||
|
SELECTION_UNLOCK (dbin);
|
||||||
|
gst_element_post_message (GST_ELEMENT_CAST (dbin), msg);
|
||||||
|
update_requested_selection (dbin);
|
||||||
|
} else
|
||||||
|
SELECTION_UNLOCK (dbin);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case GST_EVENT_CAPS:
|
case GST_EVENT_CAPS:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (sinkpad,
|
GST_DEBUG_OBJECT (sinkpad,
|
||||||
|
|
Loading…
Reference in a new issue