00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_ASS_SPLIT_H
00023 #define AVCODEC_ASS_SPLIT_H
00024
00028 typedef struct {
00029 char *script_type;
00030 char *collisions;
00031 int play_res_x;
00032 int play_res_y;
00033 float timer;
00034 } ASSScriptInfo;
00035
00039 typedef struct {
00040 char *name;
00041 char *font_name;
00042 int font_size;
00043 int primary_color;
00044 int back_color;
00045 int bold;
00046 int italic;
00047 int underline;
00048 int alignment;
00051 } ASSStyle;
00052
00056 typedef struct {
00057 int layer;
00058 int start;
00059 int end;
00060 char *style;
00061 char *text;
00064 } ASSDialog;
00065
00069 typedef struct {
00070 ASSScriptInfo script_info;
00071 ASSStyle *styles;
00072 int styles_count;
00073 ASSDialog *dialogs;
00074 int dialogs_count;
00075 } ASS;
00076
00080 typedef struct ASSSplitContext ASSSplitContext;
00081
00089 ASSSplitContext *ff_ass_split(const char *buf);
00090
00104 ASSDialog *ff_ass_split_dialog(ASSSplitContext *ctx, const char *buf,
00105 int cache, int *number);
00106
00112 void ff_ass_split_free(ASSSplitContext *ctx);
00113
00114
00119 typedef struct {
00124 void (*text)(void *priv, const char *text, int len);
00125 void (*new_line)(void *priv, int forced);
00126 void (*style)(void *priv, char style, int close);
00127 void (*color)(void *priv, unsigned int color, unsigned int color_id);
00128 void (*alpha)(void *priv, int alpha, int alpha_id);
00129 void (*font_name)(void *priv, const char *name);
00130 void (*font_size)(void *priv, int size);
00131 void (*alignment)(void *priv, int alignment);
00132 void (*cancel_overrides)(void *priv, const char *style);
00139 void (*move)(void *priv, int x1, int y1, int x2, int y2, int t1, int t2);
00140 void (*origin)(void *priv, int x, int y);
00147 void (*end)(void *priv);
00149 } ASSCodesCallbacks;
00150
00160 int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv,
00161 const char *buf);
00162
00170 ASSStyle *ass_style_get(ASSSplitContext *ctx, const char *style);
00171
00172 #endif