27 void **
data,
size_t *sei_size)
40 *sei_size = side_data->
size + 11;
44 sei_data = (uint8_t*)*
data + prefix_len;
59 sei_data[8] = ((side_data->
size/3) & 0x1f) | 0x40;
62 memcpy(sei_data + 10, side_data->
data, side_data->
size);
64 sei_data[side_data->
size+10] = 255;
72 size_t new_size, old_size = buf ? buf->
size : 0;
81 if (!(
data[1] & 0x40))
84 cc_count =
data[1] & 0x1F;
90 if (cc_count * 3 >=
size - 3)
93 new_size = (old_size + cc_count * 3);
95 if (new_size > INT_MAX)
105 memcpy(buf->
data + old_size,
data + 3, cc_count * 3);
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.
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.
int av_buffer_realloc(AVBufferRef **pbuf, size_t size)
Reallocate a given buffer.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
#define MKTAG(a, b, c, d)
Memory handling functions.
A reference to a data buffer.
uint8_t * data
The data buffer.
size_t size
Size of data in bytes.
Structure to hold side data for an AVFrame.
This structure describes decoded (raw) audio or video data.