From 76729970049fe95659346503f7401a5d869f9959 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Wed, 15 Jun 2016 15:24:30 -0400 Subject: mov: Implement support for multiple sample description tables Store data from each stsd in a separate extradata buffer, keep track of the stsc index for read and seek operations, switch buffers when the index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA packet side data. Since H264 supports this notification, and can be reset midstream, enable this feature only for multiple avcC's. All other stsd types (such as hvc1 and hev1) need decoder-side changes, so they are left disabled for now. This is implemented only in non-fragmented MOVs. Signed-off-by: Vittorio Giovara --- libavformat/isom.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libavformat/isom.h') diff --git a/libavformat/isom.h b/libavformat/isom.h index aec623b95c..75aa70bccc 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -105,6 +105,8 @@ typedef struct MOVStreamContext { MOVStts *ctts_data; unsigned int stsc_count; MOVStsc *stsc_data; + int stsc_index; + int stsc_sample; unsigned int stps_count; unsigned *stps_data; ///< partial sync sample for mpeg-2 open gop int ctts_index; @@ -137,6 +139,12 @@ typedef struct MOVStreamContext { unsigned int rap_group_count; MOVSbgp *rap_group; + /** extradata array (and size) for multiple stsd */ + uint8_t **extradata; + int *extradata_size; + int last_stsd_index; + int stsd_count; + int32_t *display_matrix; } MOVStreamContext; -- cgit v1.2.3