good: enable adaptivedemux2 84/287584/3
authorEunhye Choi <eunhae1.choi@samsung.com>
Wed, 1 Feb 2023 03:06:42 +0000 (12:06 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Wed, 1 Feb 2023 03:19:10 +0000 (12:19 +0900)
- good: enable adaptivedemux2 to support hls playback
  with uridecodebin3 which does not use old hlsdemux
- good/adaptivedemux2: make post variant info at new hls plugin
- base/uridecodebin3: make post buffering msg without drop
  to control buffering at libmm-player

Change-Id: I94c310ceefe57efeba439112d1d0fe4f3e38553f

packaging/gstreamer.spec
subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c
subprojects/gst-plugins-base/meson.build
subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.h
subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c
subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c
subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.h
subprojects/gst-plugins-good/meson.build

index c46728b..1ec0c11 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.22.0
-Release:        5
+Release:        6
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
@@ -617,6 +617,7 @@ meson --auto-features=disabled --prefix=/usr --libdir=%{_libdir} --datadir=%{_da
   %if 0%{?ENABLE_AALIB}
     -D %{_good_opt}aalib=enabled \
   %endif
+  -D %{_good_opt}adaptivedemux2=enabled \
   -D %{_good_opt}apetag=enabled \
   -D %{_good_opt}audiofx=enabled \
   -D %{_good_opt}audioparsers=enabled \
@@ -1010,6 +1011,7 @@ rm -rf $RPM_BUILD_ROOT
 %manifest gst-plugins-good.manifest
 %defattr(-, root, root)
 %license subprojects/gst-plugins-good/COPYING
+%{_lib_gstreamer_dir}/libgstadaptivedemux2.so
 %{_lib_gstreamer_dir}/libgstalaw.so
 %{_lib_gstreamer_dir}/libgstapetag.so
 %{_lib_gstreamer_dir}/libgstaudiofx.so
index 5a349ea..b0edb3d 100644 (file)
@@ -2084,9 +2084,11 @@ gst_uri_decode_bin3_handle_message (GstBin * bin, GstMessage * msg)
       /* Find the matching handler (if any) */
       handler = find_source_handler_for_element (uridecodebin, msg->src);
       if (!handler) {
+#ifndef TIZEN_FEATURE_MANUAL_BUFFERING_CTRL /* post buffering msg to app */
         GST_LOG_OBJECT (uridecodebin, "No handler for message, dropping it");
         gst_message_unref (msg);
         msg = NULL;
+#endif
       } else if (!uridecodebin->input_item->main_item
           || handler != uridecodebin->input_item->main_item->handler) {
         GST_LOG_OBJECT (uridecodebin,
index 8b859d3..72c952b 100644 (file)
@@ -396,6 +396,7 @@ core_conf.set('TIZEN_FEATURE_VOLUME_MODIFICATION', true)
 core_conf.set('TIZEN_FEATURE_FORCE_SW_DECODER', true)
 core_conf.set('TIZEN_FEATURE_PLAYBIN3_MODIFICATION', true)
 core_conf.set('TIZEN_FEATURE_DISABLE_EOS_DROP', true)
+core_conf.set('TIZEN_FEATURE_MANUAL_BUFFERING_CTRL', true)
 
 tbm_dep = dependency('libtbm', required : get_option('tbm'))
 if tbm_dep.found()
index d1ad49a..10ad04f 100644 (file)
@@ -64,6 +64,9 @@ G_BEGIN_DECLS
  * Since: 1.6
  */
 #define GST_ADAPTIVE_DEMUX_STATISTICS_MESSAGE_NAME "adaptive-streaming-statistics"
+#ifdef TIZEN_FEATURE_POST_VARIANT_INFO
+#define GST_ADAPTIVE_DEMUX_VARIANT_MESSAGE_NAME "adaptive-streaming-variant"
+#endif
 
 #define GST_ELEMENT_ERROR_FROM_ERROR(el, msg, err) G_STMT_START { \
   gchar *__dbg = g_strdup_printf ("%s: %s", msg, err->message);         \
@@ -202,20 +205,20 @@ struct _GstAdaptiveDemuxPeriod
   gint ref_count;
 
   GstAdaptiveDemux *demux;
-  
+
   /* TRUE if the streams of this period were prepared and can be started */
   gboolean prepared;
 
 
   /* TRUE if there is another period after this one */
   gboolean has_next_period;
-  
+
   /* An increasing unique identifier for the period.
    *
    * Note: unrelated to dash period id (which can be identical across
    * periods) */
   guint period_num;
-  
+
   /* The list of GstAdaptiveDemux2Stream (ref hold) */
   GList *streams;
 
@@ -257,7 +260,7 @@ struct _GstAdaptiveDemux
 
   /* Period used for input */
   GstAdaptiveDemuxPeriod *input_period;
-  
+
   GstSegment segment;
   gdouble instant_rate_multiplier; /* 1.0 by default, or from instant-rate seek */
 
index 6e45c34..c30eac6 100644 (file)
@@ -2667,6 +2667,15 @@ gst_hls_demux_update_playlist (GstHLSDemux * demux, gboolean update,
     }
   }
 
+#ifdef TIZEN_FEATURE_POST_VARIANT_INFO
+  GST_DEBUG_OBJECT (demux, "post variant info message");
+  gst_element_post_message (GST_ELEMENT_CAST (demux),
+      gst_message_new_element (GST_OBJECT_CAST (demux),
+          gst_structure_new (GST_ADAPTIVE_DEMUX_VARIANT_MESSAGE_NAME,
+              "video-variant-info", G_TYPE_POINTER,
+              demux->master->variant_info, NULL)));
+#endif
+
   return GST_FLOW_OK;
 }
 
index 89558a9..ca5b3d7 100644 (file)
@@ -1901,6 +1901,9 @@ hls_master_playlist_unref (GstHLSMasterPlaylist * playlist)
         (GDestroyNotify) gst_hls_variant_stream_unref);
     g_list_free_full (playlist->iframe_variants,
         (GDestroyNotify) gst_hls_variant_stream_unref);
+#ifdef TIZEN_FEATURE_POST_VARIANT_INFO
+    g_list_free_full (playlist->variant_info, g_free);
+#endif
     if (playlist->default_variant)
       gst_hls_variant_stream_unref (playlist->default_variant);
     g_free (playlist->last_data);
@@ -2258,6 +2261,23 @@ hls_master_playlist_new_from_data (gchar * data, const gchar * base_uri)
       g_list_length (playlist->iframe_variants),
       g_list_length (playlist->renditions));
 
