Go to the documentation of this file.
39 #define OFFSET(x) offsetof(TextContext, x)
40 #define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
42 {
"keep_ass_markup",
"Set if ASS tags must be escaped",
OFFSET(keep_ass_markup),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags=
SD },
52 const char *ptr = avpkt->
data;
56 if (ptr && avpkt->
size > 0 && *ptr) {
63 *got_sub_ptr =
sub->num_rects > 0;
75 .
class_name =
"text/vplayer/stl/pjs/subviewer1 decoder",
81 #if CONFIG_TEXT_DECODER
96 #if CONFIG_VPLAYER_DECODER || CONFIG_PJS_DECODER || CONFIG_SUBVIEWER1_DECODER || CONFIG_STL_DECODER
105 #if CONFIG_VPLAYER_DECODER
113 .
init = linebreak_init,
120 #if CONFIG_STL_DECODER
128 .
init = linebreak_init,
135 #if CONFIG_PJS_DECODER
143 .
init = linebreak_init,
150 #if CONFIG_SUBVIEWER1_DECODER
152 .
name =
"subviewer1",
158 .
init = linebreak_init,
#define AV_BPRINT_SIZE_UNLIMITED
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
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 float sub(float src0, float src1)
static int text_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
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.
static void text_flush(AVCodecContext *avctx)
const AVCodec ff_stl_decoder
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 void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
void ff_ass_bprint_text_event(AVBPrint *buf, const char *p, int size, const char *linebreaks, int keep_ass_markup)
Escape a text subtitle using ASS syntax into an AVBPrint buffer.
static const AVOption options[]
const AVCodec ff_pjs_decoder
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
static void flush(AVCodecContext *avctx)
const char * av_default_item_name(void *ptr)
Return the context name.
const AVCodec ff_subviewer1_decoder
const AVCodec ff_vplayer_decoder
int flags2
AV_CODEC_FLAG2_*.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const AVCodec ff_text_decoder
const char * name
Name of the codec implementation.
static const AVClass textsub_decoder_class
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
@ AV_CODEC_ID_TEXT
raw UTF-8 text
main external API structure.
This structure stores compressed data.
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP
Do not reset ASS ReadOrder field on flush (subtitles decoding)