diff --git a/src/api/avmodel.h b/src/api/avmodel.h index 4c0d2f17c07d1ccdefe06355f92bb35919c0a0c1..c8fdb5bd885367009187e7627d0eef9e8ebb3e6c 100644 --- a/src/api/avmodel.h +++ b/src/api/avmodel.h @@ -285,6 +285,23 @@ public: */ void useAVFrame(bool useAVFrame); + /** + * set current using device + * @ param device name + */ + void setCurrentVideoCaptureDevice(std::string ¤tVideoCaptureDevice); + + /** + * set current using device + * @ return current using device name + */ + std::string getCurrentVideoCaptureDevice() const; + + /** + * clear current using device + */ + void clearCurrentVideoCaptureDevice(); + Q_SIGNALS: /** * Emitted when a renderer is started diff --git a/src/avmodel.cpp b/src/avmodel.cpp index f30a727c8be07c66efdd24129f8670f46bf1b954..5bd2bbfbb5b1ebd73afbfc539cf4d1b5300b689f 100644 --- a/src/avmodel.cpp +++ b/src/avmodel.cpp @@ -65,6 +65,7 @@ public: // store if a renderers is for a finished call std::map<std::string, bool> finishedRenderers_; bool useAVFrame_ = false; + std::string currentVideoCaptureDevice_ {}; #ifndef ENABLE_LIBWRAP // TODO: Init Video Renderers from daemon (see: https://git.ring.cx/savoirfairelinux/ring-daemon/issues/59) @@ -611,6 +612,24 @@ AVModel::getCurrentRenderedDevice(const std::string& call_id) const return result; } +void +AVModel::setCurrentVideoCaptureDevice(std::string ¤tVideoCaptureDevice) +{ + pimpl_->currentVideoCaptureDevice_ = currentVideoCaptureDevice; +} + +std::string +AVModel::getCurrentVideoCaptureDevice() const +{ + return pimpl_->currentVideoCaptureDevice_; +} + +void +AVModel::clearCurrentVideoCaptureDevice() +{ + pimpl_->currentVideoCaptureDevice_.clear(); +} + AVModelPimpl::AVModelPimpl(AVModel& linked, const CallbacksHandler& callbacksHandler) : linked_(linked) , callbacksHandler(callbacksHandler)