diff --git a/src/client/videomanager.cpp b/src/client/videomanager.cpp index 52410735952885d3c0d59c351dbab796eefcbdbb..881a6cd07fcaefebd5769615c68041b5a8476c28 100644 --- a/src/client/videomanager.cpp +++ b/src/client/videomanager.cpp @@ -683,7 +683,7 @@ setEncodingAccelerated(bool state) #if defined(__ANDROID__) || defined(RING_UWP) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS) void addVideoDevice(const std::string& node, - std::vector<std::map<std::string, std::string>> const* devInfo) + const std::vector<std::map<std::string, std::string>>& devInfo) { jami::Manager::instance().getVideoManager().videoDeviceMonitor.addDevice(node, devInfo); } diff --git a/src/dring/videomanager_interface.h b/src/dring/videomanager_interface.h index 7dbcea0e757e99535621fa0ff71ac0c01c228808..6ed6b9acf7d66a212f75d189d7e3b6f793ecc863 100644 --- a/src/dring/videomanager_interface.h +++ b/src/dring/videomanager_interface.h @@ -213,7 +213,7 @@ DRING_PUBLIC void stopLocalRecorder(const std::string& filepath); #if defined(__ANDROID__) || defined(RING_UWP) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS) DRING_PUBLIC void addVideoDevice( const std::string& node, - const std::vector<std::map<std::string, std::string>>* devInfo = nullptr); + const std::vector<std::map<std::string, std::string>>& devInfo = {}); DRING_PUBLIC void removeVideoDevice(const std::string& node); DRING_PUBLIC VideoFrame* getNewFrame(); DRING_PUBLIC void publishFrame(); diff --git a/src/media/video/v4l2/video_device_monitor_impl.cpp b/src/media/video/v4l2/video_device_monitor_impl.cpp index 36ff0354653bbaa7c11c2a04f9cb9fda0ad6c74d..4d4ea73205ce624f9b9dee12b9b0e399e28562b8 100644 --- a/src/media/video/v4l2/video_device_monitor_impl.cpp +++ b/src/media/video/v4l2/video_device_monitor_impl.cpp @@ -148,9 +148,7 @@ VideoDeviceMonitorImpl::VideoDeviceMonitorImpl(VideoDeviceMonitor* monitor) try { auto unique_name = getDeviceString(dev); JAMI_DBG("udev: adding device with id %s", unique_name.c_str()); - std::map<std::string, std::string> info = {{"devPath", path}}; - std::vector<std::map<std::string, std::string>> devInfo = {info}; - monitor_->addDevice(unique_name, &devInfo); + monitor_->addDevice(unique_name, {{{"devPath", path}}}); currentPathToId_.emplace(path, unique_name); } catch (const std::exception& e) { JAMI_ERR("%s", e.what()); @@ -237,9 +235,7 @@ VideoDeviceMonitorImpl::run() const char* action = udev_device_get_action(dev); if (!strcmp(action, "add")) { JAMI_DBG("udev: adding device with id %s", unique_name.c_str()); - std::map<std::string, std::string> info = {{"devPath", path}}; - std::vector<std::map<std::string, std::string>> devInfo = {info}; - monitor_->addDevice(unique_name, &devInfo); + monitor_->addDevice(unique_name, {{{"devPath", path}}}); currentPathToId_.emplace(path, unique_name); } else if (!strcmp(action, "remove")) { auto it = currentPathToId_.find(path); diff --git a/src/media/video/video_device_monitor.cpp b/src/media/video/video_device_monitor.cpp index 750c5b49dba9f6a87f5933ba2f3d08b403897843..c7fb6b5becbaa127c0d36137529153ae76a3da16 100644 --- a/src/media/video/video_device_monitor.cpp +++ b/src/media/video/video_device_monitor.cpp @@ -185,7 +185,7 @@ notify() void VideoDeviceMonitor::addDevice(const string& id, - const std::vector<std::map<std::string, std::string>>* devInfo) + const std::vector<std::map<std::string, std::string>>& devInfo) { try { std::lock_guard<std::mutex> l(lock_); @@ -193,7 +193,7 @@ VideoDeviceMonitor::addDevice(const string& id, return; // instantiate a new unique device - VideoDevice dev {id, *devInfo}; + VideoDevice dev {id, devInfo}; if (dev.getChannelList().empty()) return; diff --git a/src/media/video/video_device_monitor.h b/src/media/video/video_device_monitor.h index a3b24da42efe95ec7ebd5a488514af7328ec030e..074a8703283facd907deb9e92d3d8a3d881afcd7 100644 --- a/src/media/video/video_device_monitor.h +++ b/src/media/video/video_device_monitor.h @@ -60,7 +60,7 @@ public: void setDeviceOrientation(const std::string& id, int angle); void addDevice(const std::string& node, - const std::vector<std::map<std::string, std::string>>* devInfo = nullptr); + const std::vector<std::map<std::string, std::string>>& devInfo = {}); void removeDevice(const std::string& node); void removeDeviceViaInput(const std::string& path);