27#define MAX_CC_ELEMENTS 128
39 { 24000, 1001, 25, 3 },
41 { 30000, 1001, 20, 2},
43 { 60000, 1001, 10, 1},
50 memset(ccf, 0,
sizeof(*ccf));
57 memset(ccf, 0,
sizeof(*ccf));
94 int cc_608_tuples = 0;
95 int cc_708_tuples = 0;
112 cc_filled += cc_608_tuples;
120 cc_filled += cc_708_tuples;
123 while (cc_filled < ccf->expected_cc_count) {
160 "cc_fifo cannot transcode captions fps=%d/%d\n",
171 if (cc_type == 0x00 || cc_type == 0x01) {
173 }
else if (cc_valid && (cc_type == 0x02 || cc_type == 0x03)) {
#define i(width, name, range_min, range_max)
static int ff_ccfifo_getoutputsize(const CCFifo *ccf)
Provide the size in bytes of an output buffer to allocate.
#define CC_BYTES_PER_ENTRY
AVFifo * av_fifo_alloc2(size_t nb_elems, size_t elem_size, unsigned int flags)
Allocate and initialize an AVFifo with a given element size.
void av_fifo_freep2(AVFifo **f)
Free an AVFifo and reset pointer to NULL.
size_t av_fifo_can_read(const AVFifo *f)
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
int av_fifo_read(AVFifo *f, void *buf, size_t nb_elems)
Read data from a FIFO.
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
Remove and free all side data instances of the given type.
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, size_t size)
Add a new side data to a frame.
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
int ff_ccfifo_inject(CCFifo *ccf, AVFrame *frame)
Insert CC data from the FIFO into an AVFrame (as side data)
int ff_ccfifo_init(CCFifo *ccf, AVRational framerate, void *log_ctx)
Initialize a CCFifo.
int ff_ccfifo_extractbytes(CCFifo *ccf, uint8_t *cc_bytes, size_t len)
Just like ff_ccfifo_extract(), but takes the raw bytes instead of an AVFrame.
int ff_ccfifo_injectbytes(CCFifo *ccf, uint8_t *cc_data, size_t len)
Just like ff_ccfifo_inject(), but takes the raw bytes to insert the CC data int rather than an AVFram...
void ff_ccfifo_uninit(CCFifo *ccf)
Free all memory allocated in a CCFifo and clear the context.
int ff_ccfifo_extract(CCFifo *ccf, AVFrame *frame)
Extract CC data from an AVFrame.
static const struct cc_lookup cc_lookup_vals[]
void av_log_once(void *avcl, int initial_level, int subsequent_level, int *state, const char *fmt,...)
#define FF_ARRAY_ELEMS(a)
Structure to hold side data for an AVFrame.
This structure describes decoded (raw) audio or video data.
Rational number (pair of numerator and denominator).
struct AVFifo * cc_608_fifo
struct AVFifo * cc_708_fifo
static void error(const char *err)