1 /*****************************************************************************
2 * generic_decoder.h : generic decoder thread
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
6 * Authors: Vincent Seguin <seguin@via.ecp.fr>
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
16 * GNU General Public License for more details.
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 *****************************************************************************
23 /*****************************************************************************
32 *****************************************************************************/
34 /*****************************************************************************
35 * gdec_cfg_t: generic decoder configuration structure
36 *****************************************************************************
37 * This structure is passed as an initializer when a generic decoder thread is
39 *****************************************************************************/
40 typedef struct gdec_cfg_s
44 int i_actions; /* decoder actions */
45 char * psz_base_filename; /* base demux file name */
48 /* Properties flags */
49 #define GDEC_CFG_ACTIONS (1 << 0)
50 #define GDEC_CFG_FILENAME (1 << 1)
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
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 */
65 /* Thread configuration */
66 int i_actions; /* decoder actions */
68 /* Input properties */
69 input_thread_t * p_input; /* input thread */
70 decoder_fifo_t fifo; /* PES input fifo */
72 /* XXX?? status info */
76 /* Files array - these files are used to extract ES streams from a
77 * demultiplexed stream */
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 */
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 */
95 /*****************************************************************************
97 *****************************************************************************/
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 );
104 /* Time management functions */
107 /* Dynamic thread settings */