From 14f3d350aa7c9abfd8bc394e87177d3f9e6b8d87 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 27 May 2013 17:22:16 +0100 Subject: adding audio output to avwrapper --- rotord/libavwrapper.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'rotord/libavwrapper.h') diff --git a/rotord/libavwrapper.h b/rotord/libavwrapper.h index 449c2f2..c06a94d 100755 --- a/rotord/libavwrapper.h +++ b/rotord/libavwrapper.h @@ -131,18 +131,27 @@ namespace libav { public: //typedef encoder::Channel Channel; - encoder(const char * file_name, int width, int height, enum AVCodecID codec_id = CODEC_ID_MPEG4); + encoder(const char * file_name, int width, int height, float _framerate=25.0f, enum AVCodecID codec_id = CODEC_ID_MPEG4); virtual ~encoder(); void setPixelIntensity(int x, int y, int c, uint8_t value); - void write_frame(); + void write_frame(float seconds,uint8_t *rgbdata); + void write_frame(float seconds,uint16_t *audiodata); + int get_audio_framesize(){ return audio_input_frame_size; } + float get_audio_step(){return audiostep;}; protected: AVFormatContext *container; AVCodecContext *pCtx; AVFrame *picture_yuv; AVFrame *picture_rgb; + AVFrame *audio_frame; + float timebase; struct SwsContext *Sctx; + + int audio_input_frame_size; + float audiostep; }; + } -- cgit v1.2.3