mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05: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)
|
std::string cameraModel(const Camera *camera)
|
||||||
{
|
{
|
||||||
const ControlList &props = camera->properties();
|
const ControlList &props = camera->properties();
|
||||||
std::string name;
|
|
||||||
if (props.contains(properties::Model))
|
if (auto model = props.get(properties::Model))
|
||||||
name = props.get(properties::Model);
|
return std::move(model.value());
|
||||||
else
|
|
||||||
name = camera->id();
|
return camera->id();
|
||||||
return name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cameraLoc(const Camera *camera)
|
std::string cameraLoc(const Camera *camera)
|
||||||
{
|
{
|
||||||
const ControlList &props = camera->properties();
|
const ControlList &props = camera->properties();
|
||||||
std::string location;
|
|
||||||
if (props.contains(properties::Location)) {
|
if (auto location = props.get(properties::Location)) {
|
||||||
switch (props.get(properties::Location)) {
|
switch (location.value()) {
|
||||||
case properties::CameraLocationFront:
|
case properties::CameraLocationFront:
|
||||||
location = "front";
|
return "front";
|
||||||
break;
|
|
||||||
case properties::CameraLocationBack:
|
case properties::CameraLocationBack:
|
||||||
location = "back";
|
return "back";
|
||||||
break;
|
|
||||||
case properties::CameraLocationExternal:
|
case properties::CameraLocationExternal:
|
||||||
location = "external";
|
return "external";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return location;
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
static int emit_info(struct impl *impl, bool full)
|
static int emit_info(struct impl *impl, bool full)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue