FFmpeg
Data Structures | Macros | Functions
itut35.h File Reference
#include <stdint.h>
#include <stddef.h>
#include "libavutil/frame.h"
#include "avcodec.h"
#include "aom_film_grain.h"
#include "dovi_rpu.h"

Go to the source code of this file.

Data Structures

struct  FFITUTT35
 
struct  FFITUTT35Meta
 
struct  FFITUTT35Aux
 

Macros

#define ITU_T_T35_COUNTRY_CODE_CN   0x26
 
#define ITU_T_T35_COUNTRY_CODE_UK   0xB4
 
#define ITU_T_T35_COUNTRY_CODE_US   0xB5
 
#define ITU_T_T35_PROVIDER_CODE_HDR_VIVID   0x0004
 
#define ITU_T_T35_PROVIDER_CODE_VNOVA   0x5000
 
#define ITU_T_T35_PROVIDER_CODE_ATSC   0x0031
 
#define ITU_T_T35_PROVIDER_CODE_DOLBY   0x003B
 
#define ITU_T_T35_PROVIDER_CODE_AOM   0x5890
 
#define ITU_T_T35_PROVIDER_CODE_SAMSUNG   0x003C
 
#define ITU_T_T35_PROVIDER_CODE_SMPTE   0x0090
 
#define FF_ITUT_T35_FLAG_COUNTRY_CODE   (1 << 0)
 country_code is assumed to not be the first byte of the buffer and must be set by the caller beforehand. More...
 

Functions

int ff_itut_t35_parse_buffer (FFITUTT35 *itut_t35, const uint8_t *buf, size_t size, int flags)
 Parse a raw ITU-T T35 buffer to get the country code, provider code, and set them plus the pointer and size in the FFITUTT35 struct to the start of the actual payload. More...
 
int ff_itut_t35_parse_payload_to_struct (FFITUTT35 *itut_t35, FFITUTT35Aux *aux, FFITUTT35Meta *metadata, int err_recognition)
 Parse a pre-processed ITU-T T35 payload to fill the metadata struct. More...
 
int ff_itut_t35_parse_payload_to_frame (FFITUTT35 *itut_t35, FFITUTT35Aux *aux, AVCodecContext *avctx, AVFrame *frame)
 Parse a pre-processed ITU-T T35 payload to fill a frame's side data. More...
 
void ff_itut_t35_unref (FFITUTT35Meta *metadata)
 Unref all references in metadata. More...
 

Macro Definition Documentation

◆ ITU_T_T35_COUNTRY_CODE_CN

#define ITU_T_T35_COUNTRY_CODE_CN   0x26

Definition at line 30 of file itut35.h.

◆ ITU_T_T35_COUNTRY_CODE_UK

#define ITU_T_T35_COUNTRY_CODE_UK   0xB4

Definition at line 31 of file itut35.h.

◆ ITU_T_T35_COUNTRY_CODE_US

#define ITU_T_T35_COUNTRY_CODE_US   0xB5

Definition at line 32 of file itut35.h.

◆ ITU_T_T35_PROVIDER_CODE_HDR_VIVID

#define ITU_T_T35_PROVIDER_CODE_HDR_VIVID   0x0004

Definition at line 39 of file itut35.h.

◆ ITU_T_T35_PROVIDER_CODE_VNOVA

#define ITU_T_T35_PROVIDER_CODE_VNOVA   0x5000

Definition at line 42 of file itut35.h.

◆ ITU_T_T35_PROVIDER_CODE_ATSC

#define ITU_T_T35_PROVIDER_CODE_ATSC   0x0031

Definition at line 44 of file itut35.h.

◆ ITU_T_T35_PROVIDER_CODE_DOLBY

#define ITU_T_T35_PROVIDER_CODE_DOLBY   0x003B

Definition at line 45 of file itut35.h.

◆ ITU_T_T35_PROVIDER_CODE_AOM

#define ITU_T_T35_PROVIDER_CODE_AOM   0x5890

Definition at line 46 of file itut35.h.

◆ ITU_T_T35_PROVIDER_CODE_SAMSUNG

#define ITU_T_T35_PROVIDER_CODE_SAMSUNG   0x003C

Definition at line 47 of file itut35.h.

◆ ITU_T_T35_PROVIDER_CODE_SMPTE

#define ITU_T_T35_PROVIDER_CODE_SMPTE   0x0090

Definition at line 48 of file itut35.h.

◆ FF_ITUT_T35_FLAG_COUNTRY_CODE

#define FF_ITUT_T35_FLAG_COUNTRY_CODE   (1 << 0)

country_code is assumed to not be the first byte of the buffer and must be set by the caller beforehand.

Definition at line 83 of file itut35.h.

Function Documentation

◆ ff_itut_t35_parse_buffer()

int ff_itut_t35_parse_buffer ( FFITUTT35 itut_t35,
const uint8_t *  buf,
size_t  size,
int  flags 
)

Parse a raw ITU-T T35 buffer to get the country code, provider code, and set them plus the pointer and size in the FFITUTT35 struct to the start of the actual payload.

Parameters
itut_t35The struct to fill
bufThe input buffer
sizeSize of the input buffer
flagsA combination of FF_ITUT_T35_FLAG_*
Returns
0 if nothing was done (e.g. the payload is of an unsupported type), 1 on success, or a negative AVERROR code on failure
Note
buf will remain owned by the caller, and no new allocations will be made. Any pointer in the resulting struct will be valid as long as buf is valid.

Definition at line 34 of file itut35.c.

Referenced by decode_metadata_itu_t_t35(), decode_registered_user_data(), export_itut_t35(), and parse_itut_t35_metadata().

◆ ff_itut_t35_parse_payload_to_struct()

int ff_itut_t35_parse_payload_to_struct ( FFITUTT35 itut_t35,
FFITUTT35Aux aux,
FFITUTT35Meta metadata,
int  err_recognition 
)

Parse a pre-processed ITU-T T35 payload to fill the metadata struct.

Parameters
itut_t35The pre-filled struct
auxA struct containing extra contexts required by certain payload types. Any pointer present is owned by the caller. May be NULL, in which case the relevant payloads will not be parsed.
metadataA metadata struct. All the allocated buffer references are owned by the caller and must be freed accordingly.
err_recognitionA combination of AV_EF_* flags
Returns
0 on success, or a negative AVERROR code on failure

Definition at line 163 of file itut35.c.

Referenced by decode_registered_user_data(), and ff_itut_t35_parse_payload_to_frame().

◆ ff_itut_t35_parse_payload_to_frame()

int ff_itut_t35_parse_payload_to_frame ( FFITUTT35 itut_t35,
FFITUTT35Aux aux,
AVCodecContext avctx,
AVFrame frame 
)

Parse a pre-processed ITU-T T35 payload to fill a frame's side data.

Parameters
itut_t35The pre-filled struct
auxA struct containing extra contexts required by certain payload types. Any pointer present is owned by the caller. May be NULL, in which case the relevant payloads will not be parsed.
avctxThe context that generated the frame
frameA frame
Returns
0 on success, or a negative AVERROR code on failure

Definition at line 322 of file itut35.c.

Referenced by decode_metadata_itu_t_t35(), export_itut_t35(), and parse_itut_t35_metadata().

◆ ff_itut_t35_unref()

void ff_itut_t35_unref ( FFITUTT35Meta metadata)

Unref all references in metadata.

Definition at line 399 of file itut35.c.

Referenced by ff_h2645_sei_reset(), and ff_itut_t35_parse_payload_to_frame().