Skip to content
Snippets Groups Projects
Commit a948e1f9 authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez
Browse files

use a common camera:// prefix for video input

Refs #69017

Change-Id: Iab0a6d49221d1a14e5e563e1747ea5a1dd5aff22
parent 8507024c
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
A media resource locator (MRL). A media resource locator (MRL).
Currently, the following are supported: Currently, the following are supported:
<ul> <ul>
<li>v4l2://DEVICE</li> <li>camera://DEVICE</li>
<li>display://DISPLAY_NAME[ WIDTHxHEIGHT]</li> <li>display://DISPLAY_NAME[ WIDTHxHEIGHT]</li>
<li>file://IMAGE_PATH</li> <li>file://IMAGE_PATH</li>
</ul> </ul>
......
...@@ -108,9 +108,7 @@ VideoDeviceMonitor::getMRLForDefaultDevice() const ...@@ -108,9 +108,7 @@ VideoDeviceMonitor::getMRLForDefaultDevice() const
const auto it = findDeviceByName(defaultDevice_); const auto it = findDeviceByName(defaultDevice_);
if(it == std::end(devices_)) if(it == std::end(devices_))
return {}; return {};
return "camera://" + it->getSettings().name;
auto prefix = it->getDeviceParams().format;
return prefix + "://" + it->getSettings().name;
} }
void void
......
...@@ -317,7 +317,7 @@ VideoInput::switchInput(const std::string& resource) ...@@ -317,7 +317,7 @@ VideoInput::switchInput(const std::string& resource)
bool valid = false; bool valid = false;
if (prefix == "video4linux2") { if (prefix == "camera") {
/* Video4Linux2 */ /* Video4Linux2 */
valid = initCamera(suffix); valid = initCamera(suffix);
} else if (prefix == "display") { } else if (prefix == "display") {
...@@ -326,9 +326,6 @@ VideoInput::switchInput(const std::string& resource) ...@@ -326,9 +326,6 @@ VideoInput::switchInput(const std::string& resource)
} else if (prefix == "file") { } else if (prefix == "file") {
/* Pathname */ /* Pathname */
valid = initFile(suffix); valid = initFile(suffix);
} else if (prefix == "avfoundation") {
/* AVFoundation */
valid = initCamera(suffix);
} }
// Unsupported MRL or failed initialization // Unsupported MRL or failed initialization
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment