]> git.sesse.net Git - vlc/blob - include/vlc_codec.h
* include/vlc_es.h: added b_packetized field to es_format_t to tell a decoder if...
[vlc] / include / vlc_codec.h
1 /*****************************************************************************
2  * vlc_codec.h: codec related structures
3  *****************************************************************************
4  * Copyright (C) 1999-2003 VideoLAN
5  * $Id$
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 #include "ninput.h"
27
28 /**
29  * \file
30  * This file defines the structure and types used by decoders and encoders
31  */
32
33 typedef struct decoder_owner_sys_t decoder_owner_sys_t;
34
35 /**
36  * \defgroup decoder Decoder
37  *
38  * The structure describing a decoder
39  *
40  * @{
41  */
42
43 struct decoder_t
44 {
45     VLC_COMMON_MEMBERS
46
47     /* Module properties */
48     module_t *          p_module;
49     decoder_sys_t *     p_sys;
50
51     picture_t *         ( * pf_decode_video )( decoder_t *, block_t ** );
52     aout_buffer_t *     ( * pf_decode_audio )( decoder_t *, block_t ** );
53     void                ( * pf_decode_sub)   ( decoder_t *, block_t ** );
54     block_t *           ( * pf_packetize )   ( decoder_t *, block_t ** );
55
56     /* Some decoders only accept packetized data (ie. not truncated) */
57     vlc_bool_t          b_need_packetized;
58
59     /* Input format ie from demuxer (XXX: a lot of field could be invalid) */
60     es_format_t         fmt_in;
61
62     /* Output format of decoder/packetizer */
63     es_format_t         fmt_out;
64
65     /*
66      * Buffers allocation
67      */
68
69     /* Audio output callbacks */
70     aout_buffer_t * ( * pf_aout_buffer_new) ( decoder_t *, int );
71     void            ( * pf_aout_buffer_del) ( decoder_t *, aout_buffer_t * );
72
73     /* Video output callbacks */
74     picture_t     * ( * pf_vout_buffer_new) ( decoder_t * );
75     void            ( * pf_vout_buffer_del) ( decoder_t *, picture_t * );
76     void            ( * pf_picture_link)    ( decoder_t *, picture_t * );
77     void            ( * pf_picture_unlink)  ( decoder_t *, picture_t * );
78
79
80     /* Private structure for the owner of the decoder */
81     decoder_owner_sys_t *p_owner;
82 };
83
84 /**
85  * @}
86  */
87
88 /**
89  * \defgroup decoder Encoder
90  *
91  * The structure describing a Encoder
92  *
93  * @{
94  */
95
96 struct encoder_t
97 {
98     VLC_COMMON_MEMBERS
99
100     /* Module properties */
101     module_t *          p_module;
102     encoder_sys_t *     p_sys;
103
104     block_t *           ( * pf_header )( encoder_t * );
105     block_t *           ( * pf_encode_video )( encoder_t *, picture_t * );
106     block_t *           ( * pf_encode_audio )( encoder_t *, aout_buffer_t * );
107
108     /* Properties of the input data fed to the encoder */
109     es_format_t         fmt_in;
110
111     /* Properties of the output of the encoder */
112     es_format_t         fmt_out;
113
114     /* FIXME: move these to the ffmpeg encoder */
115     int i_key_int;
116     int i_b_frames;
117     int i_vtolerance;
118     int i_qmin;
119     int i_qmax;
120     int i_hq;
121     vlc_bool_t          b_strict_rc;
122     vlc_bool_t          b_pre_me;
123     vlc_bool_t          b_hurry_up;
124     vlc_bool_t          b_interlace;
125     int                 i_rc_buffer_size;
126     float               f_rc_buffer_aggressivity;
127     float               f_i_quant_factor;
128     int                 i_noise_reduction;
129     vlc_bool_t          b_mpeg4_matrix;
130     int                 i_threads;
131     vlc_bool_t          b_trellis;
132 };
133
134 /**
135  * @}
136  */
137
138 #endif /* _VLC_CODEC_H */