00001 /***************************************************************************** 00002 * subsdec.h : text/ASS-SSA/USF subtitles headers 00003 ***************************************************************************** 00004 * Copyright (C) 2000-2006 the VideoLAN team 00005 * $Id$ 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_vout.h> 00032 #include <vlc_codec.h> 00033 #include <vlc_input.h> 00034 00035 #include <vlc_osd.h> 00036 #include <vlc_filter.h> 00037 #include <vlc_image.h> 00038 #include <vlc_charset.h> 00039 #include <vlc_stream.h> 00040 #include <vlc_xml.h> 00041 #include <errno.h> 00042 #include <string.h> 00043 00044 00045 #define DEFAULT_NAME "Default" 00046 #define MAX_LINE 8192 00047 #define NO_BREAKING_SPACE " " 00048 00049 enum 00050 { 00051 ATTRIBUTE_ALIGNMENT = (1 << 0), 00052 ATTRIBUTE_X = (1 << 1), 00053 ATTRIBUTE_X_PERCENT = (1 << 2), 00054 ATTRIBUTE_Y = (1 << 3), 00055 ATTRIBUTE_Y_PERCENT = (1 << 4), 00056 }; 00057 00058 typedef struct 00059 { 00060 char *psz_filename; 00061 picture_t *p_pic; 00062 } image_attach_t; 00063 00064 typedef struct 00065 { 00066 char * psz_stylename; /* The name of the style, no comma's allowed */ 00067 text_style_t font_style; 00068 int i_align; 00069 int i_margin_h; 00070 int i_margin_v; 00071 int i_margin_percent_h; 00072 int i_margin_percent_v; 00073 } ssa_style_t; 00074 00075 /***************************************************************************** 00076 * decoder_sys_t : decoder descriptor 00077 *****************************************************************************/ 00078 struct decoder_sys_t 00079 { 00080 bool b_ass; /* The subs are ASS */ 00081 int i_original_height; 00082 int i_original_width; 00083 int i_align; /* Subtitles alignment on the vout */ 00084 vlc_iconv_t iconv_handle; /* handle to iconv instance */ 00085 bool b_autodetect_utf8; 00086 00087 ssa_style_t **pp_ssa_styles; 00088 int i_ssa_styles; 00089 00090 image_attach_t **pp_images; 00091 int i_images; 00092 }; 00093 00094 00095 char *GotoNextLine( char *psz_text ); 00096 00097 void ParseSSAHeader ( decoder_t * ); 00098 void ParseSSAString ( decoder_t *, char *, subpicture_t * ); 00099 00100 #endif
1.5.1