Adds repeating task class.
This CL adds a single class to manage the use case of having a task that repeats itself by a fixed or variable interval. It replaces the repeating task previously locally defined for rtp transport controller send as well as the cancelable periodic task. Furthermore, it is introduced where one off repeating tasks were created before. It provides the currently used functionality of the cancelable periodic task, but not some of the unused features, such as allowing cancellation of tasks before they are started and cancellation of a task after the owning task queue has been destroyed. Bug: webrtc:9883 Change-Id: Ifa7edee836c2a64fce16a7d0f682eb09c879eaca Reviewed-on: https://webrtc-review.googlesource.com/c/116182 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26313}
This commit is contained in:
committed by
Commit Bot
parent
95edb037a4
commit
ecb6897ade
@ -29,6 +29,7 @@
|
||||
#include "rtc_base/network_route.h"
|
||||
#include "rtc_base/race_checker.h"
|
||||
#include "rtc_base/task_queue.h"
|
||||
#include "rtc_base/task_utils/repeating_task.h"
|
||||
|
||||
namespace webrtc {
|
||||
class Clock;
|
||||
@ -120,9 +121,6 @@ class RtpTransportControllerSend final
|
||||
|
||||
// Implements CallStatsObserver interface
|
||||
void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override;
|
||||
|
||||
class PeriodicTask;
|
||||
|
||||
private:
|
||||
void MaybeCreateControllers() RTC_RUN_ON(task_queue_);
|
||||
void UpdateInitialConstraints(TargetRateConstraints new_contraints)
|
||||
@ -181,10 +179,8 @@ class RtpTransportControllerSend final
|
||||
std::atomic<size_t> transport_overhead_bytes_per_packet_;
|
||||
bool network_available_ RTC_GUARDED_BY(task_queue_);
|
||||
bool packet_feedback_available_ RTC_GUARDED_BY(task_queue_);
|
||||
PeriodicTask* pacer_queue_update_task_ RTC_GUARDED_BY(task_queue_)
|
||||
RTC_PT_GUARDED_BY(task_queue_);
|
||||
PeriodicTask* controller_task_ RTC_GUARDED_BY(task_queue_)
|
||||
RTC_PT_GUARDED_BY(task_queue_);
|
||||
RepeatingTaskHandle pacer_queue_update_task_ RTC_GUARDED_BY(task_queue_);
|
||||
RepeatingTaskHandle controller_task_ RTC_GUARDED_BY(task_queue_);
|
||||
// Protects access to last_packet_feedback_vector_ in feedback adapter.
|
||||
// TODO(srte): Remove this checker when feedback adapter runs on task queue.
|
||||
rtc::RaceChecker worker_race_;
|
||||
|
||||
Reference in New Issue
Block a user