spudec.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * spudec.h : sub picture unit decoder thread interface
00003  *****************************************************************************
00004  * Copyright (C) 1999, 2000, 2006 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Sam Hocevar <sam@zoy.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 /* #define DEBUG_SPUDEC 1 */
00025 
00026 struct decoder_sys_t
00027 {
00028     int b_packetizer;
00029 
00030     mtime_t i_pts;
00031     unsigned int i_spu_size;
00032     unsigned int i_rle_size;
00033     unsigned int i_spu;
00034 
00035     block_t *p_block;
00036 
00037     /* We will never overflow */
00038     uint8_t buffer[65536];
00039 };
00040 
00041 typedef struct subpicture_data_t
00042 {
00043     mtime_t i_pts;                                 /* presentation timestamp */
00044 
00045     int   pi_offset[2];                              /* byte offsets to data */
00046     void *p_data;
00047 
00048     /* Color information */
00049     bool b_palette;
00050     uint8_t    pi_alpha[4];
00051     uint8_t    pi_yuv[4][3];
00052 
00053     /* Auto crop fullscreen subtitles */
00054     bool b_auto_crop;
00055     int i_y_top_offset;
00056     int i_y_bottom_offset;
00057 
00058 } subpicture_data_t;
00059 
00060 /*****************************************************************************
00061  * Amount of bytes we GetChunk() in one go
00062  *****************************************************************************/
00063 #define SPU_CHUNK_SIZE              0x200
00064 
00065 /*****************************************************************************
00066  * SPU commands
00067  *****************************************************************************/
00068 #define SPU_CMD_FORCE_DISPLAY       0x00
00069 #define SPU_CMD_START_DISPLAY       0x01
00070 #define SPU_CMD_STOP_DISPLAY        0x02
00071 #define SPU_CMD_SET_PALETTE         0x03
00072 #define SPU_CMD_SET_ALPHACHANNEL    0x04
00073 #define SPU_CMD_SET_COORDINATES     0x05
00074 #define SPU_CMD_SET_OFFSETS         0x06
00075 #define SPU_CMD_END                 0xff
00076 
00077 /*****************************************************************************
00078  * Prototypes
00079  *****************************************************************************/
00080 subpicture_t * ParsePacket( decoder_t * );

Generated on Wed Aug 13 08:02:37 2008 for VLC by  doxygen 1.5.1