26#include "config_components.h"
42#define OFFSET(x) offsetof(TextContext, x)
43#define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
45 {
"keep_ass_markup",
"Set if ASS tags must be escaped",
OFFSET(keep_ass_markup),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags=
SD },
50 int *got_sub_ptr,
const AVPacket *avpkt)
54 const char *ptr = avpkt->
data;
58 if (ptr && avpkt->
size > 0 && *ptr) {
77 .class_name =
"text/vplayer/stl/pjs/subviewer1 decoder",
83#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,
120#if CONFIG_STL_DECODER
128 .init = linebreak_init,
134#if CONFIG_PJS_DECODER
142 .init = linebreak_init,
148#if CONFIG_SUBVIEWER1_DECODER
150 .p.name =
"subviewer1",
156 .init = linebreak_init,
const FFCodec ff_pjs_decoder
const FFCodec ff_text_decoder
const FFCodec ff_vplayer_decoder
const FFCodec ff_subviewer1_decoder
const FFCodec ff_stl_decoder
int ff_ass_subtitle_header_default(AVCodecContext *avctx)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS with default style.
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.
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.
Libavcodec external API header.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AV_BPRINT_SIZE_UNLIMITED
#define CODEC_LONG_NAME(str)
#define FF_CODEC_DECODE_SUB_CB(func)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP
Do not reset ASS ReadOrder field on flush (subtitles decoding)
@ AV_CODEC_ID_TEXT
raw UTF-8 text
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
Macro definitions for various function/variable attributes.
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Describe the class of an AVClass context structure.
main external API structure.
int flags2
AV_CODEC_FLAG2_*.
This structure stores compressed data.
static const AVClass textsub_decoder_class
static av_cold void text_flush(AVCodecContext *avctx)
static int text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)