Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members
ffmpegInterface.h
00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: ffmpegInterface.h * 00006 * * 00007 * * 00008 * * 00009 * ITEC institute of the University of Klagenfurt (Austria) * 00010 * http://www.itec.uni-klu.ac.at * 00011 * * 00012 * * 00013 * For more information visit the ViTooKi homepage: * 00014 * http://ViTooKi.sourceforge.net * 00015 * vitooki-user@lists.sourceforge.net * 00016 * vitooki-devel@lists.sourceforge.net * 00017 * * 00018 * This file is part of ViTooKi, a free video toolkit. * 00019 * ViTooKi is free software; you can redistribute it and/or * 00020 * modify it under the terms of the GNU General Public License * 00021 * as published by the Free Software Foundation; either version 2 * 00022 * of the License, or (at your option) any later version. * 00023 * * 00024 * This program is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU General Public License * 00030 * along with this program; if not, write to the Free Software * 00031 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 00032 * MA 02111-1307, USA. * 00033 * * 00034 ***********************************************************************/ 00035 00036 /*********************************************************************** 00037 * * 00038 * REVISION HISTORY: * 00039 * * 00040 * * 00041 * * 00042 ***********************************************************************/ 00043 00044 00045 00046 #ifndef FFMPEG_INTERFACE_H 00047 #define FFMPEG_INTERFACE_H 00048 00049 00050 00051 //take care! copied from global.hpp !!! 00052 #define MAX_FRAME_SIZE 65536*8 //512KByte per frame 00053 #define ERR_OK 0 00054 #define ERR -1 00055 #define ERR_FILE -500 00056 00057 #include "avcodec.h" 00058 00059 #ifdef USE_FASTMEMCPY 00060 #include "fastmemcpy.h" 00061 #endif 00062 00063 #ifdef HAVE_MMX 00064 #include "i386/mmx.h" 00065 #endif 00066 #ifdef ISOMP4 00067 #include "ISOMovies.h" //for the sake of u8 only 00068 #else 00069 typedef unsigned char u8; 00070 #endif 00071 00072 00083 typedef enum FFMPEGenumColorSpace{ 00084 FFMPEGColorSpaceUnknown = -1, /*@PIX_FMT_ANY, */ 00085 FFMPEGColorSpaceDefault = PIX_FMT_YUV420P, 00086 FFMPEGColorSpaceRGB24 = PIX_FMT_RGB24, 00087 FFMPEGColorSpaceYV12 = 100, /* vitooki does U/V swapping now, ffmpeg seems to output in YV12 */ 00088 FFMPEGColorSpaceI420 = PIX_FMT_YUV420P, /* vitooki just copies the YVU swapped ffmpeg result */ 00089 FFMPEGColorSpaceRGB32 = PIX_FMT_RGBA32, 00090 FFMPEGColorSpaceRGB565 = PIX_FMT_RGB565, 00091 FFMPEGColorSpaceGRAY8 = PIX_FMT_GRAY8 00092 } ffmpegColorSpace; 00093 00094 #ifdef __cplusplus 00095 extern "C" { 00096 #endif 00097 00098 00099 #ifndef WINCE 00100 00112 int FFMPEGDecoderInit(char **pDecoderHandle, enum CodecID codecID, unsigned int uiWidth, unsigned int uiHeight); 00113 00122 void FFMPEGDecoderClose(char **pDecoderHandle); 00123 00133 int FFMPEGDecoderGetWidth(char *pDecoderHandle); 00134 00144 int FFMPEGDecoderGetHeight(char *pDecoderHandle); 00145 00159 int FFMPEGDecodeFrame(char *pDecoderHandle, char *pCompressedFrame, 00160 int iCFSize, char* pYUVFrame, ffmpegColorSpace eColorSpace); 00161 00175 int FFMPEGEncoderInit( char **pEncoderHandle, enum CodecID id, int iWidth, int iHeight, int iBitrate, int iFramerate, int numBFrames, int keyFrameInterval); 00176 00183 void FFMPEGEncoderClose(char **pEncoderHandle); 00184 00201 int FFMPEGEncodeFrame(char *pEncoderHandle, char *pYUVFrame, 00202 char *pCompressed, ffmpegColorSpace eColorSpace, int forceIFrame); 00203 00216 int FFMPEGEncodeFile(char *in, int width, int height, int bitrate, ffmpegColorSpace eColorSpace, char *out); 00217 00218 00219 00220 00221 00222 00223 //AUDIO STUFF 00233 int FFMPEGaudioDecoderInit(char **pDecoderHandle, enum CodecID codecID); 00234 00242 void FFMPEGaudioDecoderClose(char **pDecoderHandle); 00243 00255 int FFMPEGaudioDecodeFrame(char *pDecoderHandle, char *pCompressedFrame, 00256 int iCFSize, char* PCMFrame, int* mFrameSize); 00257 00268 int FFMPEGaudioEncoderInit( char **pEncoderHandle, int iBitrate, int iSampleRate, int iChannels, int iBits); 00269 00276 void FFMPEGaudioEncoderClose(char **pEncoderHandle); 00277 00288 int FFMPEGaudioEncodeFrame(char *pEncoderHandle, char *PCMFrame, char *pCompressed); 00289 00290 00291 #endif //wince 00292 00293 00294 00295 #ifdef __cplusplus 00296 } 00297 #endif 00298 00299 #endif 00300 00301