[FFmpeg-devel] [PATCH v2 05/18] avformat/movenc: support for multiple and client-provided track references

Michael Niedermayer michael at niedermayer.cc
Thu Sep 1 20:03:09 EEST 2016


On Wed, Aug 31, 2016 at 02:35:48PM +0300, Erkki Seppälä wrote:
> Instead of one track reference, allow many, and instead of
> of track reference type (ie. 'cdsc'), allow many.
> 
> In addition this patch allows client to explicitly add track references
> with side packet AV_PKT_DATA_TRACK_REFERENCES containing
> AVTrackReferences (which of there can many many).
> 
> Internally MOVTrack's track references can be manipulated with helper
> functions ff_mov_tref* (and is used by a later patch for reading
> MOVTRefs).
> 
> Multiple track references can be useful in particular with timed meta
> data tracks, indicating the track is related to multiple other tracks.
> 
> This information ends up in ISO media file box 'tref' as specified by
> ISO/IEC 14496-12.
> 
> Signed-off-by: Erkki Seppälä <erkki.seppala.ext at nokia.com>
> Signed-off-by: OZOPlayer <OZOPL at nokia.com>
> ---
>  libavcodec/avcodec.h  |  19 +++++++-
>  libavformat/Makefile  |   4 +-
>  libavformat/movenc.c  | 127 +++++++++++++++++++++++++++++++++++++++++---------
>  libavformat/movenc.h  |   5 +-
>  libavformat/movtref.c | 115 +++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/movtref.h |  75 +++++++++++++++++++++++++++++
>  6 files changed, 318 insertions(+), 27 deletions(-)
>  create mode 100644 libavformat/movtref.c
>  create mode 100644 libavformat/movtref.h
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 0d0447e6..f45cdc2 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1348,6 +1348,15 @@ typedef struct AVCPBProperties {
>   * Types and functions for working with AVPacket.
>   * @{
>   */
> +
> +typedef struct AVTrackReferences {
> +    int         next_tref_ofs;  /** offset in bytes to the next AVTrackReferences or 0 if this is the last one*/
> +    char        tag[4];         /** 4cc used for describing this  */
> +    int         nb_tracks;      /** number of tracks */

> +    int         tracks[1];      /** tracks this track refers to (contains nb_tracks entries) */

This syntax looks wrong

to document the previous field /**< would be used

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160901/fb68fea1/attachment.sig>


More information about the ffmpeg-devel mailing list