]> git.sesse.net Git - vlc/blob - include/video_decoder.h
Encore un commit venu tout droit des abysses de l'enfer, d�sol� pour
[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 GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public
19  * License along with this program; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *****************************************************************************/
23  
24 /*****************************************************************************
25  * Requires:
26  *  "config.h"
27  *  "common.h"
28  *  "mtime.h"
29  *  "threads.h"
30  *  "input.h"
31  *  "video.h"
32  *  "video_output.h"
33  *  "decoder_fifo.h"
34  *****************************************************************************/
35
36 /*****************************************************************************
37  * vdec_thread_t: video decoder thread descriptor
38  *****************************************************************************
39  * XXX??
40  *****************************************************************************/
41 typedef struct vdec_thread_s
42 {
43     /* Thread properties and locks */
44     boolean_t           b_die;                                 /* `die' flag */
45     boolean_t           b_run;                                 /* `run' flag */
46     boolean_t           b_error;                             /* `error' flag */
47     boolean_t           b_active;                           /* `active' flag */
48     vlc_thread_t        thread_id;                /* id for thread functions */
49
50     /* Thread configuration */
51     /* XXX?? */
52 //    int *pi_status;
53
54 #ifdef OLD_DECODER
55     /* Input properties */
56     decoder_fifo_t      fifo;                              /* PES input fifo */
57
58     /* The bit stream structure handles the PES stream at the bit level */
59     bit_stream_t        bit_stream;
60
61     /* Output properties */
62     vout_thread_t *     p_vout;                       /* video output thread */
63     int                 i_stream;                         /* video stream id */
64 #else
65     /* idct iformations */
66     dctelem_t              p_pre_idct[64*64];
67
68     /* Input properties */
69     struct vpar_thread_s *    p_vpar;                 /* video_parser thread */
70
71     /* Lookup tables */
72 //#ifdef MPEG2_COMPLIANT
73     u8              pi_crop_buf[VDEC_CROPRANGE];
74     u8 *            pi_crop;
75 //#endif
76 #endif
77
78 #ifdef STATS
79     /* Statistics */
80     count_t         c_loops;                              /* number of loops */
81     count_t         c_idle_loops;                    /* number of idle loops */
82 #ifdef OLD_DECODER
83     count_t         c_pictures;                   /* number of pictures read */
84     count_t         c_i_pictures;               /* number of I pictures read */
85     count_t         c_p_pictures;               /* number of P pictures read */
86     count_t         c_b_pictures;               /* number of B pictures read */
87 #endif
88     count_t         c_decoded_pictures;        /* number of pictures decoded */
89     count_t         c_decoded_i_pictures;    /* number of I pictures decoded */
90     count_t         c_decoded_p_pictures;    /* number of P pictures decoded */
91     count_t         c_decoded_b_pictures;    /* number of B pictures decoded */
92 #endif
93 } vdec_thread_t;
94
95 /*****************************************************************************
96  * Prototypes
97  *****************************************************************************/
98 #ifndef OLD_DECODER
99 struct vpar_thread_s;
100 struct macroblock_s;
101 #endif
102
103 /* Thread management functions */
104 #ifdef OLD_DECODER
105 p_vdec_thread_t  vdec_CreateThread       ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
106                                           vout_thread_t *p_vout, int *pi_status */ );
107 void             vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
108 #else
109 #ifndef VDEC_SMP
110 int             vdec_InitThread         ( struct vdec_thread_s *p_vdec );
111 void            vdec_DecodeMacroblock   ( struct vdec_thread_s *p_vdec, struct macroblock_s *p_mb );
112 #endif
113 vdec_thread_t * vdec_CreateThread       ( struct vpar_thread_s *p_vpar /*, int *pi_status */ );
114 void vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
115 #endif