зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678680 [PipeWire] Lock current_frame_ access as it can be used from multiple threads, r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D98080
This commit is contained in:
Родитель
0a1e6a8e24
Коммит
d1756f4a78
|
@ -401,6 +401,7 @@ void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) {
|
|||
video_size_ = desktop_size_;
|
||||
}
|
||||
|
||||
rtc::CritScope lock(¤t_frame_lock_);
|
||||
if (!current_frame_ ||
|
||||
(video_metadata_use_ && !video_size_.equals(video_size_prev))) {
|
||||
current_frame_ =
|
||||
|
@ -877,6 +878,7 @@ void BaseCapturerPipeWire::CaptureFrame() {
|
|||
return;
|
||||
}
|
||||
|
||||
rtc::CritScope lock(¤t_frame_lock_);
|
||||
if (!current_frame_) {
|
||||
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
|
||||
return;
|
||||
|
|
|
@ -84,6 +84,7 @@ class BaseCapturerPipeWire : public DesktopCapturer {
|
|||
DesktopSize desktop_size_ = {};
|
||||
DesktopCaptureOptions options_ = {};
|
||||
|
||||
rtc::CriticalSection current_frame_lock_;
|
||||
std::unique_ptr<uint8_t[]> current_frame_;
|
||||
Callback* callback_ = nullptr;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче