diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/test/frame_generator_capturer.cc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/test/frame_generator_capturer.cc')
-rw-r--r-- | third_party/libwebrtc/test/frame_generator_capturer.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/third_party/libwebrtc/test/frame_generator_capturer.cc b/third_party/libwebrtc/test/frame_generator_capturer.cc index 6ba0807a74..7cdfec2cc2 100644 --- a/third_party/libwebrtc/test/frame_generator_capturer.cc +++ b/third_party/libwebrtc/test/frame_generator_capturer.cc @@ -29,7 +29,6 @@ #include "rtc_base/checks.h" #include "rtc_base/logging.h" #include "rtc_base/synchronization/mutex.h" -#include "rtc_base/task_queue.h" #include "rtc_base/task_utils/repeating_task.h" #include "system_wrappers/include/clock.h" #include "test/test_video_capturer.h" @@ -58,6 +57,9 @@ FrameGeneratorCapturer::FrameGeneratorCapturer( FrameGeneratorCapturer::~FrameGeneratorCapturer() { Stop(); + // Deconstruct first as tasks in the TaskQueue access other fields of the + // instance of this class. + task_queue_ = nullptr; } void FrameGeneratorCapturer::SetFakeRotation(VideoRotation rotation) { @@ -78,7 +80,7 @@ bool FrameGeneratorCapturer::Init() { return false; frame_task_ = RepeatingTaskHandle::DelayedStart( - task_queue_.Get(), + task_queue_.get(), TimeDelta::Seconds(1) / GetCurrentConfiguredFramerate(), [this] { InsertFrame(); @@ -131,7 +133,7 @@ void FrameGeneratorCapturer::Start() { } if (!frame_task_.Running()) { frame_task_ = RepeatingTaskHandle::Start( - task_queue_.Get(), + task_queue_.get(), [this] { InsertFrame(); return TimeDelta::Seconds(1) / GetCurrentConfiguredFramerate(); @@ -219,7 +221,7 @@ void FrameGeneratorCapturer::UpdateFps(int max_fps) { void FrameGeneratorCapturer::ForceFrame() { // One-time non-repeating task, - task_queue_.PostTask([this] { InsertFrame(); }); + task_queue_->PostTask([this] { InsertFrame(); }); } int FrameGeneratorCapturer::GetCurrentConfiguredFramerate() { |