37 char *
f = strchr(
s,
c);
38 return f ? (
f -
s) : -1;
50 #define MICRODVD_PERSISTENT_OFF 0
51 #define MICRODVD_PERSISTENT_ON 1
52 #define MICRODVD_PERSISTENT_OPENED 2
55 #define MICRODVD_TAGS "cfshyYpo"
63 memcpy(&tags[tag_index], &
tag,
sizeof(
tag));
67 #define MICRODVD_STYLES "ibus"
89 char tag_char = *(
s + 1);
92 if (!tag_char || *(
s + 2) !=
':')
102 while (*
s && *
s !=
'}' &&
s - start < 256) {
105 if (style_index >= 0)
106 tag.data1 |= (1 << style_index);
120 while (*
s ==
'$' || *
s ==
'#')
122 tag.data1 = strtol(
s, &
s, 16) & 0x00ffffff;
136 tag.data_string_len =
len;
146 tag.data1 = strtol(
s, &
s, 10);
159 tag.data_string_len =
len;
170 tag.data1 = (*
s++ ==
'1');
179 tag.data1 = strtol(
s, &
s, 10);
183 tag.data2 = strtol(
s, &
s, 10);
208 switch (tags[
i].
key) {
212 if (tags[
i].
data1 & (1 << sidx))
235 av_bprintf(new_line,
"{\\pos(%"PRId32
",%"PRId32
")}",
252 switch (tags[
i].
key) {
256 if (tags[
i].
data1 & (1 << sidx))
282 char *end = avpkt->
data + avpkt->
size;
286 if (avpkt->
size <= 0)
318 *got_sub_ptr =
sub->num_rects > 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;
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.
void ff_ass_decoder_flush(AVCodecContext *avctx)
Helper to flush a text subtitles decoder making use of the FFASSDecoderContext.
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.
#define ASS_DEFAULT_ALIGNMENT
#define ASS_DEFAULT_FONT_SIZE
#define ASS_DEFAULT_COLOR
#define ASS_DEFAULT_BORDERSTYLE
#define ASS_DEFAULT_BACK_COLOR
#define ASS_DEFAULT_UNDERLINE
#define ASS_DEFAULT_ITALIC
Libavcodec external API header.
void av_bprintf(AVBPrint *buf, const char *fmt,...)
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_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
#define AV_BPRINT_SIZE_AUTOMATIC
static float sub(float src0, float src1)
static av_const int av_tolower(int c)
Locale-independent conversion of ASCII characters to lowercase.
AVCodec ff_microdvd_decoder
static int indexof(const char *s, int c)
static void microdvd_open_tags(AVBPrint *new_line, struct microdvd_tag *tags)
static int microdvd_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
static char * check_for_italic_slash_marker(struct microdvd_tag *tags, char *s)
static void microdvd_close_no_persistent_tags(AVBPrint *new_line, struct microdvd_tag *tags)
#define MICRODVD_PERSISTENT_ON
static void microdvd_set_tag(struct microdvd_tag *tags, struct microdvd_tag tag)
static char * microdvd_load_tags(struct microdvd_tag *tags, char *s)
#define MICRODVD_PERSISTENT_OFF
static int microdvd_init(AVCodecContext *avctx)
#define MICRODVD_PERSISTENT_OPENED
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
main external API structure.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * name
Name of the codec implementation.
This structure stores compressed data.