FFmpeg
Functions
atsc_a53.c File Reference
#include <stddef.h>
#include <stdint.h>
#include "atsc_a53.h"
#include "get_bits.h"

Go to the source code of this file.

Functions

int ff_alloc_a53_sei (const AVFrame *frame, size_t prefix_len, void **data, size_t *sei_size)
 Check AVFrame for A53 side data and allocate and fill SEI message with A53 info. More...
 
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. More...
 

Function Documentation

◆ ff_alloc_a53_sei()

int ff_alloc_a53_sei ( const AVFrame frame,
size_t  prefix_len,
void **  data,
size_t *  sei_size 
)

Check AVFrame for A53 side data and allocate and fill SEI message with A53 info.

Parameters
frameRaw frame to get A53 side data from
prefix_lenNumber of bytes to allocate before SEI message
dataPointer to a variable to store allocated memory Upon return the variable will hold NULL on error or if frame has no A53 info. Otherwise it will point to prefix_len uninitialized bytes followed by *sei_size SEI message
sei_sizePointer to a variable to store generated SEI message length
Returns
Zero on success, negative error code on failure

'GA94' is standard in North America for ATSC, but hard coding this style may not be the right thing to do – other formats do exist. This information is not available in the side_data so we are going with this right now.

Definition at line 25 of file atsc_a53.c.

Referenced by libx265_encode_frame(), prepare_sei_data_array(), qsv_h264_set_encode_ctrl(), setup_frame(), vaapi_encode_h264_init_picture_params(), vaapi_encode_h265_init_picture_params(), and vtenc_send_frame().

◆ ff_parse_a53_cc()

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.

Parameters
pbufPointer to an AVBufferRef to append the closed captions. *pbuf may be NULL, in which case a new buffer will be allocated and put in it.
dataThe data array containing the raw A53 data.
sizeSize of the data array in bytes.
Returns
Number of closed captions parsed on success, negative error code on failure. If no Closed Captions are parsed, *pbuf is untouched.

Definition at line 68 of file atsc_a53.c.

Referenced by decode_registered_user_data_closed_caption(), export_itut_t35(), and libdav1d_receive_frame().