]> git.sesse.net Git - vlc/blob - modules/codec/subtitles/subsdec.h
update module LIST file.
[vlc] / modules / codec / subtitles / subsdec.h
1 /*****************************************************************************
2  * subsdec.h : text/ASS-SSA/USF subtitles headers
3  *****************************************************************************
4  * Copyright (C) 2000-2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Gildas Bazin <gbazin@videolan.org>
8  *          Samuel Hocevar <sam@zoy.org>
9  *          Derk-Jan Hartman <hartman at videolan dot org>
10  *          Bernie Purcell <bitmap@videolan.org>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26
27 #ifndef SUBSDEC_HEADER_H
28 #define SUBSDEC_HEADER_H
29
30 #include <vlc/vlc.h>
31 #include <vlc_vout.h>
32 #include <vlc_codec.h>
33 #include <vlc_input.h>
34
35 #include <vlc_osd.h>
36 #include <vlc_filter.h>
37 #include <vlc_image.h>
38 #include <vlc_charset.h>
39 #include <vlc_stream.h>
40 #include <vlc_xml.h>
41 #include <errno.h>
42 #include <string.h>
43
44
45 #define DEFAULT_NAME "Default"
46 #define MAX_LINE 8192
47 #define NO_BREAKING_SPACE  "&#160;"
48
49 enum
50 {
51     ATTRIBUTE_ALIGNMENT = (1 << 0),
52     ATTRIBUTE_X         = (1 << 1),
53     ATTRIBUTE_X_PERCENT = (1 << 2),
54     ATTRIBUTE_Y         = (1 << 3),
55     ATTRIBUTE_Y_PERCENT = (1 << 4),
56 };
57
58 typedef struct
59 {
60     char       *psz_filename;
61     picture_t  *p_pic;
62 } image_attach_t;
63
64 typedef struct
65 {
66     char *          psz_stylename; /* The name of the style, no comma's allowed */
67     text_style_t    font_style;
68     int             i_align;
69     int             i_margin_h;
70     int             i_margin_v;
71     int             i_margin_percent_h;
72     int             i_margin_percent_v;
73 }  ssa_style_t;
74
75 /*****************************************************************************
76  * decoder_sys_t : decoder descriptor
77  *****************************************************************************/
78 struct decoder_sys_t
79 {
80     vlc_bool_t          b_ass;                           /* The subs are ASS */
81     int                 i_original_height;
82     int                 i_original_width;
83     int                 i_align;          /* Subtitles alignment on the vout */
84     vlc_iconv_t         iconv_handle;            /* handle to iconv instance */
85     vlc_bool_t          b_autodetect_utf8;
86
87     ssa_style_t         **pp_ssa_styles;
88     int                 i_ssa_styles;
89
90     image_attach_t      **pp_images;
91     int                 i_images;
92 };
93
94
95 char                *GotoNextLine( char *psz_text );
96
97 void                ParseSSAHeader ( decoder_t * );
98 void                ParseSSAString ( decoder_t *, char *, subpicture_t * );
99
100 #endif