Video Capture PipeWire: Filter out non-camera nodes
This can be helpful in various situations, such as debugging with an unrestricted Pipewire socket or for downstream projects like B2G/Capyloon. Additionally it will help once we move from the camera portal to the more generic device portal. Original patch by Fabrice Desré <fabrice@desre.org> Bug: webrtc:15464 Change-Id: Iae6802f242d68244bca85947cb15ef3eee923ab0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318642 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40706}
This commit is contained in:
parent
3e1e831ae3
commit
a717c7ada8
1
AUTHORS
1
AUTHORS
@ -104,6 +104,7 @@ Raman Budny <budnyjj@gmail.com>
|
|||||||
Ramprakash Jelari <ennajelari@gmail.com>
|
Ramprakash Jelari <ennajelari@gmail.com>
|
||||||
Riku Voipio <riku.voipio@linaro.org>
|
Riku Voipio <riku.voipio@linaro.org>
|
||||||
Robert Bares <robert@bares.me>
|
Robert Bares <robert@bares.me>
|
||||||
|
Robert Mader <robert.mader@collabora.com>
|
||||||
Robert Mader <robert.mader@posteo.de>
|
Robert Mader <robert.mader@posteo.de>
|
||||||
Robert Nagy <robert.nagy@gmail.com>
|
Robert Nagy <robert.nagy@gmail.com>
|
||||||
Ryan Yoakum <ryoakum@skobalt.com>
|
Ryan Yoakum <ryoakum@skobalt.com>
|
||||||
|
|||||||
@ -360,6 +360,10 @@ void PipeWireSession::OnRegistryGlobal(void* data,
|
|||||||
if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION))
|
if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
auto node_role = spa_dict_lookup(props, PW_KEY_MEDIA_ROLE);
|
||||||
|
if (!node_role || strcmp(node_role, "Camera"))
|
||||||
|
return;
|
||||||
|
|
||||||
that->nodes_.emplace_back(that, id, props);
|
that->nodes_.emplace_back(that, id, props);
|
||||||
that->PipeWireSync();
|
that->PipeWireSync();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user