FFmpeg
|
#include <inttypes.h>
#include "libavutil/aes.h"
#include "libavutil/avassert.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/mathematics.h"
#include "libavcodec/bytestream.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/parseutils.h"
#include "libavutil/timecode.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
#include "mxf.h"
Go to the source code of this file.
Data Structures | |
struct | MXFPartition |
struct | MXFCryptoContext |
struct | MXFStructuralComponent |
struct | MXFSequence |
struct | MXFTimecodeComponent |
struct | MXFPulldownComponent |
struct | MXFEssenceGroup |
struct | MXFTaggedValue |
struct | MXFTrack |
struct | MXFDescriptor |
struct | MXFIndexTableSegment |
struct | MXFPackage |
struct | MXFEssenceContainerData |
struct | MXFMetadataSet |
struct | MXFIndexTable |
struct | MXFContext |
struct | MXFMetadataReadTableEntry |
Macros | |
#define | MXF_MAX_CHUNK_SIZE (32 << 20) |
#define | MXF_FIELD_DOMINANCE_DEFAULT 0 |
#define | MXF_FIELD_DOMINANCE_FF 1 /* coded first, displayed first */ |
#define | MXF_FIELD_DOMINANCE_FL 2 /* coded first, displayed last */ |
#define | IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y))) |
#define | READ_STR16(type, big_endian) |
#define | SET_STR_METADATA(pb, name, str) |
#define | SET_VERSION_METADATA(pb, name, major, minor, tertiary, patch, release, str) |
#define | SET_UID_METADATA(pb, name, var, str) |
#define | SET_TS_METADATA(pb, name, var, str) |
Typedefs | |
typedef int | MXFMetadataReadFunc(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) |
Enumerations | |
enum | MXFPartitionType { Header, BodyPartition, Footer } |
enum | MXFOP { OP1a = 1, OP1b, OP1c, OP2a, OP2b, OP2c, OP3a, OP3b, OP3c, OPAtom, OPSONYOpt } |
enum | MXFWrappingScheme { UnknownWrapped = 0, FrameWrapped, ClipWrapped } |
Variables | |
static const uint8_t | mxf_header_partition_pack_key [] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02 } |
static const uint8_t | mxf_essence_element_key [] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01 } |
static const uint8_t | mxf_avid_essence_element_key [] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0e,0x04,0x03,0x01 } |
static const uint8_t | mxf_canopus_essence_element_key [] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x0a,0x0e,0x0f,0x03,0x01 } |
static const uint8_t | mxf_system_item_key_cp [] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x03,0x01,0x04 } |
static const uint8_t | mxf_system_item_key_gc [] = { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x03,0x01,0x14 } |
static const uint8_t | mxf_klv_key [] = { 0x06,0x0e,0x2b,0x34 } |
static const uint8_t | mxf_apple_coll_prefix [] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x0e,0x20,0x04,0x01,0x05,0x03,0x01 } |
static const uint8_t | mxf_crypto_source_container_ul [] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x02,0x02,0x00,0x00,0x00 } |
static const uint8_t | mxf_encrypted_triplet_key [] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 } |
static const uint8_t | mxf_encrypted_essence_container [] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 } |
static const uint8_t | mxf_sony_mpeg4_extradata [] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 } |
static const uint8_t | mxf_avid_project_name [] = { 0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf } |
static const uint8_t | mxf_jp2k_rsiz [] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 } |
static const uint8_t | mxf_indirect_value_utf16le [] = { 0x4c,0x00,0x02,0x10,0x01,0x00,0x00,0x00,0x00,0x06,0x0e,0x2b,0x34,0x01,0x04,0x01,0x01 } |
static const uint8_t | mxf_indirect_value_utf16be [] = { 0x42,0x01,0x10,0x02,0x00,0x00,0x00,0x00,0x00,0x06,0x0e,0x2b,0x34,0x01,0x04,0x01,0x01 } |
static const uint8_t | mxf_apple_coll_max_cll [] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x0e,0x20,0x04,0x01,0x05,0x03,0x01,0x01 } |
static const uint8_t | mxf_apple_coll_max_fall [] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x0e,0x20,0x04,0x01,0x05,0x03,0x01,0x02 } |
static const uint8_t | mxf_mastering_display_prefix [13] = { FF_MXF_MasteringDisplay_PREFIX } |
static const uint8_t | mxf_mastering_display_uls [4][16] |
static const MXFCodecUL | mxf_picture_essence_container_uls [] |
static const MXFCodecUL | mxf_intra_only_essence_container_uls [] |
static const MXFCodecUL | mxf_intra_only_picture_essence_coding_uls [] |
static const MXFCodecUL | mxf_intra_only_picture_coded_width [] |
static const MXFCodecUL | mxf_sound_essence_container_uls [] |
static const MXFCodecUL | mxf_data_essence_container_uls [] |
static const MXFMetadataReadTableEntry | mxf_metadata_read_table [] |
static const AVOption | options [] |
static const AVClass | demuxer_class |
AVInputFormat | ff_mxf_demuxer |
#define MXF_FIELD_DOMINANCE_FL 2 /* coded first, displayed last */ |
#define READ_STR16 | ( | type, | |
big_endian | |||
) |
#define SET_STR_METADATA | ( | pb, | |
name, | |||
str | |||
) |
#define SET_VERSION_METADATA | ( | pb, | |
name, | |||
major, | |||
minor, | |||
tertiary, | |||
patch, | |||
release, | |||
str | |||
) |
#define SET_UID_METADATA | ( | pb, | |
name, | |||
var, | |||
str | |||
) |
#define SET_TS_METADATA | ( | pb, | |
name, | |||
var, | |||
str | |||
) |
enum MXFPartitionType |
enum MXFOP |
enum MXFWrappingScheme |
|
static |
Definition at line 3748 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Definition at line 349 of file mxfdec.c.
Referenced by mxf_add_metadata_set(), mxf_read_close(), and mxf_read_local_tags().
|
static |
Definition at line 392 of file mxfdec.c.
Referenced by klv_read_packet(), and mxf_decrypt_triplet().
|
static |
Definition at line 409 of file mxfdec.c.
Referenced by klv_read_packet(), and mxf_read_header().
|
static |
Definition at line 422 of file mxfdec.c.
Referenced by mxf_read_header(), mxf_read_packet(), mxf_read_random_index_pack(), and mxf_seek_to_previous_partition().
|
static |
Definition at line 441 of file mxfdec.c.
Referenced by mxf_decrypt_triplet(), and mxf_read_packet().
|
static |
Definition at line 455 of file mxfdec.c.
Referenced by mxf_decrypt_triplet(), and mxf_read_packet().
|
static |
Definition at line 478 of file mxfdec.c.
Referenced by mxf_read_packet().
|
static |
Definition at line 554 of file mxfdec.c.
Referenced by mxf_read_packet().
|
static |
Definition at line 586 of file mxfdec.c.
Referenced by mxf_read_packet().
|
static |
|
static |
Definition at line 681 of file mxfdec.c.
Referenced by mxf_seek_to_previous_partition().
|
static |
Definition at line 851 of file mxfdec.c.
Referenced by mxf_handle_missing_index_segment(), and mxf_read_local_tags().
|
static |
|
static |
Definition at line 876 of file mxfdec.c.
Referenced by mxf_read_content_storage(), mxf_read_essence_group(), mxf_read_generic_descriptor(), mxf_read_package(), and mxf_read_sequence().
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1103 of file mxfdec.c.
Referenced by mxf_read_index_table_segment().
|
static |
|
static |
Definition at line 1173 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
|
static |
Definition at line 1364 of file mxfdec.c.
Referenced by mxf_read_tagged_value().
|
static |
Definition at line 1398 of file mxfdec.c.
Referenced by mxf_get_codec_ul().
|
static |
Definition at line 1408 of file mxfdec.c.
Referenced by mxf_add_metadata_stream(), mxf_get_wrapping_kind(), mxf_is_intra_only(), and mxf_parse_structural_metadata().
|
static |
Definition at line 1418 of file mxfdec.c.
Referenced by mxf_parse_package_comments(), mxf_parse_physical_source_package(), mxf_parse_structural_metadata(), mxf_resolve_essence_group_choice(), mxf_resolve_multidescriptor(), mxf_resolve_sourceclip(), and mxf_resolve_timecode_component().
|
static |
Definition at line 1493 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 1527 of file mxfdec.c.
Referenced by mxf_compute_index_tables().
|
static |
Computes the absolute file offset of the given essence container offset.
Definition at line 1614 of file mxfdec.c.
Referenced by mxf_edit_unit_absolute_offset().
|
static |
Returns the end position of the essence container with given BodySID, or zero if unknown.
Definition at line 1657 of file mxfdec.c.
Referenced by mxf_set_current_edit_unit().
|
static |
Definition at line 1675 of file mxfdec.c.
Referenced by mxf_get_next_track_edit_unit(), mxf_read_seek(), and mxf_set_current_edit_unit().
|
static |
We have this:
x TemporalOffset 0: 0 1: 1 2: 1 3: -2 4: 1 5: 1 6: -2
We want to transform it into this:
x DTS PTS 0: -1 0 1: 0 3 2: 1 1 3: 2 2 4: 3 6 5: 4 4 6: 5 5
We do this by bucket sorting x by x+TemporalOffset[x] into mxf->ptses, then settings mxf->first_dts = -max(TemporalOffset[x]). The latter makes DTS <= PTS.
Definition at line 1721 of file mxfdec.c.
Referenced by mxf_compute_index_tables().
|
static |
Sorts and collects index table segments into index tables.
Also computes PTSes if possible.
Definition at line 1845 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Definition at line 1953 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
Definition at line 1979 of file mxfdec.c.
Referenced by mxf_add_umid_metadata().
|
static |
|
static |
Definition at line 2009 of file mxfdec.c.
Referenced by mxf_add_metadata_stream(), mxf_parse_physical_source_package(), and mxf_parse_structural_metadata().
|
static |
Definition at line 2021 of file mxfdec.c.
Referenced by mxf_parse_physical_source_package(), and mxf_parse_structural_metadata().
|
static |
Definition at line 2029 of file mxfdec.c.
Referenced by mxf_parse_physical_source_package().
|
static |
Definition at line 2050 of file mxfdec.c.
Referenced by mxf_parse_physical_source_package(), mxf_parse_structural_metadata(), and mxf_resolve_essence_group_choice().
|
static |
Definition at line 2066 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 2092 of file mxfdec.c.
Referenced by mxf_resolve_sourceclip().
|
static |
Definition at line 2119 of file mxfdec.c.
Referenced by mxf_add_metadata_stream(), and mxf_parse_structural_metadata().
|
static |
Definition at line 2137 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 2157 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 2227 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 2265 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 2289 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
|
static |
|
static |
|
static |
Definition at line 2893 of file mxfdec.c.
Referenced by mxf_read_local_tags().
|
static |
Definition at line 2908 of file mxfdec.c.
Referenced by mxf_parse_klv().
Matches any partition pack key, in other words:
Definition at line 2988 of file mxfdec.c.
Referenced by mxf_read_header(), and mxf_seek_to_previous_partition().
|
static |
Parses a metadata KLV.
Definition at line 2999 of file mxfdec.c.
Referenced by mxf_read_header(), and mxf_seek_to_previous_partition().
|
static |
Seeks to the previous partition and parses it, if possible.
Definition at line 3030 of file mxfdec.c.
Referenced by mxf_parse_handle_essence(), and mxf_parse_handle_partition_or_eof().
|
static |
Called when essence is encountered.
Definition at line 3081 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Called when the next partition or EOF is encountered.
Definition at line 3124 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Definition at line 3129 of file mxfdec.c.
Referenced by mxf_compute_essence_containers().
|
static |
Figures out the proper offset and length of the essence container in each partition.
Definition at line 3142 of file mxfdec.c.
Referenced by mxf_read_header().
Definition at line 3181 of file mxfdec.c.
Referenced by mxf_compute_edit_units_per_packet(), and mxf_handle_missing_index_segment().
|
static |
Definition at line 3187 of file mxfdec.c.
Referenced by mxf_compute_edit_units_per_packet(), mxf_get_next_track_edit_unit(), mxf_set_current_edit_unit(), and mxf_set_pts().
|
static |
Deal with the case where for some audio atoms EditUnitByteCount is very small (2, 4..).
In those cases we should read more than one sample per call to mxf_read_packet().
Definition at line 3201 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Deal with the case where ClipWrapped essences does not have any IndexTableSegments.
Definition at line 3232 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Definition at line 3300 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
|
static |
Definition at line 3474 of file mxfdec.c.
Referenced by mxf_read_seek(), and mxf_set_current_edit_unit().
|
static |
Definition at line 3500 of file mxfdec.c.
Referenced by mxf_read_seek(), mxf_set_audio_pts(), and mxf_set_current_edit_unit().
|
static |
Make sure track->sample_count is correct based on what offset we're currently at.
Also determine the next edit unit (or packet) offset.
Definition at line 3531 of file mxfdec.c.
Referenced by mxf_read_packet().
|
static |
Definition at line 3569 of file mxfdec.c.
Referenced by mxf_set_pts().
|
static |
Definition at line 3591 of file mxfdec.c.
Referenced by mxf_read_packet().
|
static |
|
static |
|
static |
|
static |
Definition at line 319 of file mxfdec.c.
Referenced by mxf_is_partition_pack_key(), mxf_probe(), and mxf_read_header().
|
static |
Definition at line 320 of file mxfdec.c.
Referenced by mxf_decrypt_triplet(), mxf_get_stream_index(), mxf_read_header(), and mxf_read_packet().
|
static |
Definition at line 321 of file mxfdec.c.
Referenced by mxf_read_header(), and mxf_read_packet().
|
static |
Definition at line 322 of file mxfdec.c.
Referenced by mxf_read_header(), and mxf_read_packet().
|
static |
Definition at line 323 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Definition at line 324 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
Definition at line 325 of file mxfdec.c.
Referenced by klv_read_packet().
|
static |
Definition at line 326 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
Definition at line 328 of file mxfdec.c.
Referenced by mxf_read_cryptographic_context().
|
static |
Definition at line 329 of file mxfdec.c.
Referenced by mxf_read_header(), and mxf_read_packet().
|
static |
Definition at line 330 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 331 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
Definition at line 332 of file mxfdec.c.
Referenced by mxf_read_preface_metadata().
|
static |
Definition at line 333 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
Definition at line 334 of file mxfdec.c.
Referenced by mxf_read_indirect_value().
|
static |
Definition at line 335 of file mxfdec.c.
Referenced by mxf_read_indirect_value().
|
static |
Definition at line 336 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
Definition at line 337 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
Definition at line 339 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
Definition at line 340 of file mxfdec.c.
Referenced by mxf_read_generic_descriptor().
|
static |
Definition at line 1433 of file mxfdec.c.
Referenced by mxf_get_wrapping_kind(), and mxf_parse_structural_metadata().
|
static |
Definition at line 1455 of file mxfdec.c.
Referenced by mxf_is_intra_only().
|
static |
Definition at line 1461 of file mxfdec.c.
Referenced by mxf_is_intra_only().
|
static |
Definition at line 1468 of file mxfdec.c.
Referenced by mxf_parse_structural_metadata().
|
static |
Definition at line 1476 of file mxfdec.c.
Referenced by mxf_get_wrapping_kind(), and mxf_parse_structural_metadata().
|
static |
Definition at line 1486 of file mxfdec.c.
Referenced by mxf_get_wrapping_kind(), and mxf_parse_structural_metadata().
|
static |
Definition at line 2851 of file mxfdec.c.
Referenced by mxf_read_header().
|
static |
|
static |
AVInputFormat ff_mxf_demuxer |