]> git.sesse.net Git - vlc/blob - include/generic_decoder.h
* vpar_blocks.c : Correction d'une erreur introduite hier soir avec
[vlc] / include / generic_decoder.h
1 /*******************************************************************************
2  * generic_decoder.h : generic decoder thread
3  * (c)1999 VideoLAN
4  *******************************************************************************
5  * Requires:
6  *  "config.h"
7  *  "common.h"
8  *  "mtime.h"
9  *  "vlc_thread.h"
10  *  "input.h"
11  *  "decoder_fifo.h"
12  * ??
13  *******************************************************************************/
14
15 /*******************************************************************************
16  * gdec_cfg_t: generic decoder configuration structure
17  *******************************************************************************
18  * This structure is passed as an initializer when a generic decoder thread is
19  * created.
20  *******************************************************************************/
21 typedef struct gdec_cfg_s
22 {
23     u64         i_properties;
24
25     int         i_actions;                                  /* decoder actions */
26     char *      psz_base_filename;                     /* base demux file name */
27 } gdec_cfg_t;
28
29 /* Properties flags */
30 #define GDEC_CFG_ACTIONS    (1 << 0)
31 #define GDEC_CFG_FILENAME   (1 << 1)
32
33 /*******************************************************************************
34  * gdec_thread_t: generic decoder thread descriptor
35  *******************************************************************************
36  * This type describes a generic decoder thread.
37  *******************************************************************************/
38 typedef struct gdec_thread_s
39 {
40     /* Thread properties and locks */
41     boolean_t           b_die;                                   /* `die' flag */
42     boolean_t           b_error;                               /* `error' flag */
43     boolean_t           b_active;                             /* `active' flag */
44     vlc_thread_t        thread_id;                  /* id for thread functions */
45
46     /* Thread configuration */
47     int                 i_actions;                          /* decoder actions */
48     
49     /* Input properties */
50     input_thread_t *    p_input;                               /* input thread */
51     decoder_fifo_t      fifo;                                /* PES input fifo */
52
53     /* ?? status info */
54     int *               pi_status;
55     
56
57     /* Files array - these files are used to extract ES streams from a 
58      * demultiplexed stream */
59     /* ?? */
60
61 #ifdef STATS
62     /* Statistics */
63     count_t         c_loops;                               /* number of loops */
64     count_t         c_idle_loops;                     /* number of idle loops */
65     count_t         c_pes;                      /* number of PES packets read */
66 #endif
67 } gdec_thread_t;
68
69 /* Decoder actions - this flags select which actions the decoder will perform
70  * when it receives a PES packet */
71 #define GDEC_IDENTIFY   (1 << 0)                   /* update input's ES tables */
72 #define GDEC_SAVE       (1 << 1)                /* save all PES to a same file */
73 #define GDEC_SAVE_DEMUX (1 << 2)             /* save PES to files by stream id */
74 #define GDEC_PRINT      (1 << 3)                     /* print PES informations */
75
76 /*******************************************************************************
77  * Prototypes
78  *******************************************************************************/
79
80 /* Thread management functions */
81 gdec_thread_t * gdec_CreateThread       ( gdec_cfg_t *p_cfg, 
82                                           input_thread_t *p_input, int *pi_status );
83 void            gdec_DestroyThread      ( gdec_thread_t *p_gdec, int *pi_status );
84
85 /* Time management functions */
86 /* ?? */
87
88 /* Dynamic thread settings */
89 /* ?? */