Go to the documentation of this file.
26 #include "config_components.h"
41 #define OFFSET(x) offsetof(TextContext, x)
42 #define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
44 {
"keep_ass_markup",
"Set if ASS tags must be escaped",
OFFSET(keep_ass_markup),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags=
SD },
49 int *got_sub_ptr,
const AVPacket *avpkt)
53 const char *ptr = avpkt->
data;
57 if (ptr && avpkt->
size > 0 && *ptr) {
64 *got_sub_ptr =
sub->num_rects > 0;
76 .
class_name =
"text/vplayer/stl/pjs/subviewer1 decoder",
82 #if CONFIG_TEXT_DECODER
97 #if CONFIG_VPLAYER_DECODER || CONFIG_PJS_DECODER || CONFIG_SUBVIEWER1_DECODER || CONFIG_STL_DECODER
106 #if CONFIG_VPLAYER_DECODER
114 .init = linebreak_init,
121 #if CONFIG_STL_DECODER
129 .init = linebreak_init,
136 #if CONFIG_PJS_DECODER
144 .init = linebreak_init,
151 #if CONFIG_SUBVIEWER1_DECODER
153 .
p.
name =
"subviewer1",
159 .init = linebreak_init,
#define AV_BPRINT_SIZE_UNLIMITED
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)
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.
const FFCodec ff_text_decoder
static void text_flush(AVCodecContext *avctx)
AVCodec p
The public AVCodec.
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[]
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const char * av_default_item_name(void *ptr)
Return the context name.
int flags2
AV_CODEC_FLAG2_*.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const FFCodec ff_subviewer1_decoder
static int text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
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
const FFCodec ff_stl_decoder
main external API structure.
#define FF_CODEC_DECODE_SUB_CB(func)
const FFCodec ff_vplayer_decoder
This structure stores compressed data.
const FFCodec ff_pjs_decoder
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP
Do not reset ASS ReadOrder field on flush (subtitles decoding)