Bug 1843786 - webrtc: Filter out non-camera nodes, r=webrtc-reviewers,pehrsons,@webrtc-reviewers

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.

This is intended to get upstreamed but would be nice to carry downstream
already.

Original patch by Fabrice Desré <fabrice@desre.org>

Upstream commit: a717c7ada811411e31bd7308168b4dbee5b956fa

Differential Revision: https://phabricator.services.mozilla.com/D183650
This commit is contained in:
Robert Mader 2023-09-06 16:37:55 +00:00
Родитель 4e50035ffb
Коммит 15bec067ae
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -361,6 +361,10 @@ void PipeWireSession::OnRegistryGlobal(void* data,
if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION))
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->PipeWireSync();
}

Просмотреть файл

@ -0,0 +1 @@
We cherry-picked this in bug 1843786