]> git.sesse.net Git - vlc/blob - include/video_parser.h
D�but du d�codeur + d�but du parseur.
[vlc] / include / video_parser.h
1 /*******************************************************************************
2  * video_parser.h : video parser 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  *  "video_fifo.h"
16  *******************************************************************************/
17
18 /*******************************************************************************
19  * sequence_t : sequence descriptor
20  *******************************************************************************
21  * ??
22  *******************************************************************************/
23 typedef struct sequence_s
24 {
25     u32                 i_height, i_width;
26     unsigned int        i_aspect_ratio;
27     double              frame_rate;
28 } sequence_t;
29
30 /*******************************************************************************
31  * vpar_thread_t: video parser thread descriptor
32  *******************************************************************************
33  * ??
34  *******************************************************************************/
35 typedef struct vpar_thread_s
36 {
37     /* Thread properties and locks */
38     boolean_t           b_die;                                   /* `die' flag */
39     boolean_t           b_run;                                   /* `run' flag */
40     boolean_t           b_error;                               /* `error' flag */
41     boolean_t           b_active;                             /* `active' flag */
42     vlc_thread_t        thread_id;                  /* id for thread functions */
43
44     /* Thread configuration */
45     /* ?? */
46  /*??*/
47 //    int *pi_status;
48     
49
50     /* Input properties */
51     decoder_fifo_t      fifo;                                /* PES input fifo */
52
53     /* The bit stream structure handles the PES stream at the bit level */
54     bit_stream_t        bit_stream;
55
56     /* Output properties */
57     vout_thread_t *     p_vout;                         /* video output thread */
58     int                 i_stream;                           /* video stream id */
59     
60     /* Decoder properties */
61     struct vdec_thread_s *      p_vdec[MAX_VDEC];
62     video_fifo_t                vfifo;
63     video_buffer_t              vbuffer;
64
65     /* Parser properties */
66     sequence_t          sequence;
67
68 #ifdef STATS
69     /* Statistics */
70     count_t         c_loops;                               /* number of loops */
71     count_t         c_idle_loops;                     /* number of idle loops */
72     count_t         c_sequences;                       /* number of sequences */
73     count_t         c_pictures;                    /* number of pictures read */
74     count_t         c_i_pictures;                /* number of I pictures read */
75     count_t         c_p_pictures;                /* number of P pictures read */
76     count_t         c_b_pictures;                /* number of B pictures read */    
77     count_t         c_decoded_pictures;         /* number of pictures decoded */
78     count_t         c_decoded_i_pictures;     /* number of I pictures decoded */
79     count_t         c_decoded_p_pictures;     /* number of P pictures decoded */
80     count_t         c_decoded_b_pictures;     /* number of B pictures decoded */
81 #endif
82 } vpar_thread_t;
83
84 /*******************************************************************************
85  * Standard start codes
86  *******************************************************************************/
87 #define PICTURE_START_CODE      0x100
88 #define SLICE_START_CODE_MIN    0x101
89 #define SLICE_START_CODE_MAX    0x1AF
90 #define USER_DATA_START_CODE    0x1B2
91 #define SEQUENCE_HEADER_CODE    0x1B3
92 #define SEQUENCE_ERROR_CODE     0x1B4
93 #define EXTENSION_START_CODE    0x1B5
94 #define SEQUENCE_END_CODE       0x1B7
95 #define GROUP_START_CODE        0x1B8
96
97 /*******************************************************************************
98  * Prototypes
99  *******************************************************************************/
100
101 /* Thread management functions */
102 vpar_thread_t * vpar_CreateThread       ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
103                                           vout_thread_t *p_vout, int *pi_status */ );
104 void            vpar_DestroyThread      ( vpar_thread_t *p_vpar /*, int *pi_status */ );
105
106 /* Time management functions */
107 /* ?? */
108
109 /* Dynamic thread settings */
110 /* ?? */