]> git.sesse.net Git - vlc/blob - modules/codec/spudec/spudec.h
* all: ported to new API.
[vlc] / modules / codec / spudec / spudec.h
1 /*****************************************************************************
2  * spudec.h : sub picture unit decoder thread interface
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  * $Id: spudec.h,v 1.8 2003/11/22 19:55:47 fenrir Exp $
6  *
7  * Authors: Samuel 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 struct decoder_sys_t
25 {
26     int b_packetizer;
27
28     mtime_t i_pts;
29     int i_spu_size;
30     int i_rle_size;
31     int i_spu;
32
33     block_t *p_block;
34
35     uint8_t buffer[65536 + 20 ]; /* we will never overflow more than 11 bytes if I'm right */
36
37     vout_thread_t *p_vout;
38 };
39
40 struct subpicture_sys_t
41 {
42     mtime_t i_pts;                                 /* presentation timestamp */
43
44     int   pi_offset[2];                              /* byte offsets to data */
45     void *p_data;
46
47     /* Color information */
48     vlc_bool_t b_palette;
49     uint8_t    pi_alpha[4];
50     uint8_t    pi_yuv[4][3];
51
52     /* Link to our input */
53     vlc_object_t * p_input;
54
55     /* Cropping properties */
56     vlc_mutex_t  lock;
57     vlc_bool_t   b_crop;
58     unsigned int i_x_start, i_y_start, i_x_end, i_y_end;
59 };
60
61 /*****************************************************************************
62  * Amount of bytes we GetChunk() in one go
63  *****************************************************************************/
64 #define SPU_CHUNK_SIZE              0x200
65
66 /*****************************************************************************
67  * SPU commands
68  *****************************************************************************/
69 #define SPU_CMD_FORCE_DISPLAY       0x00
70 #define SPU_CMD_START_DISPLAY       0x01
71 #define SPU_CMD_STOP_DISPLAY        0x02
72 #define SPU_CMD_SET_PALETTE         0x03
73 #define SPU_CMD_SET_ALPHACHANNEL    0x04
74 #define SPU_CMD_SET_COORDINATES     0x05
75 #define SPU_CMD_SET_OFFSETS         0x06
76 #define SPU_CMD_END                 0xff
77
78 /*****************************************************************************
79  * Prototypes
80  *****************************************************************************/
81 void E_(ParsePacket)( decoder_t * );
82
83 void E_(RenderSPU)  ( vout_thread_t *, picture_t *, const subpicture_t * );
84