subsdec.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * subsdec.h : text/ASS-SSA/USF subtitles headers
00003  *****************************************************************************
00004  * Copyright (C) 2000-2006 the VideoLAN team
00005  * $Id: aaf307dd1b4bcd72627cdd9836c9a79e6d797dad $
00006  *
00007  * Authors: Gildas Bazin <gbazin@videolan.org>
00008  *          Samuel Hocevar <sam@zoy.org>
00009  *          Derk-Jan Hartman <hartman at videolan dot org>
00010  *          Bernie Purcell <bitmap@videolan.org>
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00025  *****************************************************************************/
00026 
00027 #ifndef SUBSDEC_HEADER_H
00028 #define SUBSDEC_HEADER_H
00029 
00030 #include <vlc_common.h>
00031 #include <vlc_codec.h>
00032 #include <vlc_input.h>
00033 
00034 #include <vlc_filter.h>
00035 #include <vlc_image.h>
00036 #include <vlc_charset.h>
00037 #include <vlc_stream.h>
00038 #include <vlc_xml.h>
00039 #include <string.h>
00040 
00041 
00042 #define DEFAULT_NAME "Default"
00043 #define MAX_LINE 8192
00044 #define NO_BREAKING_SPACE  "&#160;"
00045 
00046 enum
00047 {
00048     ATTRIBUTE_ALIGNMENT = (1 << 0),
00049     ATTRIBUTE_X         = (1 << 1),
00050     ATTRIBUTE_X_PERCENT = (1 << 2),
00051     ATTRIBUTE_Y         = (1 << 3),
00052     ATTRIBUTE_Y_PERCENT = (1 << 4),
00053 };
00054 
00055 typedef struct
00056 {
00057     char       *psz_filename;
00058     picture_t  *p_pic;
00059 } image_attach_t;
00060 
00061 typedef struct
00062 {
00063     char *          psz_stylename; /* The name of the style, no comma's allowed */
00064     text_style_t    font_style;
00065     int             i_align;
00066     int             i_margin_h;
00067     int             i_margin_v;
00068     int             i_margin_percent_h;
00069     int             i_margin_percent_v;
00070 }  ssa_style_t;
00071 
00072 /*****************************************************************************
00073  * decoder_sys_t : decoder descriptor
00074  *****************************************************************************/
00075 struct decoder_sys_t
00076 {
00077     bool                b_ass;                           /* The subs are ASS */
00078 
00079     int                 i_original_height;
00080     int                 i_original_width;
00081     int                 i_align;          /* Subtitles alignment on the vout */
00082 
00083     vlc_iconv_t         iconv_handle;            /* handle to iconv instance */
00084     bool                b_autodetect_utf8;
00085 
00086     ssa_style_t         **pp_ssa_styles;
00087     int                 i_ssa_styles;
00088 
00089     image_attach_t      **pp_images;
00090     int                 i_images;
00091 };
00092 
00093 
00094 char                *GotoNextLine( char *psz_text );
00095 
00096 void                ParseSSAHeader ( decoder_t * );
00097 void                ParseSSAString ( decoder_t *, char *, subpicture_t * );
00098 
00099 #endif

Generated on Tue May 25 08:04:54 2010 for VLC by  doxygen 1.5.6