]> git.sesse.net Git - vlc/blob - modules/codec/spudec/spudec.h
5d59b52f56f2a5a711f420699b978ea9c7afad26
[vlc] / modules / codec / spudec / spudec.h
1 /*****************************************************************************
2  * spudec.h : sub picture unit decoder thread interface
3  *****************************************************************************
4  * Copyright (C) 1999, 2000, 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Sam Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /* #define DEBUG_SPUDEC 1 */
25
26 struct decoder_sys_t
27 {
28     int b_packetizer;
29
30     mtime_t i_pts;
31     unsigned int i_spu_size;
32     unsigned int i_rle_size;
33     unsigned int i_spu;
34
35     block_t *p_block;
36
37     /* We will never overflow */
38     uint8_t buffer[65536];
39 };
40
41 typedef struct subpicture_data_t
42 {
43     mtime_t i_pts;                                 /* presentation timestamp */
44
45     int   pi_offset[2];                              /* byte offsets to data */
46     void *p_data;
47
48     /* Color information */
49     vlc_bool_t b_palette;
50     uint8_t    pi_alpha[4];
51     uint8_t    pi_yuv[4][3];
52
53     /* Auto crop fullscreen subtitles */
54     vlc_bool_t b_auto_crop;
55     int i_y_top_offset;
56     int i_y_bottom_offset;
57
58 } subpicture_data_t;
59
60 /*****************************************************************************
61  * Amount of bytes we GetChunk() in one go
62  *****************************************************************************/
63 #define SPU_CHUNK_SIZE              0x200
64
65 /*****************************************************************************
66  * SPU commands
67  *****************************************************************************/
68 #define SPU_CMD_FORCE_DISPLAY       0x00
69 #define SPU_CMD_START_DISPLAY       0x01
70 #define SPU_CMD_STOP_DISPLAY        0x02
71 #define SPU_CMD_SET_PALETTE         0x03
72 #define SPU_CMD_SET_ALPHACHANNEL    0x04
73 #define SPU_CMD_SET_COORDINATES     0x05
74 #define SPU_CMD_SET_OFFSETS         0x06
75 #define SPU_CMD_END                 0xff
76
77 /*****************************************************************************
78  * Prototypes
79  *****************************************************************************/
80 subpicture_t * E_(ParsePacket)( decoder_t * );