Go to the documentation of this file.
38 char *
f = strchr(
s,
c);
39 return f ? (
f -
s) : -1;
51 #define MICRODVD_PERSISTENT_OFF 0
52 #define MICRODVD_PERSISTENT_ON 1
53 #define MICRODVD_PERSISTENT_OPENED 2
56 #define MICRODVD_TAGS "cfshyYpo"
64 memcpy(&tags[tag_index], &
tag,
sizeof(
tag));
68 #define MICRODVD_STYLES "ibus"
90 char tag_char = *(
s + 1);
93 if (!tag_char || *(
s + 2) !=
':')
103 while (*
s && *
s !=
'}' &&
s - start < 256) {
106 if (style_index >= 0)
107 tag.data1 |= (1 << style_index);
121 while (*
s ==
'$' || *
s ==
'#')
123 tag.data1 = strtol(
s, &
s, 16) & 0x00ffffff;
137 tag.data_string_len =
len;
147 tag.data1 = strtol(
s, &
s, 10);
160 tag.data_string_len =
len;
171 tag.data1 = (*
s++ ==
'1');
180 tag.data1 = strtol(
s, &
s, 10);
184 tag.data2 = strtol(
s, &
s, 10);
209 switch (tags[
i].
key) {
213 if (tags[
i].
data1 & (1 << sidx))
236 av_bprintf(new_line,
"{\\pos(%"PRId32
",%"PRId32
")}",
253 switch (tags[
i].
key) {
257 if (tags[
i].
data1 & (1 << sidx))
278 int *got_sub_ptr,
const AVPacket *avpkt)
282 char *end = avpkt->
data + avpkt->
size;
286 if (avpkt->
size <= 0)
343 if (tags[
i].
data1 & (1 << sidx)) {
345 case 'i': italic = 1;
break;
346 case 'b': bold = 1;
break;
347 case 'u': underline = 1;
break;
354 case 's': font_size = tags[
i].
data1;
break;
355 case 'p': alignment = 8;
break;
372 .
p.
name =
"microdvd",
int ff_ass_subtitle_header(AVCodecContext *avctx, const char *font, int font_size, int color, int back_color, int bold, int italic, int underline, int border_style, int alignment)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
static char * microdvd_load_tags(struct microdvd_tag *tags, char *s)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
static int microdvd_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
static int indexof(const char *s, int c)
#define ASS_DEFAULT_ALIGNMENT
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 microdvd_open_tags(AVBPrint *new_line, struct microdvd_tag *tags)
#define ASS_DEFAULT_BORDERSTYLE
AVCodec p
The public AVCodec.
#define AV_BPRINT_SIZE_AUTOMATIC
static void microdvd_close_no_persistent_tags(AVBPrint *new_line, struct microdvd_tag *tags)
#define CODEC_LONG_NAME(str)
#define ASS_DEFAULT_BACK_COLOR
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
static char * check_for_italic_slash_marker(struct microdvd_tag *tags, char *s)
static int microdvd_init(AVCodecContext *avctx)
const FFCodec ff_microdvd_decoder
#define ASS_DEFAULT_UNDERLINE
void ff_ass_decoder_flush(AVCodecContext *avctx)
Helper to flush a text subtitles decoder making use of the FFASSDecoderContext.
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static void microdvd_set_tag(struct microdvd_tag *tags, struct microdvd_tag tag)
const char * name
Name of the codec implementation.
#define ASS_DEFAULT_ITALIC
#define ASS_DEFAULT_COLOR
void av_bprintf(AVBPrint *buf, const char *fmt,...)
#define ASS_DEFAULT_FONT_SIZE
main external API structure.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
#define FF_CODEC_DECODE_SUB_CB(func)
#define MICRODVD_PERSISTENT_OFF
This structure stores compressed data.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
#define MICRODVD_PERSISTENT_OPENED
static av_const int av_tolower(int c)
Locale-independent conversion of ASCII characters to lowercase.
#define MICRODVD_PERSISTENT_ON