Skip to content
Snippets Groups Projects
Commit 2f848d6b authored by Vivien Didelot's avatar Vivien Didelot
Browse files

video_device_monitor: hide getCapabilities

This patch moves away the getCapabilities implementation, allowing the
monitor to get rid of the V4L2 specific getters for channel, size and
rate lists.

Refs #49517

Change-Id: Ic4a3e939e762493f54c733bcc5a71e7e34816434
parent 2155cc3c
No related branches found
No related tags found
No related merge requests found
......@@ -424,27 +424,21 @@ VideoDeviceMonitor::getDeviceList() const
return monitorImpl_->getDeviceList();
}
std::vector<std::string>
VideoDeviceMonitor::getChannelList(const std::string &dev) const
{
return monitorImpl_->getChannelList(dev);
}
/*
* Interface for a single device.
*/
std::vector<std::string>
VideoDeviceMonitor::getSizeList(const std::string &dev, const std::string &channel) const
VideoCapabilities
VideoDeviceMonitor::getCapabilities(const std::string& name) const
{
return monitorImpl_->getSizeList(dev, channel);
}
VideoCapabilities cap;
std::vector<std::string>
VideoDeviceMonitor::getRateList(const std::string &dev, const std::string &channel, const std::string &size) const
{
return monitorImpl_->getRateList(dev, channel, size);
}
for (const auto& chan : monitorImpl_->getChannelList(name))
for (const auto& size : monitorImpl_->getSizeList(name, chan))
cap[chan][size] = monitorImpl_->getRateList(name, chan, size);
/*
* Interface for a single device.
*/
return cap;
}
std::map<std::string, std::string>
VideoDeviceMonitor::deviceToSettings(const VideoDevice& dev) const
......
......@@ -44,18 +44,6 @@ using namespace sfl_video;
* Interface for a single device.
*/
VideoCapabilities
VideoDeviceMonitor::getCapabilities(const std::string& name) const
{
VideoCapabilities cap;
for (const auto& chan : getChannelList(name))
for (const auto& size : getSizeList(name, chan))
cap[chan][size] = getRateList(name, chan, size);
return cap;
}
VideoDeviceMonitor::VideoDevice
VideoDeviceMonitor::defaultPreferences(const std::string& name) const
{
......
......@@ -106,10 +106,6 @@ class VideoDeviceMonitor : public Serializable
std::vector<VideoDevice>::iterator lookupDevice(const std::string& name);
std::vector<VideoDevice>::const_iterator lookupDevice(const std::string& name) const;
std::vector<std::string> getChannelList(const std::string& name) const;
std::vector<std::string> getSizeList(const std::string& name, const std::string& channel) const;
std::vector<std::string> getRateList(const std::string& name, const std::string& channel, const std::string& size) const;
bool validatePreference(const VideoDevice& dev) const;
std::map<std::string, std::string> deviceToSettings(const VideoDevice& dev) const;
static void addDeviceToSequence(const VideoDevice& dev, Conf::SequenceNode& seq);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment