summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/test/frame_generator_capturer.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--third_party/libwebrtc/test/frame_generator_capturer.cc10
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() {