[Bug 795424] qtdemux: Add MSE-style flush

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Apr 23 10:37:35 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=795424

--- Comment #5 from Alicia Boya García <aboya at igalia.com> ---
(In reply to Sebastian Dröge (slomo) from comment #4)
> Why is the normal flushing not sufficient?

Flushing as is currently implemented (let's call it "jump-style flush") in
qtdemux is not designed to work by itself, but only in response to a seek.
qtdemux receives a seek to a time position, finds the frame in the sample
table, rewinds its internal pointers to its offset and emits a byte seek
upstream to the offset of the first frame to be decoded after the seek. When
upstream flushes, qtdemux knows it is reading a frame. Note even though this
kind of flush technically comes from upstream, it's always a direct consequence
of qtdemux itself performing a byte seek.

MSE-style flushing is completely different. Here upstream (actually, the
application), by itself, decides to send the flush (there are no seek events
involved in the process). qtdemux in response forgets the sample table (in the
jump-style flush the table had to be preserved) and the demuxer sets up to read
a new atom from the start, usually a moof box (in the jump-style flush qtdemux
set up to read a frame somewhere *inside* an mdat).

> You should flush on the sinkpad, not the srcpads.

I know. Have I done otherwise anywhere?

> And qtdemux should then forget all data it has but not forget the headers it
> parsed (i.e. remember what tracks there are, the caps, etc.).

This was always my intention and it's totally the case with my patch.

There are even tests checking that. See
test_qtdemux_fragments_flush_between_frags for instance. You can see how the
initialization segment (bytes containing the headers -- the moov box) is only
fed once:

+  qtdemux_fragment_tester_feed_and_wait (tester,
+      new_initialization_segment (dash_movie));

Then a fragment (moof+mdat) is fed, then flush is sent, then a new fragment. No
need to send the headers again.

+  qtdemux_fragment_tester_feed_and_wait (tester,
+      new_fragment_buffer (dash_movie, 0));
+  [...]
+
+  qtdemux_fragment_tester_mse_flush (tester);
+
+  qtdemux_fragment_tester_feed_and_wait (tester,
+      new_fragment_buffer (dash_movie, 1));

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list