This will later be used to keep the structural metadata when
remuxing an MXF file and can also be used in Pitivi for example
to know the file structure and to select what should be used
and played.
For the tracks we still resolve the descriptors but the
source package only contains the descriptor it really references
instead of all subdescriptors of multiple descriptors.
This makes it easier later to serialize the structural metadata
again.
By searching for the following position we will add the complete
generic container (i.e. all tracks) at the same position to the
index which should make finding positions for more than one track
a bit faster.
When seeking to a position where no new offset can be
found or after the end of a track don't set the EOS flag
to TRUE as we don't (and can't) push EOS downstream then.
Instead set the current essence track position to then
end of the essence track and let the loop or chain function
set everything to EOS and push EOS downstream.
Also restart the pad's task if resolving metadata failed
(playback will continue as before) and return FALSE from
the seek if no new offset could be found.
When the material package track and source package track
edit rate are different the source package track edit
rate applies to the stored essence and the material track
edit rate only applies to the values in the track's sequence
and components.
Avid uses a custom essence container UL and custom essence element keys
that are fortunately compatible with the generic container essence
elements. Partially fixes bug #561922.
Some files contain multiple tracks with the same track number but different
track id inside the same source package. This is invalid and we simply ignore
the second and following of such traacks now instead of overwriting the
information of the first one.
Avid usually uses a custom essence container label for the essence
descriptors and stores the actual codec that is used inside the
picture essence coding field (and for sound probably in the sound
essence coding field but I have no sample files with sound).
Partially fixes bug #561922.
This is useful for seeking as we usually want to seek to the previous
keyframe. The keyframe detection is done by parsing the MPEG2
elementary stream and if a GOP or I-frame packet is found we
assume a keyframe in this edit unit.