TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_LIBAV_LIBAV_HPP_ 00002 #define _TUTTLE_PLUGIN_LIBAV_LIBAV_HPP_ 00003 00004 extern "C" { 00005 #ifndef __STDC_CONSTANT_MACROS 00006 #define __STDC_CONSTANT_MACROS 00007 #endif 00008 #include <libavcodec/avcodec.h> 00009 #include <libavformat/avformat.h> 00010 #include <libavutil/avutil.h> 00011 #include <libavutil/opt.h> 00012 #include <libavutil/mathematics.h> 00013 #include <libavutil/avstring.h> 00014 #include <libavutil/pixdesc.h> 00015 #include <libswscale/swscale.h> 00016 } 00017 00018 #include <string> 00019 #include <vector> 00020 00021 namespace tuttle { 00022 namespace plugin { 00023 namespace av { 00024 00025 typedef struct AVPrivOption 00026 { 00027 AVOption o; 00028 std::string class_name; 00029 } AVPrivOption; 00030 00031 enum EAVParamType 00032 { 00033 eAVParamFormat = 0, 00034 eAVParamVideo, 00035 eAVParamAudio 00036 }; 00037 00038 /** 00039 * @brief This is a base class for libav, don't use it directly. 00040 * It contains only utilities functions. 00041 */ 00042 class LibAV 00043 { 00044 protected: 00045 LibAV() {} 00046 virtual ~LibAV() {} 00047 00048 public: 00049 static const std::string libavError_toString( int error ); 00050 static const std::string libavLogLevel_toString( int logLevel ); 00051 static const std::string codecType_toString( const AVMediaType codec_type ); 00052 00053 std::vector<AVPrivOption> getAVOptions(const AVClass *av_class); 00054 00055 void getPixelsFormatList(); 00056 00057 private: 00058 static bool _hasBeenInit; 00059 static bool globalInit(); 00060 00061 }; 00062 00063 } 00064 } 00065 } 00066 00067 #endif 00068