]> git.sesse.net Git - vlc/blob - include/video_decoder.h
9fe26f5dd3fa8c29e1f82a775a4f3e2a3ee691ed
[vlc] / include / video_decoder.h
1 /*****************************************************************************
2  * video_decoder.h : video decoder thread
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  *
6  * Authors:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22  
23 /*****************************************************************************
24  * Requires:
25  *  "config.h"
26  *  "common.h"
27  *  "mtime.h"
28  *  "threads.h"
29  *  "input.h"
30  *  "video.h"
31  *  "video_output.h"
32  *  "decoder_fifo.h"
33  *****************************************************************************/
34
35 /*****************************************************************************
36  * vdec_thread_t: video decoder thread descriptor
37  *****************************************************************************
38  * XXX??
39  *****************************************************************************/
40 typedef struct vdec_thread_s
41 {
42     /* Thread properties and locks */
43     boolean_t           b_die;                                 /* `die' flag */
44     boolean_t           b_run;                                 /* `run' flag */
45     boolean_t           b_error;                             /* `error' flag */
46     boolean_t           b_active;                           /* `active' flag */
47     vlc_thread_t        thread_id;                /* id for thread functions */
48
49     /* Thread configuration */
50     /* XXX?? */
51 //    int *pi_status;
52
53 #ifdef OLD_DECODER
54     /* Input properties */
55     decoder_fifo_t      fifo;                              /* PES input fifo */
56
57     /* The bit stream structure handles the PES stream at the bit level */
58     bit_stream_t        bit_stream;
59
60     /* Output properties */
61     vout_thread_t *     p_vout;                       /* video output thread */
62     int                 i_stream;                         /* video stream id */
63 #else
64     /* idct iformations */
65     dctelem_t              p_pre_idct[64*64];
66
67     /* Input properties */
68     struct vpar_thread_s *    p_vpar;                 /* video_parser thread */
69
70     /* Lookup tables */
71 //#ifdef MPEG2_COMPLIANT
72     u8              pi_crop_buf[VDEC_CROPRANGE];
73     u8 *            pi_crop;
74 //#endif
75 #endif
76
77 #ifdef STATS
78     /* Statistics */
79     count_t         c_loops;                              /* number of loops */
80     count_t         c_idle_loops;                    /* number of idle loops */
81 #ifdef OLD_DECODER
82     count_t         c_pictures;                   /* number of pictures read */
83     count_t         c_i_pictures;               /* number of I pictures read */
84     count_t         c_p_pictures;               /* number of P pictures read */
85     count_t         c_b_pictures;               /* number of B pictures read */
86 #endif
87     count_t         c_decoded_pictures;        /* number of pictures decoded */
88     count_t         c_decoded_i_pictures;    /* number of I pictures decoded */
89     count_t         c_decoded_p_pictures;    /* number of P pictures decoded */
90     count_t         c_decoded_b_pictures;    /* number of B pictures decoded */
91 #endif
92 } vdec_thread_t;
93
94 /*****************************************************************************
95  * Prototypes
96  *****************************************************************************/
97 #ifndef OLD_DECODER
98 struct vpar_thread_s;
99 struct macroblock_s;
100 #endif
101
102 /* Thread management functions */
103 #ifdef OLD_DECODER
104 p_vdec_thread_t  vdec_CreateThread       ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
105                                           vout_thread_t *p_vout, int *pi_status */ );
106 void             vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
107 #else
108 #ifndef VDEC_SMP
109 int             vdec_InitThread         ( struct vdec_thread_s *p_vdec );
110 void            vdec_DecodeMacroblock   ( struct vdec_thread_s *p_vdec, struct macroblock_s *p_mb );
111 #endif
112 vdec_thread_t * vdec_CreateThread       ( struct vpar_thread_s *p_vpar /*, int *pi_status */ );
113 void vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
114 #endif