PipeWire video capture: set device unique ID during initialization

This is what Firefox implementation relies on and I can see that also
the V4L2 implementation is doing the same.

Bug: webrtc:15087
Change-Id: I641062ba879b6ef83e31af79ecc9d06fdae54adb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301320
Commit-Queue: Jan Grulich <grulja@gmail.com>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39869}
This commit is contained in:
Jan Grulich 2023-04-14 13:11:25 +02:00 committed by WebRTC LUCI CQ
parent 4ec56a3aa0
commit 4beafa38d5

View File

@ -62,6 +62,10 @@ int32_t VideoCaptureModulePipeWire::Init(const char* deviceUniqueId) {
node_id_ = id.value();
const int len = strlen(deviceUniqueId);
_deviceUniqueId = new (std::nothrow) char[len + 1];
memcpy(_deviceUniqueId, deviceUniqueId, len + 1);
return 0;
}