}
#ifdef TIZEN_FEATURE_ADAPTIVE_MODIFICATION
+static guint
+get_num_of_codec(GstHLSVariantStream * variant)
+{
+#define MAX_NUM_OF_CODEC 10
+
+ guint cnt = 0;
+ gchar** codec_list = NULL;
+
+ if (!variant || !variant->codecs)
+ return 0;
+
+ codec_list = g_strsplit(variant->codecs, ",", MAX_NUM_OF_CODEC);
+ if (codec_list) {
+ cnt = g_strv_length(codec_list);
+ g_strfreev(codec_list);
+ }
+
+ return cnt;
+}
+
+static gboolean
+check_num_of_codec(GstHLSVariantStream * variant, guint req_num)
+{
+ guint num_of_codec = 0;
+
+ if (!variant)
+ return FALSE;
+
+ num_of_codec = get_num_of_codec(variant);
+
+ if (num_of_codec > 0 && req_num > 0 && num_of_codec != req_num) {
+ GST_WARNING("can not support to change codec");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
GstHLSVariantStream *
gst_hls_master_playlist_get_variant_for_max_limit (GstHLSMasterPlaylist *
playlist, GstHLSVariantStream * current_variant, guint bitrate, gint bandwidth, gint width, gint height)
GstHLSVariantStream *variant = NULL;
GList *l;
guint max_bandwidth = (bandwidth > DEFAULT_ADAPTIVE_VARIANT)?(guint)(bandwidth):(bitrate);
+ guint num_of_codec = 0;
+
+ num_of_codec = get_num_of_codec(current_variant);
GST_INFO("max limit : %u, %d, [w]%d [h]%d", bitrate, bandwidth, width, height);
l = g_list_last (playlist->iframe_variants);
for (; l; l = g_list_previous(l)) {
+ if (!check_num_of_codec((GstHLSVariantStream *)l->data, num_of_codec))
+ continue;
+
tmp = l->data;
if (tmp->bandwidth > max_bandwidth)
GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE;
if (G_UNLIKELY (stream->pending_caps)) {
#ifdef TIZEN_FEATURE_ADAPTIVE_MODIFICATION
- gst_caps_make_writable (stream->pending_caps);
+ stream->pending_caps = gst_caps_make_writable (stream->pending_caps);
if (gst_adaptive_demux_is_live (demux)) {
gst_caps_set_simple (stream->pending_caps, "is_live", G_TYPE_BOOLEAN,
TRUE, NULL);
(G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_ADAPTIVE_DEMUX,GstAdaptiveDemuxClass))
#define GST_IS_ADAPTIVE_DEMUX(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ADAPTIVE_DEMUX))
-#define GST_IS_ADAPTIVE_DEMUX_CLASS(obj) \
+#define GST_IS_ADAPTIVE_DEMUX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ADAPTIVE_DEMUX))
#define GST_ADAPTIVE_DEMUX_CAST(obj) ((GstAdaptiveDemux *)obj)