mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-18 08:56:45 -05:00
v4l2: improve is_capture check
This commit is contained in:
parent
82ee139f65
commit
f59a43a4f0
1 changed files with 4 additions and 6 deletions
|
|
@ -97,12 +97,10 @@ error:
|
||||||
|
|
||||||
int spa_v4l2_is_capture(struct spa_v4l2_device *dev)
|
int spa_v4l2_is_capture(struct spa_v4l2_device *dev)
|
||||||
{
|
{
|
||||||
if ((dev->cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0 ||
|
uint32_t caps = dev->cap.capabilities;
|
||||||
((dev->cap.capabilities & V4L2_CAP_DEVICE_CAPS) &&
|
if ((caps & V4L2_CAP_DEVICE_CAPS))
|
||||||
(dev->cap.device_caps & V4L2_CAP_VIDEO_CAPTURE) == 0)) {
|
caps = dev->cap.device_caps;
|
||||||
return 0;
|
return (caps & V4L2_CAP_VIDEO_CAPTURE) == V4L2_CAP_VIDEO_CAPTURE;
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int spa_v4l2_close(struct spa_v4l2_device *dev)
|
int spa_v4l2_close(struct spa_v4l2_device *dev)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue