28 #include "libavutil/mem.h"
51 #if CONFIG_SSA_DECODER
55 const char *ptr = avpkt->
data;
63 duration = dialog->
end - dialog->
start;
71 *got_sub_ptr = avpkt->
size > 0;
81 .decode = ssa_decode_frame,
86 #if CONFIG_ASS_DECODER
87 static int ass_decode_frame(
AVCodecContext *avctx,
void *data,
int *got_sub_ptr,
92 const char *ptr = avpkt->
data;
107 *got_sub_ptr = avpkt->
size > 0;
117 .decode = ass_decode_frame,
fields extracted from the [Events] section
uint8_t * subtitle_header
Header containing style information for text subtitles.
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 av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static av_cold int ass_decode_init(AVCodecContext *avctx)
const char * name
Name of the codec implementation.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
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 a already initialize...
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const
Rescale a 64-bit integer by 2 rational numbers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int end
end time of the dialog in centiseconds
Libavcodec external API header.
int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, int ts_start, int duration, int raw)
Add an ASS dialog line to an AVSubtitle as a new AVSubtitleRect.
common internal API header
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
main external API structure.
int start
start time of the dialog in centiseconds
rational number numerator/denominator
static int ass_decode_close(AVCodecContext *avctx)
ASS as defined in Matroska.
#define AVERROR_INVALIDDATA
void ff_ass_split_free(ASSSplitContext *ctx)
Free all the memory allocated for an ASSSplitContext.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...