]> git.sesse.net Git - vlc/blob - include/vlc_codec.h
* modules/codec/ffmpeg/*: ported the ffmpeg audio and video decoders to the new api.
[vlc] / include / vlc_codec.h
1 /*****************************************************************************
2  * vlc_codec.h: codec related structures
3  *****************************************************************************
4  * Copyright (C) 1999-2003 VideoLAN
5  * $Id: vlc_codec.h,v 1.2 2003/10/27 01:04:38 gbazin Exp $
6  *
7  * Authors: Gildas Bazin <gbazin@netcourrier.com>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23 #ifndef _VLC_CODEC_H
24 #define _VLC_CODEC_H 1
25
26 /**
27  * \file
28  * This file defines the structure and types used by decoders and encoders
29  */
30
31 /**
32  * \defgroup decoder Decoder
33  *
34  * The structure describing a decoder
35  *
36  * @{
37  */
38
39 struct decoder_t
40 {
41     VLC_COMMON_MEMBERS
42
43     /* Module properties */
44     module_t *          p_module;
45     decoder_sys_t *     p_sys;
46     int                 ( * pf_init )  ( decoder_t * );
47     int                 ( * pf_decode )( decoder_t *, block_t * );
48     int                 ( * pf_end )   ( decoder_t * );
49
50     /* Input properties */
51     decoder_fifo_t *    p_fifo;                /* stores the PES stream data */
52
53     /* Tmp field for old decoder api */
54     int                 ( * pf_run ) ( decoder_fifo_t * );
55 };
56
57 /**
58  * @}
59  */
60
61 /**
62  * \defgroup decoder Encoder
63  *
64  * The structure describing a Encoder
65  *
66  * @{
67  */
68
69 struct encoder_t
70 {
71     VLC_COMMON_MEMBERS
72
73     /* Module properties */
74     module_t *          p_module;
75     encoder_sys_t *     p_sys;
76
77     block_t *           ( * pf_header )( encoder_t * );
78     block_t *           ( * pf_encode_video )( encoder_t *, picture_t * );
79     block_t *           ( * pf_encode_audio )( encoder_t *, aout_buffer_t * );
80
81     /* Properties of the input data fed to the encoder */
82     union {
83         audio_sample_format_t audio;
84         video_frame_format_t  video;
85     } format;
86
87     /* Properties of the output of the encoder */
88     vlc_fourcc_t i_fourcc;
89     int          i_bitrate;
90
91     int          i_extra_data;
92     uint8_t      *p_extra_data;
93
94     /* FIXME: move these to the ffmpeg encoder */
95     int i_frame_rate;
96     int i_frame_rate_base;
97     int i_key_int;
98     int i_b_frames;
99     int i_vtolerance;
100     int i_qmin;
101     int i_qmax;
102     int i_hq;
103
104 };
105
106 /**
107  * @}
108  */
109
110 #endif /* _VLC_CODEC_H */