]> git.sesse.net Git - vlc/blobdiff - modules/codec/spudec/spudec.h
* src/video_output/vout_subpictures.c : New OSD channels
[vlc] / modules / codec / spudec / spudec.h
index 99d371ea7eebeffa41164a9ce57015d00cdbddff..6f68d2a0f96b484a85dfabe6a4e8a3afe620cda3 100644 (file)
@@ -2,7 +2,7 @@
  * spudec.h : sub picture unit decoder thread interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: spudec.h,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+struct decoder_sys_t
+{
+    int b_packetizer;
+
+    mtime_t i_pts;
+    int i_spu_size;
+    int i_rle_size;
+    int i_spu;
+
+    int i_subpic_channel;
+
+    block_t *p_block;
+
+    uint8_t buffer[65536 + 20 ]; /* we will never overflow more than 11 bytes if I'm right */
+
+    vout_thread_t *p_vout;
+};
+
 struct subpicture_sys_t
 {
     mtime_t i_pts;                                 /* presentation timestamp */
@@ -30,39 +48,17 @@ struct subpicture_sys_t
 
     /* Color information */
     vlc_bool_t b_palette;
-    u8    pi_alpha[4];
-    u8    pi_yuv[4][3];
-};
+    uint8_t    pi_alpha[4];
+    uint8_t    pi_yuv[4][3];
 
-/*****************************************************************************
- * spudec_thread_t : sub picture unit decoder thread descriptor
- *****************************************************************************/
-typedef 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
-     */
-    int                 i_spu_size;            /* size of current SPU packet */
-    int                 i_rle_size;                  /* size of the RLE part */
-
-} spudec_thread_t;
+    /* Link to our input */
+    vlc_object_t * p_input;
+
+    /* 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;
+};
 
 /*****************************************************************************
  * Amount of bytes we GetChunk() in one go
@@ -81,24 +77,10 @@ typedef struct spudec_thread_t
 #define SPU_CMD_SET_OFFSETS         0x06
 #define SPU_CMD_END                 0xff
 
-/*****************************************************************************
- * AddNibble: read a nibble from a source packet and add it to our integer.
- *****************************************************************************/
-static inline unsigned int AddNibble( unsigned int i_code,
-                                      u8 *p_src, int *pi_index )
-{
-    if( *pi_index & 0x1 )
-    {
-        return( i_code << 4 | ( p_src[(*pi_index)++ >> 1] & 0xf ) );
-    }
-    else
-    {
-        return( i_code << 4 | p_src[(*pi_index)++ >> 1] >> 4 );
-    }
-}
-
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-vlc_thread_t       spudec_CreateThread( decoder_fifo_t * p_fifo );
+void E_(ParsePacket)( decoder_t * );
+
+void E_(RenderSPU)  ( vout_thread_t *, picture_t *, const subpicture_t * );