1 /*****************************************************************************
2 * vlc_codec.h: codec related structures
3 *****************************************************************************
4 * Copyright (C) 1999-2003 VideoLAN
7 * Authors: Gildas Bazin <gbazin@netcourrier.com>
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 #define _VLC_CODEC_H 1
28 * This file defines the structure and types used by decoders and encoders
31 typedef struct decoder_owner_sys_t decoder_owner_sys_t;
34 * \defgroup decoder Decoder
36 * The structure describing a decoder
45 /* Module properties */
47 decoder_sys_t * p_sys;
49 /* Input format ie from demuxer (XXX: a lot of field could be invalid) */
52 /* Output format of decoder/packetizer */
55 /* Some decoders only accept packetized data (ie. not truncated) */
56 vlc_bool_t b_need_packetized;
58 /* Tell the decoder if it is allowed to drop frames */
59 vlc_bool_t b_pace_control;
61 picture_t * ( * pf_decode_video )( decoder_t *, block_t ** );
62 aout_buffer_t * ( * pf_decode_audio )( decoder_t *, block_t ** );
63 subpicture_t * ( * pf_decode_sub) ( decoder_t *, block_t ** );
64 block_t * ( * pf_packetize ) ( decoder_t *, block_t ** );
70 /* Audio output callbacks */
71 aout_buffer_t * ( * pf_aout_buffer_new) ( decoder_t *, int );
72 void ( * pf_aout_buffer_del) ( decoder_t *, aout_buffer_t * );
74 /* Video output callbacks */
75 picture_t * ( * pf_vout_buffer_new) ( decoder_t * );
76 void ( * pf_vout_buffer_del) ( decoder_t *, picture_t * );
77 void ( * pf_picture_link) ( decoder_t *, picture_t * );
78 void ( * pf_picture_unlink) ( decoder_t *, picture_t * );
80 /* SPU output callbacks */
81 subpicture_t * ( * pf_spu_buffer_new) ( decoder_t * );
82 void ( * pf_spu_buffer_del) ( decoder_t *, subpicture_t * );
84 /* Private structure for the owner of the decoder */
85 decoder_owner_sys_t *p_owner;
93 * \defgroup decoder Encoder
95 * The structure describing a Encoder
104 /* Module properties */
106 encoder_sys_t * p_sys;
108 /* Properties of the input data fed to the encoder */
111 /* Properties of the output of the encoder */
114 block_t * ( * pf_encode_video )( encoder_t *, picture_t * );
115 block_t * ( * pf_encode_audio )( encoder_t *, aout_buffer_t * );
116 block_t * ( * pf_encode_sub )( encoder_t *, subpicture_t * );
118 /* Common encoder options */
119 int i_threads; /* Number of threads to use during encoding */
120 int i_iframes; /* One I frame per i_iframes */
121 int i_bframes; /* One B frame per i_bframes */
122 int i_tolerance; /* Bitrate tolerance */
132 #endif /* _VLC_CODEC_H */