Improvements for NetEqControllers

When creating a NetEqController it can be useful to have access to a
webrtc::Clock*. Also, NetEqControllers should have access to the
contents of the sync buffer when making decisions.

Bug: webrtc:11005
Change-Id: I7fdba75ce661b2ace52458620a8c1f3c990e5ac2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167208
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30368}
This commit is contained in:
Ivo Creusen
2020-01-24 11:04:56 +01:00
committed by Commit Bot
parent 9bac68c0cc
commit 88636c6dac
6 changed files with 19 additions and 5 deletions

View File

@ -61,13 +61,15 @@ std::unique_ptr<NetEqController> CreateNetEqController(
int max_packets_in_buffer,
bool enable_rtx_handling,
bool allow_time_stretching,
TickTimer* tick_timer) {
TickTimer* tick_timer,
webrtc::Clock* clock) {
NetEqController::Config config;
config.base_min_delay_ms = base_min_delay;
config.max_packets_in_buffer = max_packets_in_buffer;
config.enable_rtx_handling = enable_rtx_handling;
config.allow_time_stretching = allow_time_stretching;
config.tick_timer = tick_timer;
config.clock = clock;
return controller_factory.CreateNetEqController(config);
}
@ -93,7 +95,8 @@ NetEqImpl::Dependencies::Dependencies(
config.max_packets_in_buffer,
config.enable_rtx_handling,
!config.for_test_no_time_stretching,
tick_timer.get())),
tick_timer.get(),
clock)),
red_payload_splitter(new RedPayloadSplitter),
timestamp_scaler(new TimestampScaler(*decoder_database)),
accelerate_factory(new AccelerateFactory),
@ -1084,6 +1087,7 @@ int NetEqImpl::GetDecision(Operation* operation,
status.last_mode = last_mode_;
status.play_dtmf = *play_dtmf;
status.generated_noise_samples = generated_noise_samples;
status.sync_buffer_samples = sync_buffer_->FutureLength();
if (packet) {
status.next_packet = {
packet->timestamp, packet->frame && packet->frame->IsDtxPacket(),