]> git.sesse.net Git - vlc/blob - src/generic_decoder/generic_decoder.h
777af9a5479ad95640084f5e16bc7da18786eb08
[vlc] / src / generic_decoder / generic_decoder.h
1 /*****************************************************************************
2  * generic_decoder.h : generic decoder thread
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  *
6  * Authors: Vincent Seguin <seguin@via.ecp.fr>
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  *  "decoder_fifo.h"
31  * XXX??
32  *****************************************************************************/
33
34 /*****************************************************************************
35  * gdec_cfg_t: generic decoder configuration structure
36  *****************************************************************************
37  * This structure is passed as an initializer when a generic decoder thread is
38  * created.
39  *****************************************************************************/
40 typedef struct gdec_cfg_s
41 {
42     u64         i_properties;
43
44     int         i_actions;                                /* decoder actions */
45     char *      psz_base_filename;                   /* base demux file name */
46 } gdec_cfg_t;
47
48 /* Properties flags */
49 #define GDEC_CFG_ACTIONS    (1 << 0)
50 #define GDEC_CFG_FILENAME   (1 << 1)
51
52 /*****************************************************************************
53  * gdec_thread_t: generic decoder thread descriptor
54  *****************************************************************************
55  * This type describes a generic decoder thread.
56  *****************************************************************************/
57 typedef struct gdec_thread_s
58 {
59     /* Thread properties and locks */
60     boolean_t           b_die;                                 /* `die' flag */
61     boolean_t           b_error;                             /* `error' flag */
62     boolean_t           b_active;                           /* `active' flag */
63     vlc_thread_t        thread_id;                /* id for thread functions */
64
65     /* Thread configuration */
66     int                 i_actions;                        /* decoder actions */
67
68     /* Input properties */
69     input_thread_t *    p_input;                             /* input thread */
70     decoder_fifo_t      fifo;                              /* PES input fifo */
71
72     /* XXX?? status info */
73     int *               pi_status;
74
75
76     /* Files array - these files are used to extract ES streams from a
77      * demultiplexed stream */
78     /* XXX?? */
79
80 #ifdef STATS
81     /* Statistics */
82     count_t         c_loops;                              /* number of loops */
83     count_t         c_idle_loops;                    /* number of idle loops */
84     count_t         c_pes;                     /* number of PES packets read */
85 #endif
86 } gdec_thread_t;
87
88 /* Decoder actions - this flags select which actions the decoder will perform
89  * when it receives a PES packet */
90 #define GDEC_IDENTIFY   (1 << 0)                 /* update input's ES tables */
91 #define GDEC_SAVE       (1 << 1)              /* save all PES to a same file */
92 #define GDEC_SAVE_DEMUX (1 << 2)           /* save PES to files by stream id */
93 #define GDEC_PRINT      (1 << 3)                   /* print PES informations */
94
95 /*****************************************************************************
96  * Prototypes
97  *****************************************************************************/
98
99 /* Thread management functions */
100 gdec_thread_t * gdec_CreateThread       ( gdec_cfg_t *p_cfg,
101                                           input_thread_t *p_input, int *pi_status );
102 void            gdec_DestroyThread      ( gdec_thread_t *p_gdec, int *pi_status );
103
104 /* Time management functions */
105 /* XXX?? */
106
107 /* Dynamic thread settings */
108 /* XXX?? */