TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_AV_READER_PLUGIN_HPP_ 00002 #define _TUTTLE_PLUGIN_AV_READER_PLUGIN_HPP_ 00003 00004 #include <tuttle/plugin/context/ReaderPlugin.hpp> 00005 00006 #include <libav/LibAVPresetDefinitions.hpp> 00007 #include <libav/LibAVVideoReader.hpp> 00008 #include <libav/LibAVOptions.hpp> 00009 00010 #include <string> 00011 00012 namespace tuttle { 00013 namespace plugin { 00014 namespace av { 00015 namespace reader { 00016 00017 struct AVReaderParams 00018 { 00019 std::string _filepath; ///< Ffmpeg filepath 00020 }; 00021 00022 /** 00023 * @brief AudioVideo plugin 00024 */ 00025 class AVReaderPlugin : public AVOptionPlugin< ReaderPlugin > 00026 { 00027 public: 00028 AVReaderPlugin( OfxImageEffectHandle handle ); 00029 00030 public: 00031 bool ensureVideoIsOpen(); 00032 00033 AVReaderParams getProcessParams() const; 00034 00035 void updateVisibleTools(); 00036 void changedParam( const OFX::InstanceChangedArgs& args, const std::string& paramName ); 00037 bool getRegionOfDefinition( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod ); 00038 void getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences ); 00039 bool getTimeDomain( OfxRangeD& range ); 00040 00041 void beginSequenceRender( const OFX::BeginSequenceRenderArguments& args ); 00042 void render( const OFX::RenderArguments& args ); 00043 void endSequenceRender( const OFX::EndSequenceRenderArguments& args ); 00044 00045 public: 00046 // do not need to delete these, the ImageEffect is managing them for us 00047 OFX::Clip* _clipDst; ///< Destination image clip 00048 00049 OFX::StringParam* _paramFilepath; ///< video filepath 00050 OFX::BooleanParam* _paramUseCustomSAR; ///< Keep sample aspect ratio 00051 OFX::DoubleParam* _paramCustomSAR; ///< Custom SAR to use 00052 00053 bool _errorInFile; 00054 bool _initReader; 00055 LibAVVideoReader _reader; 00056 }; 00057 00058 } 00059 } 00060 } 00061 } 00062 00063 #endif