]> git.sesse.net Git - vlc/blob - include/vlc_codec.h
* modules/stream_out/transcode.c: new options
[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.7 2003/11/27 22:44:50 massiot 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 #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     /* Input format ie from demuxer (XXX: a lot of field could be invalid) */
57     es_format_t         fmt_in;
58
59     /* Output format of decoder/packetizer */
60     es_format_t         fmt_out;
61
62     /*
63      * Buffers allocation
64      */
65
66     /* Audio output callbacks */
67     aout_buffer_t * ( * pf_aout_buffer_new) ( decoder_t *, int );
68     void            ( * pf_aout_buffer_del) ( decoder_t *, aout_buffer_t * );
69
70     /* Video output callbacks */
71     picture_t     * ( * pf_vout_buffer_new) ( decoder_t * );
72     void            ( * pf_vout_buffer_del) ( decoder_t *, picture_t * );
73     void            ( * pf_picture_link)    ( decoder_t *, picture_t * );
74     void            ( * pf_picture_unlink)  ( decoder_t *, picture_t * );
75
76
77     /* Private structure for the owner of the decoder */
78     decoder_owner_sys_t *p_owner;
79 };
80
81 /**
82  * @}
83  */
84
85 /**
86  * \defgroup decoder Encoder
87  *
88  * The structure describing a Encoder
89  *
90  * @{
91  */
92
93 struct encoder_t
94 {
95     VLC_COMMON_MEMBERS
96
97     /* Module properties */
98     module_t *          p_module;
99     encoder_sys_t *     p_sys;
100
101     block_t *           ( * pf_header )( encoder_t * );
102     block_t *           ( * pf_encode_video )( encoder_t *, picture_t * );
103     block_t *           ( * pf_encode_audio )( encoder_t *, aout_buffer_t * );
104
105     /* Properties of the input data fed to the encoder */
106     es_format_t         fmt_in;
107
108     /* Properties of the output of the encoder */
109     es_format_t         fmt_out;
110
111     /* FIXME: move these to the ffmpeg encoder */
112     int i_key_int;
113     int i_b_frames;
114     int i_vtolerance;
115     int i_qmin;
116     int i_qmax;
117     int i_hq;
118     vlc_bool_t          b_strict_rc;
119     vlc_bool_t          b_pre_me;
120     vlc_bool_t          b_hurry_up;
121 };
122
123 /**
124  * @}
125  */
126
127 #endif /* _VLC_CODEC_H */