#include "avcodec.h"
#include "ass_split.h"
Go to the source code of this file.
Data Structures | |
struct | ASSFields |
struct | ASSSection |
struct | ASSSplitContext |
Typedefs | |
typedef int(* | ASSConvertFunc )(void *dest, const char *buf, int len) |
Enumerations | |
enum | ASSFieldType { ASS_STR, ASS_INT, ASS_FLT, ASS_COLOR, ASS_TIMESTAMP, ASS_ALGN } |
Functions | |
static int | convert_str (void *dest, const char *buf, int len) |
static int | convert_int (void *dest, const char *buf, int len) |
static int | convert_flt (void *dest, const char *buf, int len) |
static int | convert_color (void *dest, const char *buf, int len) |
static int | convert_timestamp (void *dest, const char *buf, int len) |
static int | convert_alignment (void *dest, const char *buf, int len) |
static uint8_t * | realloc_section_array (ASSSplitContext *ctx) |
static int | is_eol (char buf) |
static const char * | skip_space (const char *buf) |
static const char * | ass_split_section (ASSSplitContext *ctx, const char *buf) |
static int | ass_split (ASSSplitContext *ctx, const char *buf) |
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 allocated context. | |
static void | free_section (ASSSplitContext *ctx, const ASSSection *section) |
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 initialized context. | |
void | ff_ass_split_free (ASSSplitContext *ctx) |
Free all the memory allocated for an ASSSplitContext. | |
int | ff_ass_split_override_codes (const ASSCodesCallbacks *callbacks, void *priv, const char *buf) |
Split override codes out of a ASS "Dialogue" Text field. | |
ASSStyle * | ass_style_get (ASSSplitContext *ctx, const char *style) |
Find an ASSStyle structure by its name. | |
Variables | |
static const ASSSection | ass_sections [] |
static const ASSConvertFunc | convert_func [] |
typedef int(* ASSConvertFunc)(void *dest, const char *buf, int len) |
Definition at line 113 of file ass_split.c.
enum ASSFieldType |
Definition at line 25 of file ass_split.c.
static int ass_split | ( | ASSSplitContext * | ctx, | |
const char * | buf | |||
) | [static] |
Definition at line 275 of file ass_split.c.
Referenced by ff_ass_split(), and ff_ass_split_dialog().
static const char* ass_split_section | ( | ASSSplitContext * | ctx, | |
const char * | buf | |||
) | [static] |
ASSStyle* ass_style_get | ( | ASSSplitContext * | ctx, | |
const char * | style | |||
) |
Find an ASSStyle structure by its name.
ctx | Context previously initialized by ff_ass_split(). | |
style | name of the style to search for. |
Definition at line 457 of file ass_split.c.
Referenced by srt_style_apply().
static int convert_alignment | ( | void * | dest, | |
const char * | buf, | |||
int | len | |||
) | [static] |
Definition at line 147 of file ass_split.c.
static int convert_color | ( | void * | dest, | |
const char * | buf, | |||
int | len | |||
) | [static] |
Definition at line 135 of file ass_split.c.
static int convert_flt | ( | void * | dest, | |
const char * | buf, | |||
int | len | |||
) | [static] |
Definition at line 131 of file ass_split.c.
static int convert_int | ( | void * | dest, | |
const char * | buf, | |||
int | len | |||
) | [static] |
Definition at line 127 of file ass_split.c.
static int convert_str | ( | void * | dest, | |
const char * | buf, | |||
int | len | |||
) | [static] |
Definition at line 115 of file ass_split.c.
static int convert_timestamp | ( | void * | dest, | |
const char * | buf, | |||
int | len | |||
) | [static] |
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 allocated context.
buf | String containing the ASS formated data. |
Definition at line 297 of file ass_split.c.
Referenced by ass_decode_init(), and srt_encode_init().
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 initialized context.
ctx | Context previously initialized by ff_ass_split(). | |
buf | String containing the ASS "Dialogue" lines. | |
cache | Set to 1 to keep all the previously split ASSDialog in the context, or set to 0 to free all the previously split ASSDialog. | |
number | If not NULL, the pointed integer will be set to the number of split ASSDialog. |
Definition at line 332 of file ass_split.c.
Referenced by ass_decode_frame(), and srt_encode_frame().
void ff_ass_split_free | ( | ASSSplitContext * | ctx | ) |
Free all the memory allocated for an ASSSplitContext.
ctx | Context previously initialized by ff_ass_split(). |
Definition at line 351 of file ass_split.c.
Referenced by ass_decode_close(), ff_ass_split(), and srt_encode_close().
int ff_ass_split_override_codes | ( | const ASSCodesCallbacks * | callbacks, | |
void * | priv, | |||
const char * | buf | |||
) |
Split override codes out of a ASS "Dialogue" Text field.
callbacks | Set of callback functions called for each override code encountered. | |
priv | Opaque pointer passed to the callback functions. | |
buf | The ASS "Dialogue" Text field to split. |
Definition at line 362 of file ass_split.c.
Referenced by srt_encode_frame().
static void free_section | ( | ASSSplitContext * | ctx, | |
const ASSSection * | section | |||
) | [static] |
Definition at line 308 of file ass_split.c.
Referenced by ff_ass_split_dialog(), and ff_ass_split_free().
static int is_eol | ( | char | buf | ) | [inline, static] |
Definition at line 191 of file ass_split.c.
Referenced by ass_split_section(), and srt_read_packet().
static uint8_t* realloc_section_array | ( | ASSSplitContext * | ctx | ) | [static] |
static const char* skip_space | ( | const char * | buf | ) | [inline, static] |
const ASSSection ass_sections[] [static] |
Definition at line 50 of file ass_split.c.
const ASSConvertFunc convert_func[] [static] |
Initial value:
{ [ASS_STR] = convert_str, [ASS_INT] = convert_int, [ASS_FLT] = convert_flt, [ASS_COLOR] = convert_color, [ASS_TIMESTAMP] = convert_timestamp, [ASS_ALGN] = convert_alignment, }
Definition at line 158 of file ass_split.c.
Referenced by ass_split_section().