Go to the documentation of this file.
30 #define STYLE_FLAG_BOLD (1<<0)
31 #define STYLE_FLAG_ITALIC (1<<1)
32 #define STYLE_FLAG_UNDERLINE (1<<2)
34 #define BOX_SIZE_INITIAL 40
36 #define STYL_BOX (1<<0)
37 #define HLIT_BOX (1<<1)
38 #define HCLR_BOX (1<<2)
39 #define TWRP_BOX (1<<3)
42 #define BOTTOM_CENTER 2
43 #define BOTTOM_RIGHT 3
45 #define MIDDLE_CENTER 5
46 #define MIDDLE_RIGHT 6
142 int i, box_size, font_length;
143 int8_t v_align, h_align;
156 h_align = *tx3g_ptr++;
157 v_align = *tx3g_ptr++;
190 style_fontID =
AV_RB16(tx3g_ptr);
226 font_length = *tx3g_ptr++;
228 box_size = box_size + font_length;
247 tx3g_ptr = tx3g_ptr + font_length;
284 int style_entries =
AV_RB16(tsmb);
340 const char *
start = text;
359 if (text < text_end && m->box_flags &
TWRP_BOX) {
367 while (text < text_end) {
421 for (
i = 0;
i <
len;
i++) {
466 char *ptr = avpkt->
data;
468 int text_length, tsmb_type, ret_tsmb;
473 if (!ptr || avpkt->
size < 2)
483 if (avpkt->
size == 2)
504 if (text_length + 2 != avpkt->
size) {
513 if (tsmb_size == 1) {
523 if (tsmb_size == 0) {
static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
int ff_ass_subtitle_header(AVCodecContext *avctx, const char *font, int font_size, int color, int back_color, int bold, int italic, int underline, int border_style, int alignment)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
#define AV_BPRINT_SIZE_UNLIMITED
static av_cold int init(AVCodecContext *avctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_ass_subtitle_header_default(AVCodecContext *avctx)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS with default style.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
static av_cold int end(AVCodecContext *avctx)
int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, int readorder, int layer, const char *style, const char *speaker)
Add an ASS dialog to a subtitle.
#define ASS_DEFAULT_BORDERSTYLE
const static size_t box_count
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
static int get_utf8_length_at(const char *text, const char *text_end)
static const Box box_types[]
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
static int mov_text_init(AVCodecContext *avctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define STYLE_FLAG_UNDERLINE
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static void mov_text_flush(AVCodecContext *avctx)
static void mov_text_cleanup(MovTextContext *m)
static void flush(AVCodecContext *avctx)
static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end, AVCodecContext *avctx)
#define STYLE_FLAG_ITALIC
static int decode_hlit(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static void error(const char *err)
int flags2
AV_CODEC_FLAG2_*.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)
Add the pointer to an element to a dynamic array.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
#define MKBETAG(a, b, c, d)
static int decode_hclr(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
int(* decode)(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * name
Name of the codec implementation.
void av_bprintf(AVBPrint *buf, const char *fmt,...)
#define FF_ARRAY_ELEMS(a)
main external API structure.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_WB16 unsigned int_TMPL AV_RB8
static void mov_text_cleanup_ftab(MovTextContext *m)
This structure stores compressed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
static int decode_twrp(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
static int mov_text_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
static int mov_text_decode_close(AVCodecContext *avctx)
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP
Do not reset ASS ReadOrder field on flush (subtitles decoding)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
AVCodec ff_movtext_decoder
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_RB64
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16