+#ifdef TIZEN_FEATURE_POST_VARIANT_INFO
+      GList *v = (playlist->iframe_variants)?(playlist->iframe_variants):(playlist->variants);
+
+      /* update variant stream info */
+      for (; v != NULL; v = v->next) {
+        GstHLSVariantStream *data = v->data;
+        GstM3U8VideoVariantInfo *var_info = g_new0 (GstM3U8VideoVariantInfo, 1);
+
+        GST_LOG ("variant info %d, %d x %d", data->bandwidth, data->width,
+            data->height);
+        var_info->bandwidth = data->bandwidth;
+        var_info->width = data->width;
+        var_info->height = data->height;
+
+        playlist->variant_info = g_list_append (playlist->variant_info, var_info);
+      }
+#endif
 
   return playlist;
 }
index bbe1c1c..3c24a46 100644 (file)
 #ifndef __M3U8_H__
 #define __M3U8_H__
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <gst/gst.h>
 
 G_BEGIN_DECLS
@@ -313,6 +317,15 @@ struct _GstHLSVariantStream {
   GList *fallback;
 };
 
+#ifdef TIZEN_FEATURE_POST_VARIANT_INFO
+typedef struct
+{
+  gint bandwidth;
+  gint width;
+  gint height;
+} GstM3U8VideoVariantInfo;
+#endif
+
 /* Notes: #define are to avoid symbol clashes with legacy hlsdemux */
 
 #define gst_hls_variant_stream_ref hls_variant_stream_ref
@@ -335,6 +348,9 @@ struct _GstHLSMasterPlaylist
   /* Available variant streams, sorted by bitrate (low -> high) */
   GList    *variants;          /* GstHLSVariantStream */
   GList    *iframe_variants;   /* GstHLSVariantStream */
+#ifdef TIZEN_FEATURE_POST_VARIANT_INFO
+  GList    *variant_info;     /* stream variant info */
+#endif
 
   /* Default variant, first in the list (originally, before sorting) */
   GstHLSVariantStream *default_variant;
index 85162ba..33125e7 100644 (file)
@@ -468,6 +468,7 @@ cdata.set('TIZEN_FEATURE_V4L2_SKIP_ADD_COLORSPACE', true)
 cdata.set('TIZEN_FEATURE_GST_MUX_ENHANCEMENT', true)
 cdata.set('TIZEN_FEATURE_V4L2_DISABLE_COLORIMETRY', true)
 cdata.set('TIZEN_FEATURE_V4L2_DECODER_DRC_SUPPORT', true)
+cdata.set('TIZEN_FEATURE_POST_VARIANT_INFO', true)
 
 if get_option('tv-profile')
   cdata.set('TIZEN_PROFILE_TV', true)