// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #ifndef BACKEND_HPP_DEFINED #define BACKEND_HPP_DEFINED #include "cap_interface.hpp" #include "opencv2/videoio/registry.hpp" namespace cv { // TODO: move to public interface // TODO: allow runtime backend registration class IBackend { public: virtual ~IBackend() {} virtual Ptr createCapture(int camera) const = 0; virtual Ptr createCapture(const std::string &filename) const = 0; virtual Ptr createWriter(const std::string &filename, int fourcc, double fps, const cv::Size &sz, bool isColor) const = 0; }; class IBackendFactory { public: virtual ~IBackendFactory() {} virtual Ptr getBackend() const = 0; }; //============================================================================= typedef Ptr (*FN_createCaptureFile)(const std::string & filename); typedef Ptr (*FN_createCaptureCamera)(int camera); typedef Ptr (*FN_createWriter)(const std::string& filename, int fourcc, double fps, const Size& sz, bool isColor); Ptr createBackendFactory(FN_createCaptureFile createCaptureFile, FN_createCaptureCamera createCaptureCamera, FN_createWriter createWriter); Ptr createPluginBackendFactory(VideoCaptureAPIs id, const char* baseName); } // namespace cv:: #endif // BACKEND_HPP_DEFINED