1 /*****************************************************************************
2 * generic_decoder.h : generic decoder thread
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: generic_decoder.h,v 1.6 2001/03/21 13:42:34 sam Exp $
7 * Authors: Vincent Seguin <seguin@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************
24 /*****************************************************************************
33 *****************************************************************************/
35 /*****************************************************************************
36 * gdec_cfg_t: generic decoder configuration structure
37 *****************************************************************************
38 * This structure is passed as an initializer when a generic decoder thread is
40 *****************************************************************************/
41 typedef struct gdec_cfg_s
45 int i_actions; /* decoder actions */
46 char * psz_base_filename; /* base demux file name */
49 /* Properties flags */
50 #define GDEC_CFG_ACTIONS (1 << 0)
51 #define GDEC_CFG_FILENAME (1 << 1)
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
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 */
66 /* Thread configuration */
67 int i_actions; /* decoder actions */
69 /* Input properties */
70 input_thread_t * p_input; /* input thread */
71 decoder_fifo_t fifo; /* PES input fifo */
73 /* XXX?? status info */
77 /* Files array - these files are used to extract ES streams from a
78 * demultiplexed stream */
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 */
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 */
96 /*****************************************************************************
98 *****************************************************************************/
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 );
105 /* Time management functions */
108 /* Dynamic thread settings */