mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
spa: libcamera: fix build error due to return type change
libcamera commit 1c4d4801850559d6f919eef5c2ffbaf7675dbc46 changed the return type of libcamera::ControlList::get() to be std::optional<T>. Adapt the code to this change. Fixes #2575
This commit is contained in:
parent
0bf7911b37
commit
89d5d51bb3
1 changed files with 13 additions and 16 deletions
|
|
@ -81,32 +81,29 @@ struct impl {
|
|||
std::string cameraModel(const Camera *camera)
|
||||
{
|
||||
const ControlList &props = camera->properties();
|
||||
std::string name;
|
||||
if (props.contains(properties::Model))
|
||||
name = props.get(properties::Model);
|
||||
else
|
||||
name = camera->id();
|
||||
return name;
|
||||
|
||||
if (auto model = props.get(properties::Model))
|
||||
return std::move(model.value());
|
||||
|
||||
return camera->id();
|
||||
}
|
||||
|
||||
std::string cameraLoc(const Camera *camera)
|
||||
{
|
||||
const ControlList &props = camera->properties();
|
||||
std::string location;
|
||||
if (props.contains(properties::Location)) {
|
||||
switch (props.get(properties::Location)) {
|
||||
|
||||
if (auto location = props.get(properties::Location)) {
|
||||
switch (location.value()) {
|
||||
case properties::CameraLocationFront:
|
||||
location = "front";
|
||||
break;
|
||||
return "front";
|
||||
case properties::CameraLocationBack:
|
||||
location = "back";
|
||||
break;
|
||||
return "back";
|
||||
case properties::CameraLocationExternal:
|
||||
location = "external";
|
||||
break;
|
||||
return "external";
|
||||
}
|
||||
}
|
||||
return location;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
static int emit_info(struct impl *impl, bool full)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue