* vlc_codec.h: codec related structures
*****************************************************************************
* Copyright (C) 1999-2003 VideoLAN
- * $Id: vlc_codec.h,v 1.1 2003/10/08 21:01:07 gbazin Exp $
+ * $Id: vlc_codec.h,v 1.6 2003/11/24 23:22:01 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#ifndef _VLC_CODEC_H
#define _VLC_CODEC_H 1
+#include "ninput.h"
+
/**
* \file
* This file defines the structure and types used by decoders and encoders
*/
+typedef struct decoder_owner_sys_t decoder_owner_sys_t;
+
/**
* \defgroup decoder Decoder
*
/* Module properties */
module_t * p_module;
decoder_sys_t * p_sys;
- int ( * pf_init ) ( decoder_t * );
- int ( * pf_decode )( decoder_t *, block_t * );
- int ( * pf_end ) ( decoder_t * );
- /* Input properties */
- decoder_fifo_t * p_fifo; /* stores the PES stream data */
+ picture_t * ( * pf_decode_video )( decoder_t *, block_t ** );
+ aout_buffer_t * ( * pf_decode_audio )( decoder_t *, block_t ** );
+ void ( * pf_decode_sub) ( decoder_t *, block_t ** );
+ block_t * ( * pf_packetize ) ( decoder_t *, block_t ** );
+
+ /* Input format ie from demuxer (XXX: a lot of field could be invalid) */
+ es_format_t fmt_in;
+
+ /* Output format of decoder/packetizer */
+ es_format_t fmt_out;
+
+ /*
+ * Buffers allocation
+ */
- /* Tmp field for old decoder api */
- int ( * pf_run ) ( decoder_fifo_t * );
+ /* Audio output callbacks */
+ aout_buffer_t * ( * pf_aout_buffer_new) ( decoder_t *, int );
+ void ( * pf_aout_buffer_del) ( decoder_t *, aout_buffer_t * );
+
+ /* Video output callbacks */
+ picture_t * ( * pf_vout_buffer_new) ( decoder_t * );
+ void ( * pf_vout_buffer_del) ( decoder_t *, picture_t * );
+ void ( * pf_picture_link) ( decoder_t *, picture_t * );
+ void ( * pf_picture_unlink) ( decoder_t *, picture_t * );
+
+
+ /* Private structure for the owner of the decoder */
+ decoder_owner_sys_t *p_owner;
};
/**
block_t * ( * pf_encode_audio )( encoder_t *, aout_buffer_t * );
/* Properties of the input data fed to the encoder */
- union {
- audio_sample_format_t audio;
- video_frame_format_t video;
- } format;
+ es_format_t fmt_in;
/* Properties of the output of the encoder */
- vlc_fourcc_t i_fourcc;
- int i_bitrate;
+ es_format_t fmt_out;
+
+ /* FIXME: move these to the ffmpeg encoder */
+ int i_key_int;
+ int i_b_frames;
+ int i_vtolerance;
+ int i_qmin;
+ int i_qmax;
+ int i_hq;
+
};
/**