X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fspudec%2Fspudec.h;h=da5789e1aab6a2e2df64c0f42314648ef343a37f;hb=88b1d54a0d3eb0b66aac5b1eb24867bc355d54e1;hp=2c6305e7c577c7e9169c18deab3d7c2b50d4f49c;hpb=14b3f0cfa16fa0147dafd44b64bf94403a0095fb;p=vlc diff --git a/modules/codec/spudec/spudec.h b/modules/codec/spudec/spudec.h index 2c6305e7c5..da5789e1aa 100644 --- a/modules/codec/spudec/spudec.h +++ b/modules/codec/spudec/spudec.h @@ -1,11 +1,10 @@ - /***************************************************************************** * spudec.h : sub picture unit decoder thread interface ***************************************************************************** - * Copyright (C) 1999, 2000 VideoLAN - * $Id: spudec.h,v 1.6 2003/07/14 21:32:58 sigmunau Exp $ + * Copyright (C) 1999, 2000, 2006 the VideoLAN team + * $Id$ * - * Authors: Samuel Hocevar + * Authors: Sam Hocevar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,17 +18,27 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#if defined(HAVE_ICONV) -#include -#endif +/* #define DEBUG_SPUDEC 1 */ + +struct decoder_sys_t +{ + int b_packetizer; + + mtime_t i_pts; + unsigned int i_spu_size; + unsigned int i_rle_size; + unsigned int i_spu; + block_t *p_block; -typedef struct spudec_thread_t spudec_thread_t; + /* We will never overflow */ + uint8_t buffer[65536]; +}; -struct subpicture_sys_t +typedef struct subpicture_data_t { mtime_t i_pts; /* presentation timestamp */ @@ -37,62 +46,16 @@ struct subpicture_sys_t void *p_data; /* Color information */ - vlc_bool_t b_palette; + bool b_palette; uint8_t pi_alpha[4]; uint8_t pi_yuv[4][3]; - /* Link to our input */ - vlc_object_t * p_input; + /* Auto crop fullscreen subtitles */ + bool b_auto_crop; + int i_y_top_offset; + int i_y_bottom_offset; - /* Cropping properties */ - vlc_mutex_t lock; - vlc_bool_t b_crop; - unsigned int i_x_start, i_y_start, i_x_end, i_y_end; -}; - -/***************************************************************************** - * subtitler_font_t : proportional font - *****************************************************************************/ -typedef struct subtitler_font_s -{ - unsigned int i_height; /* character height in pixels */ - unsigned int i_width[256]; /* character widths in pixels */ - unsigned int i_memory[256]; /* amount of memory used by character */ - unsigned int * p_length[256]; /* line byte widths */ - uint16_t ** p_offset[256]; /* pointer to RLE data */ -} subtitler_font_t; - -/***************************************************************************** - * spudec_thread_t : sub picture unit decoder thread descriptor - *****************************************************************************/ -struct spudec_thread_t -{ - /* - * Thread properties and locks - */ - vlc_thread_t thread_id; /* id for thread functions */ - - /* - * Input properties - */ - decoder_fifo_t * p_fifo; /* stores the PES stream data */ - /* The bit stream structure handles the PES stream at the bit level */ - bit_stream_t bit_stream; - - /* - * Output properties - */ - vout_thread_t * p_vout; /* needed to create the spu objects */ - - /* - * Private properties - */ - unsigned int i_spu_size; /* size of current SPU packet */ - unsigned int i_rle_size; /* size of the RLE part */ -#if defined(HAVE_ICONV) - iconv_t iconv_handle; /* handle to iconv instance */ -#endif -}; +} subpicture_data_t; /***************************************************************************** * Amount of bytes we GetChunk() in one go @@ -114,15 +77,4 @@ struct spudec_thread_t /***************************************************************************** * Prototypes *****************************************************************************/ -int E_(SyncPacket) ( spudec_thread_t * ); -void E_(ParsePacket) ( spudec_thread_t * ); - -void E_(RenderSPU) ( vout_thread_t *, picture_t *, - const subpicture_t * ); - -void E_(ParseText) ( spudec_thread_t *, subtitler_font_t * ); - -subtitler_font_t *E_(subtitler_LoadFont) ( vout_thread_t *, const char * ); -void E_(subtitler_UnloadFont) ( vout_thread_t *, subtitler_font_t * ); -void E_(subtitler_PlotSubtitle) ( vout_thread_t *, char *, subtitler_font_t *, - mtime_t, mtime_t ); +subpicture_t * ParsePacket( decoder_t * );