From: Eunhye Choi Date: Tue, 28 Sep 2021 07:08:28 +0000 (+0900) Subject: decodebin3: Avoid overriding explicit user selection X-Git-Tag: accepted/tizen/unified/20220217.153506~2^2~10^2~9^2~16^2~1^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67dd9b7d4a51183b121f1ad41cfdf3191bbda2a8;p=platform%2Fupstream%2Fgstreamer.git decodebin3: Avoid overriding explicit user selection In case the user set a list of streams to select or answer explicitly to all 'select-stream' event, we should respect the choice and not try to add a stream per type. related upstream commit : b41b87522f59355bb21c001e9e2df96dc6956928 c9c93339fbd2d37f1ddfd054f7f9e26bce6df743 40fde5fcad0bcdb5429d7bf573690cfe55fc79c8 Change-Id: I63b75bb02fbe40392ae3edbf83a9830d7b606437 --- diff --git a/gst/playback/gstdecodebin3.c b/gst/playback/gstdecodebin3.c index bb87df6..8892afd 100644 --- a/gst/playback/gstdecodebin3.c +++ b/gst/playback/gstdecodebin3.c @@ -1012,7 +1012,9 @@ gst_decodebin3_input_pad_unlink (GstPad * pad, GstObject * parent) if (dbin->collection) gst_object_unref (dbin->collection); dbin->collection = collection; - +#ifdef TIZEN_FEATURE_UPSTREAM + dbin->select_streams_seqnum = GST_SEQNUM_INVALID; +#endif msg = gst_message_new_stream_collection ((GstObject *) dbin, dbin->collection); @@ -1212,6 +1214,9 @@ update_requested_selection (GstDecodebin3 * dbin) GList *tmp = NULL; GstStreamType used_types = 0; GstStreamCollection *collection; +#ifdef TIZEN_FEATURE_UPSTREAM + gboolean all_user_selected = TRUE; +#endif /* 1. Is there a pending SELECT_STREAMS we can return straight away since * the switch handler will take care of the pending selection */ @@ -1244,6 +1249,12 @@ update_requested_selection (GstDecodebin3 * dbin) gst_decodebin3_signals[SIGNAL_SELECT_STREAM], 0, collection, stream, &request); GST_DEBUG_OBJECT (dbin, "stream %s , request:%d", sid, request); + +#ifdef TIZEN_FEATURE_UPSTREAM + if (request == -1) + all_user_selected = FALSE; +#endif + if (request == 1 || (request == -1 && (stream_in_list (dbin->requested_selection, sid) || stream_in_list (dbin->active_selection, sid)))) { @@ -1261,15 +1272,20 @@ update_requested_selection (GstDecodebin3 * dbin) } /* 4. If not, match one stream of each type */ - for (i = 0; i < nb; i++) { - GstStream *stream = gst_stream_collection_get_stream (collection, i); - GstStreamType curtype = gst_stream_get_stream_type (stream); - if (!(used_types & curtype)) { - const gchar *sid = gst_stream_get_stream_id (stream); - GST_DEBUG_OBJECT (dbin, "Selecting stream '%s' of type %s", - sid, gst_stream_type_get_name (curtype)); - tmp = g_list_append (tmp, (gchar *) sid); - used_types |= curtype; +#ifdef TIZEN_FEATURE_UPSTREAM + if (!all_user_selected && dbin->select_streams_seqnum == GST_SEQNUM_INVALID) +#endif + { + for (i = 0; i < nb; i++) { + GstStream *stream = gst_stream_collection_get_stream (collection, i); + GstStreamType curtype = gst_stream_get_stream_type (stream); + if (!(used_types & curtype)) { + const gchar *sid = gst_stream_get_stream_id (stream); + GST_DEBUG_OBJECT (dbin, "Selecting stream '%s' of type %s", + sid, gst_stream_type_get_name (curtype)); + tmp = g_list_append (tmp, (gchar *) sid); + used_types |= curtype; + } } } @@ -1551,6 +1567,10 @@ handle_stream_collection (GstDecodebin3 * dbin, /* dbin->pending_collection = */ /* g_list_append (dbin->pending_collection, collection); */ } + +#ifdef TIZEN_FEATURE_UPSTREAM + dbin->select_streams_seqnum = GST_SEQNUM_INVALID; +#endif SELECTION_UNLOCK (dbin); } @@ -1748,7 +1768,12 @@ is_selection_done (GstDecodebin3 * dbin) /* We are completely active */ msg = gst_message_new_streams_selected ((GstObject *) dbin, dbin->collection); - GST_MESSAGE_SEQNUM (msg) = dbin->select_streams_seqnum; +#ifdef TIZEN_FEATURE_UPSTREAM + if (dbin->select_streams_seqnum != GST_SEQNUM_INVALID) +#endif + { + gst_message_set_seqnum (msg, dbin->select_streams_seqnum); + } for (tmp = dbin->output_streams; tmp; tmp = tmp->next) { DecodebinOutputStream *output = (DecodebinOutputStream *) tmp->data; if (output->slot) { diff --git a/packaging/gst-plugins-base.spec b/packaging/gst-plugins-base.spec index ce6cbf1..71b292f 100644 --- a/packaging/gst-plugins-base.spec +++ b/packaging/gst-plugins-base.spec @@ -5,7 +5,7 @@ Name: gst-plugins-base Version: 1.16.2 -Release: 18 +Release: 19 License: LGPL-2.0+ Summary: GStreamer Streaming-Media Framework Plug-Ins Url: http://gstreamer.freedesktop.org/