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