]> git.sesse.net Git - vlc/blob - include/video_decoder.h
326699243de7a46b5ed72145bc58d8a6add24a28
[vlc] / include / video_decoder.h
1 /*****************************************************************************
2  * video_decoder.h : video decoder thread
3  * (c)1999 VideoLAN
4  *****************************************************************************
5  *****************************************************************************
6  * Requires:
7  *  "config.h"
8  *  "common.h"
9  *  "mtime.h"
10  *  "vlc_thread.h"
11  *  "input.h"
12  *  "video.h"
13  *  "video_output.h"
14  *  "decoder_fifo.h"
15  *****************************************************************************/
16
17 /*****************************************************************************
18  * vdec_thread_t: video decoder thread descriptor
19  *****************************************************************************
20  * XXX??
21  *****************************************************************************/
22 typedef struct vdec_thread_s
23 {
24     /* Thread properties and locks */
25     boolean_t           b_die;                                 /* `die' flag */
26     boolean_t           b_run;                                 /* `run' flag */
27     boolean_t           b_error;                             /* `error' flag */
28     boolean_t           b_active;                           /* `active' flag */
29     vlc_thread_t        thread_id;                /* id for thread functions */
30
31     /* Thread configuration */
32     /* XXX?? */
33 //    int *pi_status;
34
35 #ifdef OLD_DECODER
36     /* Input properties */
37     decoder_fifo_t      fifo;                              /* PES input fifo */
38
39     /* The bit stream structure handles the PES stream at the bit level */
40     bit_stream_t        bit_stream;
41
42     /* Output properties */
43     vout_thread_t *     p_vout;                       /* video output thread */
44     int                 i_stream;                         /* video stream id */
45 #else
46     /* idct iformations */
47     dctelem_t              p_pre_idct[64*64];
48
49     /* Input properties */
50     struct vpar_thread_s *    p_vpar;                 /* video_parser thread */
51
52     /* Lookup tables */
53 //#ifdef MPEG2_COMPLIANT
54     u8              pi_crop_buf[VDEC_CROPRANGE];
55     u8 *            pi_crop;
56 //#endif
57 #endif
58
59 #ifdef STATS
60     /* Statistics */
61     count_t         c_loops;                              /* number of loops */
62     count_t         c_idle_loops;                    /* number of idle loops */
63 #ifdef OLD_DECODER
64     count_t         c_pictures;                   /* number of pictures read */
65     count_t         c_i_pictures;               /* number of I pictures read */
66     count_t         c_p_pictures;               /* number of P pictures read */
67     count_t         c_b_pictures;               /* number of B pictures read */
68 #endif
69     count_t         c_decoded_pictures;        /* number of pictures decoded */
70     count_t         c_decoded_i_pictures;    /* number of I pictures decoded */
71     count_t         c_decoded_p_pictures;    /* number of P pictures decoded */
72     count_t         c_decoded_b_pictures;    /* number of B pictures decoded */
73 #endif
74 } vdec_thread_t;
75
76 /*****************************************************************************
77  * Prototypes
78  *****************************************************************************/
79 #ifndef OLD_DECODER
80 struct vpar_thread_s;
81 struct macroblock_s;
82 #endif
83
84 /* Thread management functions */
85 #ifdef OLD_DECODER
86 p_vdec_thread_t  vdec_CreateThread       ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
87                                           vout_thread_t *p_vout, int *pi_status */ );
88 void             vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
89 #else
90 #ifndef VDEC_SMP
91 int             vdec_InitThread         ( struct vdec_thread_s *p_vdec );
92 void            vdec_DecodeMacroblock   ( struct vdec_thread_s *p_vdec, struct macroblock_s *p_mb );
93 #endif
94 vdec_thread_t * vdec_CreateThread       ( struct vpar_thread_s *p_vpar /*, int *pi_status */ );
95 void vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
96 #endif