Skip to content
Snippets Groups Projects
Commit 2f6f35cf authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

video device: recheck the video properties

We could recheck for the video device capabilities whenever the
devices list is requested. This can avoid having a virtualcamera,
like OBS, with mismatching information from what is available on the system.

GitLab: jami-client-qt#747

Change-Id: I012cfb71e12c8e9965b9d112e3ff0488c7cb285c
parent 5df9251e
No related branches found
No related tags found
No related merge requests found
...@@ -57,10 +57,11 @@ public: ...@@ -57,10 +57,11 @@ public:
DeviceParams getDeviceParams() const; DeviceParams getDeviceParams() const;
void setDeviceParams(const DeviceParams&); void setDeviceParams(const DeviceParams&);
void setup();
private: private:
std::unique_ptr<CaptureGraphInterfaces> cInterface; std::unique_ptr<CaptureGraphInterfaces> cInterface;
void setup();
std::vector<VideoSize> sizeList_; std::vector<VideoSize> sizeList_;
std::map<VideoSize, std::vector<FrameRate>> rateList_; std::map<VideoSize, std::vector<FrameRate>> rateList_;
std::map<VideoSize, AM_MEDIA_TYPE*> capMap_; std::map<VideoSize, AM_MEDIA_TYPE*> capMap_;
...@@ -80,6 +81,13 @@ VideoDeviceImpl::VideoDeviceImpl(const std::string& id) ...@@ -80,6 +81,13 @@ VideoDeviceImpl::VideoDeviceImpl(const std::string& id)
void void
VideoDeviceImpl::setup() VideoDeviceImpl::setup()
{ {
// Add new size, rate, bitrate, and cap map.
sizeList_.clear();
rateList_.clear();
capMap_.clear();
cInterface.reset(new CaptureGraphInterfaces());
if (id == DEVICE_DESKTOP) { if (id == DEVICE_DESKTOP) {
name = DEVICE_DESKTOP; name = DEVICE_DESKTOP;
VideoSize size {0, 0}; VideoSize size {0, 0};
...@@ -357,6 +365,7 @@ VideoDevice::VideoDevice(const std::string& path, ...@@ -357,6 +365,7 @@ VideoDevice::VideoDevice(const std::string& path,
DeviceParams DeviceParams
VideoDevice::getDeviceParams() const VideoDevice::getDeviceParams() const
{ {
deviceImpl_->setup();
return deviceImpl_->getDeviceParams(); return deviceImpl_->getDeviceParams();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment