TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_LIBAV_LIBAVOPTIONS_HPP_ 00002 #define _TUTTLE_PLUGIN_LIBAV_LIBAVOPTIONS_HPP_ 00003 00004 #include "LibAV.hpp" 00005 #include "LibAVPresetDefinitions.hpp" 00006 #include "LibAVVideoWriter.hpp" 00007 00008 #include <tuttle/plugin/context/ReaderPlugin.hpp> 00009 #include <tuttle/plugin/context/WriterPlugin.hpp> 00010 00011 #include <ofxsImageEffect.h> 00012 00013 #include <vector> 00014 00015 namespace tuttle { 00016 namespace plugin { 00017 namespace av { 00018 00019 template< typename IOPlugin > 00020 class AVOptionPlugin : public IOPlugin 00021 { 00022 public: 00023 AVOptionPlugin( OfxImageEffectHandle handle ); 00024 00025 protected: 00026 int convertIntWithOptionalUnit( const std::string& param, const std::string& stringValue ); 00027 00028 template< typename LibAVVideoRW > 00029 void setParameters( LibAVVideoRW& writer, const EAVParamType& type, void* av_class, int req_flags, int rej_flags ); 00030 00031 template< typename LibAVVideoRW > 00032 void setParameters( LibAVVideoRW& writer, const EAVParamType& type, const std::vector<AVPrivOption>& avPrivOpts, const std::string& codec ); 00033 void setParameters( const PresetParameters& parameters ); 00034 00035 private: 00036 template< typename LibAVVideoRW > 00037 void optionSet( LibAVVideoRW& videoRW, const EAVParamType& type, const AVOption &opt, bool &value ); 00038 00039 template< typename LibAVVideoRW > 00040 void optionSet( LibAVVideoRW& videoRW, const EAVParamType& type, const AVOption& opt, bool& value, std::string& valueToSetFlag ); 00041 00042 template< typename LibAVVideoRW > 00043 void optionSet( LibAVVideoRW& videoRW, const EAVParamType& type, const AVOption &opt, int &value ); 00044 00045 template< typename LibAVVideoRW > 00046 void optionSet( LibAVVideoRW& videoRW, const EAVParamType& type, const AVOption &opt, double &value ); 00047 00048 template< typename LibAVVideoRW > 00049 void optionSet( LibAVVideoRW& videoRW, const EAVParamType& type, const AVOption &opt, int &valueNum, int& valueDen ); 00050 00051 template< typename LibAVVideoRW > 00052 void optionSet( LibAVVideoRW& videoRW, const EAVParamType& type, const AVOption &opt, std::string &value ); 00053 }; 00054 00055 } 00056 } 00057 } 00058 00059 #include "LibAVOptions.tcc" 00060 00061 #endif