When reaching the end of non-frame wrapping track in pull mode, we want to force
the switch to the next non-eos pad. This is similar to when we exceed the
maximum drift.
Fixes issues on EOS where not everything would be drained out and stray errors
would pop out.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2434>
* If we have an index table for non-framed essence, we can handle it
* The demuxer has a state which indicates whether it will next fetch a KLV or
data contained *within* a KLV.
* The position on Essence Tracks always correspond to the next entry to fetch,
demuxer offset will be skipped accordingly whenever we switch between
partitions (in case of resyncs). A copy of the main clip/custom KLV for that
partition is kept to track the position within the essence of that partition.
* For clip/custom-wrapped raw audio, if the edit rate is too small (and would
cause plenty of tiny buffers to be outputted), specify a minimum number of edit
units per buffer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>
* For pull-based, this avoids pulling content if it's not needed (ex: skipping filler
packet, not downloading the content if we only need to know if/where an essence
packet is, etc...). Allows reducing i/o usage to the minimum.
* This also allows doing sub-klv position tracking, and opens the way for
non-frame-wrapping handling
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>
In order to figure out the exact start position (backed by a keyframe) accross
all tracks, we first figure out the backing keyframe position, and *then* seek
to that position.
Avoids ending up in situations where we would properly seek to the backing
keyframe on video ... but not on the audio streams (they would have been set to
the original non-keyframe position). Fixes key-unit seeking.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>
The picture essence coding matching was wrong. Use the proper "base" MXFUL for
video mpeg compression for matching.
Also handle the case where some old files would put the essence container label
in the essence coding field
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>
* Streamline offset <=> entry handling. Historically the demuxer didn't support
information from index tables and stored the discovered information in an array
per track. When index table support was added, a parallel system was setup for
that relationship. This commit unifies this into one system with the
`find_edit_entry()` and `find_entry_for_offset()` functions.
* By extension, per-track offset entry tables are only created/used if no index
table is present for those tracks.
* Use index table information as-is. The index table system from MXF is quite
complex and there are various ways to use the information contained
within. Instead of converting that information we store the data from the tables
as-is and extract the needed information when needed.
* Handle index tables without entries (i.e. all content package units are of the
same size).
* Allow collecting index table segments as we go instead of only once if a
random-index-pack is present. This also improves support of some files in
push-mode.
* When searching for keyframe entries, use the keyframe_offset if
present (speeds up searching).
* For interleaved content (i.e. several tracks in the sample essence container),
we use a system to be able to identify the position of each track in the delta
entries of index tables.
* Handle temporal offset only on tracks which *do* need it (as specified in the
delta entries of the index tables). If present, those offsets are stored in a
pre-processed table which allows computing PTS from DTS with a simple offset.
* Add a quirk for files which are known to be have wrongly stored temporal
offsets.
* Overall opens the way to handle more types of MXF files, especially those with
non-frame-wrapping.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>
This is similar to how the same issue was handled in qtdemux.
In order for the "DTS <= PTS" constraint to be respected, we calculate the
maximum temporal reordering that can happen (via index tables).
If there is a non-0 temporal reordering, we:
* Shift all outgoing PTS by that amount
* Shift segment for that stream by that amount
* Don't modify DTS (i.e. they might end up having negative running-time, before
the start of the segment)
Also ensure all entries have a valid PTS set, previously this wouldn't be set
for entries with a temporal offset of 0.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/584
(and maybe a lot of other issues)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>
The previous test was preventing the pad to be in EOS
when the segment position was greater than segment stop.
It ended up consuming all the data before getting in EOS.
Regarding GST_SEEK_FLAG_SEGMENT it seems to be
correctly handled later in the method.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2173>
This allows us to know exactly where in the material track we are, and
how to convert from a PTS for a source track to the actual PTS of the
material track (i.e. by adding the component start position).
https://bugzilla.gnome.org/show_bug.cgi?id=785119