35 size_t buf_size,
int flags) {
37 int provider_code, country_code;
38 unsigned int provider_oriented_code = 0;
45 country_code = bytestream2_get_byte(&gb);
46 if (country_code == 0xFF) {
54 switch (country_code) {
58 provider_code = bytestream2_get_be16u(&gb);
60 switch (provider_code) {
64 provider_oriented_code = bytestream2_get_be32u(&gb);
65 switch (provider_oriented_code) {
66 case MKBETAG(
'D',
'T',
'G',
'1'):
69 if (!(bytestream2_get_byteu(&gb) & 0x40))
72 case MKBETAG(
'G',
'A',
'9',
'4'):
82 provider_oriented_code = bytestream2_get_byteu(&gb);
83 if (provider_oriented_code != 0x0001)
89 provider_oriented_code = bytestream2_get_be16u(&gb);
90 int application_identifier = bytestream2_get_byteu(&gb);
92 if (provider_oriented_code != 1 || application_identifier != 4)
98 provider_oriented_code = bytestream2_get_be32u(&gb);
99 if (provider_oriented_code != 0x800)
105 provider_oriented_code = bytestream2_get_be16u(&gb);
106 if (provider_oriented_code != 1)
118 provider_code = bytestream2_get_be16u(&gb);
120 switch (provider_code) {
130 provider_code = bytestream2_get_be16u(&gb);
132 switch (provider_code) {
137 provider_oriented_code = bytestream2_get_be16u(&gb);
138 if (provider_oriented_code != 0x0005)
180 case MKBETAG(
'D',
'T',
'G',
'1'):
189 case MKBETAG(
'G',
'A',
'9',
'4'):
224 if (!aux || !aux->
dovi)
248 if (!hdr_smpte2094_app5)
260 if (!
metadata->hdr_smpte2094_app5) {
344 if (
metadata.aom_film_grain.enable) {
void ff_aom_uninit_film_grain_params(AVFilmGrainAFGS1Params *s)
int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s, const uint8_t *payload, int payload_size)
int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *frame)
int ff_parse_a53_cc(AVBufferRef **pbuf, const uint8_t *data, int size)
Parse a data array for ATSC A53 Part 4 Closed Captions and store them in an AVBufferRef.
Libavcodec external API header.
refcounted data buffer API
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static int FUNC metadata(CodedBitstreamContext *ctx, RWContext *rw, APVRawMetadata *current)
#define flags(name, subs,...)
int ff_frame_new_side_data_from_buf(const AVCodecContext *avctx, AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef **buf)
Similar to ff_frame_new_side_data, but using an existing buffer ref.
int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, int err_recognition)
Parse the contents of a Dolby Vision RPU and update the parsed values in the DOVIContext struct.
int ff_dovi_get_metadata(DOVIContext *s, AVDOVIMetadata **out_metadata)
Get the decoded AVDOVIMetadata.
int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t *data, int size)
Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRVivid).
reference-counted frame API
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVFrameSideData * av_frame_new_side_data_from_buf(AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef *buf)
Add a new side data to a frame from an existing AVBufferRef.
@ AV_FRAME_DATA_DOVI_METADATA
Parsed Dolby Vision metadata, suitable for passing to a software implementation.
@ AV_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
@ AV_FRAME_DATA_DYNAMIC_HDR_VIVID
HDR Vivid dynamic metadata associated with a video frame.
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
@ AV_FRAME_DATA_DYNAMIC_HDR_SMPTE_2094_APP5
HDR dynamic metadata associated with a video frame.
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
int ff_itut_t35_parse_payload_to_struct(FFITUTT35 *const itut_t35, FFITUTT35Aux *const aux, FFITUTT35Meta *metadata, int err_recognition)
Parse a pre-processed ITU-T T35 payload to fill the metadata struct.
int ff_itut_t35_parse_buffer(FFITUTT35 *const itut_t35, const uint8_t *buf, size_t buf_size, int flags)
Parse a raw ITU-T T35 buffer to get the country code, provider code, and set them plus the pointer an...
int ff_itut_t35_parse_payload_to_frame(FFITUTT35 *const itut_t35, FFITUTT35Aux *const aux, AVCodecContext *const avctx, AVFrame *const frame)
Parse a pre-processed ITU-T T35 payload to fill a frame's side data.
void ff_itut_t35_unref(FFITUTT35Meta *metadata)
Unref all references in metadata.
#define ITU_T_T35_PROVIDER_CODE_SMPTE
#define FF_ITUT_T35_FLAG_COUNTRY_CODE
country_code is assumed to not be the first byte of the buffer and must be set by the caller beforeha...
#define ITU_T_T35_PROVIDER_CODE_HDR_VIVID
#define ITU_T_T35_PROVIDER_CODE_VNOVA
#define ITU_T_T35_COUNTRY_CODE_CN
#define ITU_T_T35_PROVIDER_CODE_DOLBY
#define ITU_T_T35_COUNTRY_CODE_US
#define ITU_T_T35_PROVIDER_CODE_AOM
#define ITU_T_T35_COUNTRY_CODE_UK
#define ITU_T_T35_PROVIDER_CODE_ATSC
#define ITU_T_T35_PROVIDER_CODE_SAMSUNG
Libavcodec version macros.
common internal API header
#define MKBETAG(a, b, c, d)
Memory handling functions.
main external API structure.
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
This struct represents dynamic metadata for color volume transform as specified in the SMPTE 2094-50 ...
This struct represents dynamic metadata for color volume transform - CUVA 005.1:2021 standard.
Structure to hold side data for an AVFrame.
This structure describes decoded (raw) audio or video data.
DOVIContext * dovi
A DOVIContext.
unsigned int provider_oriented_code