48 AVBPrint cur_line = { 0 };
56 "Failed to move the current subtitle dialog to AVBPrint!\n");
89 for (
i=0;
i<
sub->num_rects;
i++) {
90 const char *ass =
sub->rects[
i]->ass;
98 if (!strncmp(ass,
"Dialogue: ", 10)) {
102 for (; dialog && num--; dialog++) {
111 "Splitting received ASS dialog failed: %s\n",
133 "Splitting received ASS dialog text %s failed: %s\n",
145 #if FF_API_ASS_TIMING
157 if (
av_strlcpy(buf,
s->buffer.str, bufsize) > bufsize - 1) {
162 return s->buffer.len;
ASSDialog * ff_ass_split_dialog2(ASSSplitContext *ctx, const char *buf)
Split one ASS Dialogue line from a string buffer.
void ff_ass_free_dialog(ASSDialog **dialogp)
Free a dialogue obtained from ff_ass_split_dialog2().
ASSDialog * ff_ass_split_dialog(ASSSplitContext *ctx, const char *buf, int cache, int *number)
Split one or several ASS "Dialogue" lines from a string buffer and store them in an already initializ...
int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv, const char *buf)
Split override codes out of a ASS "Dialogue" Text field.
ASSSplitContext * ff_ass_split(const char *buf)
Split a full ASS file or a ASS header from a string buffer and store the split structure in a newly a...
void ff_ass_split_free(ASSSplitContext *ctx)
Free all the memory allocated for an ASSSplitContext.
Libavcodec external API header.
#define AV_EF_EXPLODE
abort decoding on minor error detection
static av_cold int init(AVCodecContext *avctx)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, enum AVEscapeMode mode, int flags)
Escape the content in src and append it to dstbuf.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
#define AV_BPRINT_SIZE_UNLIMITED
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
static float sub(float src0, float src1)
void(* text)(void *priv, const char *text, int len)
@ SUBTITLE_ASS
Formatted text, the ass field must be set by the decoder and is authoritative.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
#define AVERROR_BUFFER_TOO_SMALL
Buffer too small.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
@ AV_ESCAPE_MODE_XML
Use XML non-markup character data escaping.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static int ttml_encode_frame(AVCodecContext *avctx, uint8_t *buf, int bufsize, const AVSubtitle *sub)
static const ASSCodesCallbacks ttml_callbacks
static av_cold int ttml_encode_close(AVCodecContext *avctx)
static av_cold int ttml_encode_init(AVCodecContext *avctx)
static void ttml_text_cb(void *priv, const char *text, int len)
static void ttml_new_line_cb(void *priv, int forced)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Set of callback functions corresponding to each override codes that can be encountered in a "Dialogue...
fields extracted from the [Events] section
char * text
actual text which will be displayed as a subtitle, can include style override control codes (see ff_a...
This struct can be casted to ASS to access to the split data.
main external API structure.
uint8_t * subtitle_header
Header containing style information for text subtitles.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
const char * name
Name of the codec implementation.
ASSSplitContext * ass_ctx
#define TTMLENC_EXTRADATA_SIGNATURE
#define TTMLENC_EXTRADATA_SIGNATURE_SIZE