mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
qtdemux: improve mss_mode/fragmented special handling
Make it clear what should be handled purely by mss mode: 1) Expose the streams on the first moof as there are no moov atoms 2) Properly cleanup streams on flushes Add a note about the meaning of upstream_newsegment and mss_mode for future reference. Make all other special fragment handling shared for both dash and mss streams.
This commit is contained in:
parent
a82f3418fd
commit
c1cd2f81f9
2 changed files with 15 additions and 11 deletions
|
@ -911,7 +911,6 @@ gst_qtdemux_push_pending_newsegment (GstQTDemux * qtdemux)
|
||||||
if (qtdemux->pending_newsegment) {
|
if (qtdemux->pending_newsegment) {
|
||||||
gst_qtdemux_push_event (qtdemux, qtdemux->pending_newsegment);
|
gst_qtdemux_push_event (qtdemux, qtdemux->pending_newsegment);
|
||||||
qtdemux->pending_newsegment = NULL;
|
qtdemux->pending_newsegment = NULL;
|
||||||
qtdemux->upstream_newsegment = FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1559,7 +1558,7 @@ gst_qtdemux_handle_src_event (GstPad * pad, GstObject * parent,
|
||||||
GstClockTime ts = gst_util_get_timestamp ();
|
GstClockTime ts = gst_util_get_timestamp ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (qtdemux->mss_mode || qtdemux->fragmented) {
|
if (qtdemux->upstream_newsegment || qtdemux->fragmented) {
|
||||||
/* seek should be handled by upstream, we might need to re-download fragments */
|
/* seek should be handled by upstream, we might need to re-download fragments */
|
||||||
GST_DEBUG_OBJECT (qtdemux,
|
GST_DEBUG_OBJECT (qtdemux,
|
||||||
"leting upstream handle seek for smoothstreaming");
|
"leting upstream handle seek for smoothstreaming");
|
||||||
|
@ -1789,6 +1788,8 @@ gst_qtdemux_setcaps (GstQTDemux * demux, GstCaps * caps)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gst_caps_replace (&demux->media_caps, (GstCaps *) mediacaps);
|
gst_caps_replace (&demux->media_caps, (GstCaps *) mediacaps);
|
||||||
|
} else {
|
||||||
|
demux->mss_mode = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1802,7 +1803,7 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
|
||||||
GST_DEBUG_OBJECT (qtdemux, "Resetting demux");
|
GST_DEBUG_OBJECT (qtdemux, "Resetting demux");
|
||||||
gst_pad_stop_task (qtdemux->sinkpad);
|
gst_pad_stop_task (qtdemux->sinkpad);
|
||||||
|
|
||||||
if (hard || qtdemux->mss_mode) {
|
if (hard || qtdemux->upstream_newsegment) {
|
||||||
qtdemux->state = QTDEMUX_STATE_INITIAL;
|
qtdemux->state = QTDEMUX_STATE_INITIAL;
|
||||||
qtdemux->neededbytes = 16;
|
qtdemux->neededbytes = 16;
|
||||||
qtdemux->todrop = 0;
|
qtdemux->todrop = 0;
|
||||||
|
@ -1839,7 +1840,7 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
|
||||||
if (qtdemux->pending_newsegment)
|
if (qtdemux->pending_newsegment)
|
||||||
gst_event_unref (qtdemux->pending_newsegment);
|
gst_event_unref (qtdemux->pending_newsegment);
|
||||||
qtdemux->pending_newsegment = NULL;
|
qtdemux->pending_newsegment = NULL;
|
||||||
qtdemux->upstream_newsegment = TRUE;
|
qtdemux->upstream_newsegment = FALSE;
|
||||||
qtdemux->upstream_seekable = FALSE;
|
qtdemux->upstream_seekable = FALSE;
|
||||||
qtdemux->upstream_size = 0;
|
qtdemux->upstream_size = 0;
|
||||||
|
|
||||||
|
@ -1914,11 +1915,9 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (demux, "Not storing upstream newsegment, "
|
GST_DEBUG_OBJECT (demux, "Not storing upstream newsegment, "
|
||||||
"not in time format");
|
"not in time format");
|
||||||
}
|
|
||||||
|
|
||||||
/* chain will send initial newsegment after pads have been added */
|
/* chain will send initial newsegment after pads have been added */
|
||||||
if (demux->state != QTDEMUX_STATE_MOVIE || !demux->n_streams) {
|
if (demux->state != QTDEMUX_STATE_MOVIE || !demux->n_streams) {
|
||||||
if (!demux->mss_mode) {
|
|
||||||
GST_DEBUG_OBJECT (demux, "still starting, eating event");
|
GST_DEBUG_OBJECT (demux, "still starting, eating event");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
@ -2002,7 +2001,7 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
|
||||||
demux->neededbytes = demux->todrop + stream->samples[idx].size;
|
demux->neededbytes = demux->todrop + stream->samples[idx].size;
|
||||||
} else {
|
} else {
|
||||||
/* set up for EOS */
|
/* set up for EOS */
|
||||||
if (demux->mss_mode) {
|
if (demux->upstream_newsegment) {
|
||||||
demux->neededbytes = 16;
|
demux->neededbytes = 16;
|
||||||
} else {
|
} else {
|
||||||
demux->neededbytes = -1;
|
demux->neededbytes = -1;
|
||||||
|
|
|
@ -114,7 +114,10 @@ struct _GstQTDemux {
|
||||||
/* configured playback region */
|
/* configured playback region */
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
GstEvent *pending_newsegment;
|
GstEvent *pending_newsegment;
|
||||||
gboolean upstream_newsegment;
|
gboolean upstream_newsegment; /* qtdemux received upstream
|
||||||
|
* newsegment in TIME format which likely
|
||||||
|
* means that upstream is driving the pipeline
|
||||||
|
* (adaptive demuxers) */
|
||||||
gint64 seek_offset;
|
gint64 seek_offset;
|
||||||
gint64 push_seek_start;
|
gint64 push_seek_start;
|
||||||
gint64 push_seek_stop;
|
gint64 push_seek_stop;
|
||||||
|
@ -132,7 +135,9 @@ struct _GstQTDemux {
|
||||||
* upstream provides it at the caps */
|
* upstream provides it at the caps */
|
||||||
GstCaps *media_caps;
|
GstCaps *media_caps;
|
||||||
gboolean exposed;
|
gboolean exposed;
|
||||||
gboolean mss_mode; /* flag to indicate that we're working with a smoothstreaming fragment */
|
gboolean mss_mode; /* flag to indicate that we're working with a smoothstreaming fragment
|
||||||
|
* Mss doesn't have 'moov' or any information about the streams format,
|
||||||
|
* requiring qtdemux to expose and create the streams */
|
||||||
guint64 fragment_start;
|
guint64 fragment_start;
|
||||||
guint64 fragment_start_offset;
|
guint64 fragment_start_offset;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue