decodebin3: Avoid overriding explicit user selection 81/264681/1 accepted/tizen/6.5/unified/20211029.013338 accepted/tizen/unified/20211001.001525 submit/tizen/20210928.073626 submit/tizen_6.5/20211028.163401 tizen_6.5.m2_release
authorEunhye Choi <eunhae1.choi@samsung.com>
Tue, 28 Sep 2021 07:08:28 +0000 (16:08 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Tue, 28 Sep 2021 07:08:31 +0000 (16:08 +0900)
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

gst/playback/gstdecodebin3.c
packaging/gst-plugins-base.spec

index bb87df6..8892afd 100644 (file)
@@ -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) {
index ce6cbf1..71b292f 100644 (file)
@@ -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/