From 0240bcc1f3190c3be603bcdbfda8a3a83930afad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 10 Sep 2020 16:44:48 +0200 Subject: [PATCH] Make NetEqController::TargetLevelMs method const This method is used by GetStats, and hence must not modify any state. This cl is step one of the api change, the non-const version of the method can be deleted once downstream implementations of this interface are updated. Bug: webrtc:11622 Change-Id: Icfaccee6bc918ac5c8a39dd2567a1081e342e9e8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183881 Reviewed-by: Ivo Creusen Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#32072} --- api/neteq/neteq_controller.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/neteq/neteq_controller.h b/api/neteq/neteq_controller.h index 1d47eaca78..9cad41515c 100644 --- a/api/neteq/neteq_controller.h +++ b/api/neteq/neteq_controller.h @@ -152,7 +152,15 @@ class NetEqController { virtual void AddSampleMemory(int32_t value) = 0; // Returns the target buffer level in ms. - virtual int TargetLevelMs() = 0; + // TODO(bugs.webrtc.org/11622): Delete the non-const version and default + // implementation, once downstream code is updated. + virtual int TargetLevelMs() { + return const_cast(this)->TargetLevelMs(); + } + + virtual int TargetLevelMs() const { + return const_cast(this)->TargetLevelMs(); + } // Notify the NetEqController that a packet has arrived. Returns the relative // arrival delay, if it can be computed.