]> git.sesse.net Git - vlc/blob - modules/codec/subsdec.h
Use var_Inherit* instead of var_CreateGet*.
[vlc] / modules / codec / 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_common.h>
31 #include <vlc_codec.h>
32 #include <vlc_input.h>
33
34 #include <vlc_filter.h>
35 #include <vlc_image.h>
36 #include <vlc_charset.h>
37 #include <vlc_stream.h>
38 #include <vlc_xml.h>
39 #include <string.h>
40
41
42 #define DEFAULT_NAME "Default"
43 #define MAX_LINE 8192
44 #define NO_BREAKING_SPACE  "&#160;"
45
46 enum
47 {
48     ATTRIBUTE_ALIGNMENT = (1 << 0),
49     ATTRIBUTE_X         = (1 << 1),
50     ATTRIBUTE_X_PERCENT = (1 << 2),
51     ATTRIBUTE_Y         = (1 << 3),
52     ATTRIBUTE_Y_PERCENT = (1 << 4),
53 };
54
55 typedef struct
56 {
57     char       *psz_filename;
58     picture_t  *p_pic;
59 } image_attach_t;
60
61 typedef struct
62 {
63     char *          psz_stylename; /* The name of the style, no comma's allowed */
64     text_style_t    font_style;
65     int             i_align;
66     int             i_margin_h;
67     int             i_margin_v;
68     int             i_margin_percent_h;
69     int             i_margin_percent_v;
70 }  ssa_style_t;
71
72 /*****************************************************************************
73  * decoder_sys_t : decoder descriptor
74  *****************************************************************************/
75 struct decoder_sys_t
76 {
77     bool                b_ass;                           /* The subs are ASS */
78
79     int                 i_original_height;
80     int                 i_original_width;
81     int                 i_align;          /* Subtitles alignment on the vout */
82
83     vlc_iconv_t         iconv_handle;            /* handle to iconv instance */
84     bool                b_autodetect_utf8;
85
86     ssa_style_t         **pp_ssa_styles;
87     int                 i_ssa_styles;
88
89     image_attach_t      **pp_images;
90     int                 i_images;
91 };
92
93
94 char                *GotoNextLine( char *psz_text );
95
96 void                ParseSSAHeader ( decoder_t * );
97 void                ParseSSAString ( decoder_t *, char *, subpicture_t * );
98
99 #endif