1 /*****************************************************************************
2 * video_decoder.h : video decoder thread
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
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.
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.
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 *****************************************************************************/
24 /*****************************************************************************
34 *****************************************************************************/
36 /*****************************************************************************
37 * vdec_thread_t: video decoder thread descriptor
38 *****************************************************************************
40 *****************************************************************************/
41 typedef struct vdec_thread_s
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 */
50 /* Thread configuration */
55 /* Input properties */
56 decoder_fifo_t fifo; /* PES input fifo */
58 /* The bit stream structure handles the PES stream at the bit level */
59 bit_stream_t bit_stream;
61 /* Output properties */
62 vout_thread_t * p_vout; /* video output thread */
63 int i_stream; /* video stream id */
65 /* idct iformations */
66 dctelem_t p_pre_idct[64*64];
68 /* Input properties */
69 struct vpar_thread_s * p_vpar; /* video_parser thread */
72 //#ifdef MPEG2_COMPLIANT
73 u8 pi_crop_buf[VDEC_CROPRANGE];
80 count_t c_loops; /* number of loops */
81 count_t c_idle_loops; /* number of idle loops */
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 */
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 */
95 /*****************************************************************************
97 *****************************************************************************/
103 /* Thread management functions */
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 */ );
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 );
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 */ );