#ifndef MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_
#define MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_
#include <stddef.h>
#include <stdint.h>
#include <optional>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "base/time/time.h"
#include "media/base/decrypt_config.h"
#include "media/base/media_export.h"
#include "media/base/media_log.h"
#include "media/base/video_codecs.h"
#include "media/formats/mp4/aac.h"
#include "media/formats/mp4/ac3.h"
#include "media/formats/mp4/ac4.h"
#include "media/formats/mp4/avc.h"
#include "media/formats/mp4/box_reader.h"
#include "media/formats/mp4/dts.h"
#include "media/formats/mp4/dtsx.h"
#include "media/formats/mp4/eac3.h"
#include "media/formats/mp4/fourccs.h"
#include "media/media_buildflags.h"
namespace media {
namespace mp4 {
const int kInitializationVectorSize = …;
enum TrackType { … };
enum SampleFlags { … };
#define DECLARE_BOX_METHODS(T) …
struct MEDIA_EXPORT FileType : Box { … };
struct MEDIA_EXPORT ProtectionSystemSpecificHeader : Box { … };
struct MEDIA_EXPORT FullProtectionSystemSpecificHeader : Box { … };
struct MEDIA_EXPORT SampleAuxiliaryInformationOffset : Box { … };
struct MEDIA_EXPORT SampleAuxiliaryInformationSize : Box { … };
struct MEDIA_EXPORT SampleEncryptionEntry { … };
struct MEDIA_EXPORT SampleEncryption : Box { … };
struct MEDIA_EXPORT OriginalFormat : Box { … };
struct MEDIA_EXPORT SchemeType : Box { … };
struct MEDIA_EXPORT TrackEncryption : Box { … };
struct MEDIA_EXPORT SchemeInfo : Box { … };
struct MEDIA_EXPORT ProtectionSchemeInfo : Box { … };
struct MEDIA_EXPORT MovieHeader : Box { … };
struct MEDIA_EXPORT TrackHeader : Box { … };
struct MEDIA_EXPORT EditListEntry { … };
struct MEDIA_EXPORT EditList : Box { … };
struct MEDIA_EXPORT Edit : Box { … };
struct MEDIA_EXPORT HandlerReference : Box { … };
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
struct MEDIA_EXPORT AVCDecoderConfigurationRecord : Box {
DECLARE_BOX_METHODS(AVCDecoderConfigurationRecord);
bool Parse(const uint8_t* data, int data_size);
bool Serialize(std::vector<uint8_t>& output) const;
uint8_t version;
uint8_t profile_indication;
uint8_t profile_compatibility;
uint8_t avc_level;
uint8_t length_size;
std::vector<std::vector<uint8_t>> sps_list;
std::vector<std::vector<uint8_t>> pps_list;
uint8_t chroma_format;
uint8_t bit_depth_luma_minus8;
uint8_t bit_depth_chroma_minus8;
std::vector<std::vector<uint8_t>> sps_ext_list;
private:
bool ParseInternal(BufferReader* reader, MediaLog* media_log);
bool ParseREXT(BufferReader* reader, MediaLog* media_log);
};
#endif
struct MEDIA_EXPORT VPCodecConfigurationRecord : Box { … };
#if BUILDFLAG(ENABLE_AV1_DECODER)
struct MEDIA_EXPORT AV1CodecConfigurationRecord : Box { … };
#endif
struct MEDIA_EXPORT PixelAspectRatioBox : Box { … };
struct MEDIA_EXPORT ColorParameterInformation : Box { … };
struct MEDIA_EXPORT MasteringDisplayColorVolume : Box { … };
struct MEDIA_EXPORT SMPTE2086MasteringDisplayMetadataBox
: MasteringDisplayColorVolume { … };
struct MEDIA_EXPORT ContentLightLevelInformation : Box { … };
struct MEDIA_EXPORT ContentLightLevel : ContentLightLevelInformation { … };
struct MEDIA_EXPORT VideoSampleEntry : Box { … };
struct MEDIA_EXPORT ElementaryStreamDescriptor : Box { … };
struct MEDIA_EXPORT FlacSpecificBox : Box { … };
struct MEDIA_EXPORT OpusSpecificBox : Box { … };
#if BUILDFLAG(ENABLE_PLATFORM_DTS_AUDIO)
struct MEDIA_EXPORT DtsSpecificBox : Box {
DECLARE_BOX_METHODS(DtsSpecificBox);
DTS dts;
};
struct MEDIA_EXPORT DtsUhdSpecificBox : Box {
DECLARE_BOX_METHODS(DtsUhdSpecificBox);
DTSX dtsx;
};
#endif
#if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO)
struct MEDIA_EXPORT AC3SpecificBox : Box {
DECLARE_BOX_METHODS(AC3SpecificBox);
AC3 dac3;
};
struct MEDIA_EXPORT EC3SpecificBox : Box {
DECLARE_BOX_METHODS(EC3SpecificBox);
EAC3 dec3;
};
#endif
#if BUILDFLAG(ENABLE_PLATFORM_AC4_AUDIO)
struct MEDIA_EXPORT AC4SpecificBox : Box {
DECLARE_BOX_METHODS(AC4SpecificBox);
AC4 dac4;
};
#endif
#if BUILDFLAG(ENABLE_PLATFORM_IAMF_AUDIO)
struct MEDIA_EXPORT IamfSpecificBox : Box {
DECLARE_BOX_METHODS(IamfSpecificBox);
bool ReadOBU(BufferReader* reader);
bool ReadOBUHeader(BufferReader* reader,
uint8_t* obu_type,
uint32_t* obu_size);
bool ReadLeb128Value(BufferReader* reader, uint32_t* value) const;
uint8_t profile;
bool redundant_copy = false;
std::vector<uint8_t> ia_descriptors;
};
#endif
struct MEDIA_EXPORT AudioSampleEntry : Box { … };
struct MEDIA_EXPORT SampleDescription : Box { … };
struct MEDIA_EXPORT CencSampleEncryptionInfoEntry { … };
struct MEDIA_EXPORT SampleGroupDescription : Box { … };
struct MEDIA_EXPORT SampleTable : Box { … };
struct MEDIA_EXPORT MediaHeader : Box { … };
struct MEDIA_EXPORT MediaInformation : Box { … };
struct MEDIA_EXPORT Media : Box { … };
struct MEDIA_EXPORT Track : Box { … };
struct MEDIA_EXPORT MovieExtendsHeader : Box { … };
struct MEDIA_EXPORT TrackExtends : Box { … };
struct MEDIA_EXPORT MovieExtends : Box { … };
struct MEDIA_EXPORT Movie : Box { … };
struct MEDIA_EXPORT TrackFragmentDecodeTime : Box { … };
struct MEDIA_EXPORT MovieFragmentHeader : Box { … };
struct MEDIA_EXPORT TrackFragmentHeader : Box { … };
struct MEDIA_EXPORT TrackFragmentRun : Box { … };
enum SampleDependsOn { … };
class MEDIA_EXPORT IndependentAndDisposableSamples : public Box { … };
struct MEDIA_EXPORT SampleToGroupEntry { … };
struct MEDIA_EXPORT SampleToGroup : Box { … };
struct MEDIA_EXPORT TrackFragment : Box { … };
struct MEDIA_EXPORT MovieFragment : Box { … };
#undef DECLARE_BOX
}
}
#endif