FFmpeg  1.2.12
ass_split.h
Go to the documentation of this file.
1 /*
2  * SSA/ASS spliting functions
3  * Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVCODEC_ASS_SPLIT_H
23 #define AVCODEC_ASS_SPLIT_H
24 
28 typedef struct {
29  char *script_type;
30  char *collisions;
31  int play_res_x;
32  int play_res_y;
33  float timer;
35 
39 typedef struct {
40  char *name;
41  char *font_name;
42  int font_size;
44  int back_color;
45  int bold;
46  int italic;
47  int underline;
48  int alignment;
51 } ASSStyle;
52 
56 typedef struct {
57  int layer;
58  int start;
59  int end;
60  char *style;
61  char *text;
64 } ASSDialog;
65 
69 typedef struct {
75 } ASS;
76 
81 
89 ASSSplitContext *ff_ass_split(const char *buf);
90 
104 ASSDialog *ff_ass_split_dialog(ASSSplitContext *ctx, const char *buf,
105  int cache, int *number);
106 
113 
114 
119 typedef struct {
124  void (*text)(void *priv, const char *text, int len);
125  void (*new_line)(void *priv, int forced);
126  void (*style)(void *priv, char style, int close);
127  void (*color)(void *priv, unsigned int color, unsigned int color_id);
128  void (*alpha)(void *priv, int alpha, int alpha_id);
129  void (*font_name)(void *priv, const char *name);
130  void (*font_size)(void *priv, int size);
131  void (*alignment)(void *priv, int alignment);
132  void (*cancel_overrides)(void *priv, const char *style);
139  void (*move)(void *priv, int x1, int y1, int x2, int y2, int t1, int t2);
140  void (*origin)(void *priv, int x, int y);
147  void (*end)(void *priv);
150 
160 int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv,
161  const char *buf);
162 
170 ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style);
171 
172 #endif /* AVCODEC_ASS_SPLIT_H */