FFmpeg
Data Structures | Macros | Functions | Variables
microdvddec.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/parseutils.h"
#include "libavutil/bprint.h"
#include "avcodec.h"
#include "ass.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  microdvd_tag
 

Macros

#define MICRODVD_PERSISTENT_OFF   0
 
#define MICRODVD_PERSISTENT_ON   1
 
#define MICRODVD_PERSISTENT_OPENED   2
 
#define MICRODVD_TAGS   "cfshyYpo"
 
#define MICRODVD_STYLES   "ibus"
 

Functions

static int indexof (const char *s, int c)
 
static void microdvd_set_tag (struct microdvd_tag *tags, struct microdvd_tag tag)
 
static char * check_for_italic_slash_marker (struct microdvd_tag *tags, char *s)
 
static char * microdvd_load_tags (struct microdvd_tag *tags, char *s)
 
static void microdvd_open_tags (AVBPrint *new_line, struct microdvd_tag *tags)
 
static void microdvd_close_no_persistent_tags (AVBPrint *new_line, struct microdvd_tag *tags)
 
static int microdvd_decode_frame (AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
 
static int microdvd_init (AVCodecContext *avctx)
 

Variables

const AVCodec ff_microdvd_decoder
 

Detailed Description

MicroDVD subtitle decoder

Based on the specifications found here: https://trac.videolan.org/vlc/ticket/1825#comment:6

Definition in file microdvddec.c.

Macro Definition Documentation

◆ MICRODVD_PERSISTENT_OFF

#define MICRODVD_PERSISTENT_OFF   0

Definition at line 51 of file microdvddec.c.

◆ MICRODVD_PERSISTENT_ON

#define MICRODVD_PERSISTENT_ON   1

Definition at line 52 of file microdvddec.c.

◆ MICRODVD_PERSISTENT_OPENED

#define MICRODVD_PERSISTENT_OPENED   2

Definition at line 53 of file microdvddec.c.

◆ MICRODVD_TAGS

#define MICRODVD_TAGS   "cfshyYpo"

Definition at line 56 of file microdvddec.c.

◆ MICRODVD_STYLES

#define MICRODVD_STYLES   "ibus"

Definition at line 68 of file microdvddec.c.

Function Documentation

◆ indexof()

static int indexof ( const char *  s,
int  c 
)
static

◆ microdvd_set_tag()

static void microdvd_set_tag ( struct microdvd_tag tags,
struct microdvd_tag  tag 
)
static

Definition at line 58 of file microdvddec.c.

Referenced by check_for_italic_slash_marker(), and microdvd_load_tags().

◆ check_for_italic_slash_marker()

static char* check_for_italic_slash_marker ( struct microdvd_tag tags,
char *  s 
)
static

Definition at line 72 of file microdvddec.c.

Referenced by microdvd_load_tags().

◆ microdvd_load_tags()

static char* microdvd_load_tags ( struct microdvd_tag tags,
char *  s 
)
static

Definition at line 84 of file microdvddec.c.

Referenced by microdvd_decode_frame(), and microdvd_init().

◆ microdvd_open_tags()

static void microdvd_open_tags ( AVBPrint *  new_line,
struct microdvd_tag tags 
)
static

Definition at line 203 of file microdvddec.c.

Referenced by microdvd_decode_frame().

◆ microdvd_close_no_persistent_tags()

static void microdvd_close_no_persistent_tags ( AVBPrint *  new_line,
struct microdvd_tag tags 
)
static

Definition at line 245 of file microdvddec.c.

Referenced by microdvd_decode_frame().

◆ microdvd_decode_frame()

static int microdvd_decode_frame ( AVCodecContext avctx,
void *  data,
int got_sub_ptr,
AVPacket avpkt 
)
static

Definition at line 277 of file microdvddec.c.

◆ microdvd_init()

static int microdvd_init ( AVCodecContext avctx)
static

Definition at line 323 of file microdvddec.c.

Variable Documentation

◆ ff_microdvd_decoder

const AVCodec ff_microdvd_decoder
Initial value:
= {
.name = "microdvd",
.long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle"),
.init = microdvd_init,
.priv_data_size = sizeof(FFASSDecoderContext),
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 372 of file microdvddec.c.

AVMEDIA_TYPE_SUBTITLE
@ AVMEDIA_TYPE_SUBTITLE
Definition: avutil.h:204
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
microdvd_decode_frame
static int microdvd_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
Definition: microdvddec.c:277
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
microdvd_init
static int microdvd_init(AVCodecContext *avctx)
Definition: microdvddec.c:323
ff_ass_decoder_flush
void ff_ass_decoder_flush(AVCodecContext *avctx)
Helper to flush a text subtitles decoder making use of the FFASSDecoderContext.
Definition: ass.c:140
AV_CODEC_ID_MICRODVD
@ AV_CODEC_ID_MICRODVD
Definition: codec_id.h:531
FFASSDecoderContext
Definition: ass.h:46