• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/ass_split.h

Go to the documentation of this file.
00001 /*
00002  * SSA/ASS spliting functions
00003  * Copyright (c) 2010  Aurelien Jacobs <aurel@gnuage.org>
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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 /* AVCODEC_ASS_SPLIT_H */
Generated on Fri Feb 1 2013 14:34:30 for FFmpeg by doxygen 1.7.1