]> git.sesse.net Git - vlc/blob - src/spu_decoder/spu_decoder.h
1611bd10933f5e270bf8504b255d75241dea7671
[vlc] / src / spu_decoder / spu_decoder.h
1 /*****************************************************************************
2  * spu_decoder.h : sub picture unit decoder thread interface
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  * $Id: spu_decoder.h,v 1.10 2001/05/11 15:10:01 sam 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 /*****************************************************************************
25  * spudec_thread_t : sub picture unit decoder thread descriptor
26  *****************************************************************************/
27 typedef struct spudec_thread_s
28 {
29     /*
30      * Thread properties and locks
31      */
32     vlc_thread_t        thread_id;                /* id for thread functions */
33
34     /*
35      * Input properties
36      */
37     decoder_fifo_t *    p_fifo;                /* stores the PES stream data */
38     /* The bit stream structure handles the PES stream at the bit level */
39     bit_stream_t        bit_stream;
40     vdec_config_t *     p_config;
41
42     /*
43      * Output properties
44      */
45     vout_thread_t *     p_vout;          /* needed to create the spu objects */
46
47     /*
48      * Private properties
49      */
50     mtime_t             i_pts;                     /* presentation timestamp */
51
52  //   subpicture_t *      p_spu;
53     int                 i_spu_size;            /* size of current SPU packet */
54     int                 i_rle_size;                  /* size of the RLE part */
55
56 } spudec_thread_t;
57
58 /*****************************************************************************
59  * Amount of bytes we GetChunk() in one go
60  *****************************************************************************/
61 #define SPU_CHUNK_SIZE              0x200
62
63 /*****************************************************************************
64  * SPU commands
65  *****************************************************************************/
66 #define SPU_CMD_FORCE_DISPLAY       0x00
67 #define SPU_CMD_START_DISPLAY       0x01
68 #define SPU_CMD_STOP_DISPLAY        0x02
69 #define SPU_CMD_SET_PALETTE         0x03
70 #define SPU_CMD_SET_ALPHACHANNEL    0x04
71 #define SPU_CMD_SET_COORDINATES     0x05
72 #define SPU_CMD_SET_OFFSETS         0x06
73 #define SPU_CMD_END                 0xff
74
75 /*****************************************************************************
76  * AddNibble: read a nibble from a source packet and add it to our integer.
77  *****************************************************************************/
78 static __inline__ unsigned int AddNibble( unsigned int i_code,
79                                           u8 *p_src, int *pi_index )
80 {
81     if( *pi_index & 0x1 )
82     {
83         return( i_code << 4 | ( p_src[(*pi_index)++ >> 1] & 0xf ) );
84     }
85     else
86     {
87         return( i_code << 4 | p_src[(*pi_index)++ >> 1] >> 4 );
88     }
89 }
90
91 /*****************************************************************************
92  * Prototypes
93  *****************************************************************************/
94 vlc_thread_t       spudec_CreateThread( vdec_config_t * p_config );
95