#ifndef VIDEOCAPTUREMANAGER_H #define VIDEOCAPTUREMANAGER_H #include "IVideoCapturer.h" #include "VideoCapturerFactory.h" #include namespace avrecorder { namespace video { class VideoCaptureManager { public: bool open(const CaptureTarget& target, CaptureMethod method, int width, int height) { m_capturer = VideoCapturerFactory::create(method); if (!m_capturer) return false; return m_capturer->open(target, width, height); } void close() { if (m_capturer) m_capturer->close(); } AVFrame* getFrame() { return m_capturer ? m_capturer->getFrame() : nullptr; } void setDrawCursor(bool enable) { if (m_capturer) m_capturer->setDrawCursor(enable); } private: std::unique_ptr m_capturer; }; } // namespace video } // namespace avrecorder #endif // VIDEOCAPTUREMANAGER_H