GstPad *pad; /* srcpad that caused creation of this chain */
+ gboolean drained; /* TRUE if the all children are drained */
gboolean demuxer; /* TRUE if elements->data is a demuxer */
gboolean seekable; /* TRUE if this chain ends on a demuxer and is seekable */
GList *elements; /* All elements in this group, first
goto exit;
}
+#ifdef GST_EXT_DECODEBIN2_QUEUESIZE
+ if (gst_structure_has_name (gst_caps_get_structure (caps, 0), "application/x-hls") ||
+ gst_structure_has_name (gst_caps_get_structure (caps, 0), "application/x-ss")) {
+ GST_DEBUG_OBJECT (decode_bin, "decodebin2 got hls/ss caps.. set queue max-size-time to 1 sec");
+ decode_bin->max_size_time = 1 * GST_SECOND;
+ }
+#endif
+
/* FIXME: we can only deal with one type, we don't yet support dynamically changing
* caps from the typefind element */
if (decode_bin->have_type || decode_bin->decode_chain)
GstDecodeGroup *group = g_slice_new0 (GstDecodeGroup);
GstElement *mq;
gboolean seekable;
+#ifdef GST_EXT_DECODEBIN2_MODIFICATION
+ gboolean smooth_stream_demuxer_last = FALSE;
+#endif
GST_DEBUG_OBJECT (dbin, "Creating new group %p with parent chain %p", group,
parent);
if (G_UNLIKELY (!group->multiqueue))
goto missing_multiqueue;
+#ifdef GST_EXT_DECODEBIN2_MODIFICATION
+ /*Check if last parent elment is smooth streaming demuxer.*/
+ if (parent && parent->demuxer)
+ {
+ GstElement *element =
+ ((GstDecodeElement *) parent->elements->data)->element;
+ if(g_strrstr(GST_ELEMENT_NAME(element), "dashdemux"))
+ smooth_stream_demuxer_last = TRUE;
+ }
+
+ /* default is for use-buffering is FALSE
+ We should disable buffering in multiqueue after smooth streaming
+ demuxers like dashdemux because they are fake demuxers.*/
+ if (dbin->use_buffering && !smooth_stream_demuxer_last)
+#else
/* default is for use-buffering is FALSE */
- if (dbin->use_buffering) {
+ if (dbin->use_buffering)
+#endif
+ {
g_object_set (mq,
"use-buffering", TRUE,
"low-percent", dbin->low_percent,
gboolean * last_group, gboolean * drained, gboolean * switched)
{
gboolean handled = FALSE;
- gboolean alldrained = TRUE;
GList *tmp;
GST_DEBUG ("Checking group %p (target pad %s:%s)",
/* Figure out if all our chains are drained with the
* new information */
+ group->drained = TRUE;
for (tmp = group->children; tmp; tmp = tmp->next) {
GstDecodeChain *chain = (GstDecodeChain *) tmp->data;
gboolean subdrained = FALSE;
drain_and_switch_chains (chain, drainpad, last_group, &subdrained,
switched);
if (!subdrained)
- alldrained = FALSE;
+ group->drained = FALSE;
}
beach:
GST_DEBUG ("group %p (last_group:%d, drained:%d, switched:%d, handled:%d)",
- group, *last_group, alldrained, *switched, handled);
- *drained = alldrained;
+ group, *last_group, group->drained, *switched, handled);
+ *drained = group->drained;
return handled;
}
CHAIN_MUTEX_LOCK (chain);
+ /* Definitely can't be in drained chains */
+ if (G_UNLIKELY (chain->drained)) {
+ goto beach;
+ }
+
if (chain->endpad) {
/* Check if we're reached the target endchain */
if (chain == drainpad->chain) {
handled = TRUE;
}
- *drained = chain->endpad->drained;
+ chain->drained = chain->endpad->drained;
goto beach;
}
chain->next_groups =
g_list_delete_link (chain->next_groups, chain->next_groups);
*switched = TRUE;
- *drained = FALSE;
+ chain->drained = FALSE;
} else {
GST_DEBUG ("Group %p was the last in chain %p", chain->active_group,
chain);
- *drained = TRUE;
+ chain->drained = TRUE;
/* We're drained ! */
}
}
CHAIN_MUTEX_UNLOCK (chain);
GST_DEBUG ("Chain %p (handled:%d, last_group:%d, drained:%d, switched:%d)",
- chain, handled, *last_group, *drained, *switched);
+ chain, handled, *last_group, chain->drained, *switched);
+
+ *drained = chain->drained;
if (*drained)
g_signal_emit (dbin, gst_decode_bin_signals[SIGNAL_DRAINED], 0, NULL);