ffmpeg.h

00001 /* -- 2007-05-07 -- 
00002  *  ardev - an augmented reality library for robot developers
00003  *  Copyright 2005-2007 - Toby Collett (ardev _at_ plan9.net.nz)
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  *  Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public
00016  *  License along with this library; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
00018  *
00019  */
00020 #include <ardev/ardevconfig.h>
00021 #ifdef HAVE_FFMPEG
00022 
00023 #ifndef FFMPEG_H
00024 #define FFMPEG_H
00025 
00026 #include <ffmpeg/avformat.h>
00027 
00028 class ffmpeg
00029 {
00030         public:
00031                 
00032                 ffmpeg(char * filename, int width, int height, int framerate = 25);
00033                 ~ffmpeg();
00034                 
00035                 int OpenStream();
00036                 int WriteFrame(AVFrame * frame);
00037                 int CloseStream();
00038 
00039                 AVFrame *alloc_pictureframe(int pix_fmt, int width, int height);
00040                 void free_pictureframe(AVFrame * picture);
00041         private:
00042                 AVStream *add_video_stream(AVFormatContext *oc, int codec_id);
00043                 
00044                 void open_video(AVFormatContext *oc, AVStream *st);
00045                 void write_video_frame(AVFormatContext *oc, AVStream *st, AVFrame * in_picture);
00046                 void close_video(AVFormatContext *oc, AVStream *st);
00047         
00048                 int Width, Height, FrameRate;
00049                 char * Filename;
00050         
00051             AVOutputFormat *fmt;
00052         AVFormatContext *oc;
00053         AVStream *video_st;
00054 
00055                 AVFrame * picture;
00056                 uint8_t *video_outbuf;
00057                 int frame_count, video_outbuf_size;     
00058 };
00059 
00060 #endif
00061 
00062 #endif
00063 

SourceForge.net Logo Generated on Sat May 12 15:25:43 2007 for ardev by doxygen 1.5.1