2013-01-29 12:09:21 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/neteq_impl.h"
|
2019-07-05 19:08:33 +02:00
|
|
|
|
2016-04-27 01:19:58 -07:00
|
|
|
#include <memory>
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
#include <utility>
|
|
|
|
|
#include <vector>
|
2016-04-27 01:19:58 -07:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
2019-10-31 14:38:11 +01:00
|
|
|
#include "api/neteq/default_neteq_controller_factory.h"
|
|
|
|
|
#include "api/neteq/neteq.h"
|
|
|
|
|
#include "api/neteq/neteq_controller.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/accelerate.h"
|
2019-10-24 15:20:39 +02:00
|
|
|
#include "modules/audio_coding/neteq/decision_logic.h"
|
2019-11-28 14:07:14 +01:00
|
|
|
#include "modules/audio_coding/neteq/default_neteq_factory.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/expand.h"
|
2019-02-21 15:42:31 +01:00
|
|
|
#include "modules/audio_coding/neteq/histogram.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/mock/mock_decoder_database.h"
|
|
|
|
|
#include "modules/audio_coding/neteq/mock/mock_dtmf_buffer.h"
|
|
|
|
|
#include "modules/audio_coding/neteq/mock/mock_dtmf_tone_generator.h"
|
2019-10-24 15:20:39 +02:00
|
|
|
#include "modules/audio_coding/neteq/mock/mock_neteq_controller.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/mock/mock_packet_buffer.h"
|
|
|
|
|
#include "modules/audio_coding/neteq/mock/mock_red_payload_splitter.h"
|
|
|
|
|
#include "modules/audio_coding/neteq/preemptive_expand.h"
|
2019-03-05 16:59:03 +01:00
|
|
|
#include "modules/audio_coding/neteq/statistics_calculator.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/sync_buffer.h"
|
|
|
|
|
#include "modules/audio_coding/neteq/timestamp_scaler.h"
|
2017-11-22 10:42:26 +01:00
|
|
|
#include "rtc_base/numerics/safe_conversions.h"
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
#include "system_wrappers/include/clock.h"
|
2018-12-06 13:07:11 +01:00
|
|
|
#include "test/audio_decoder_proxy_factory.h"
|
2018-11-30 10:45:12 +01:00
|
|
|
#include "test/function_audio_decoder_factory.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/gmock.h"
|
|
|
|
|
#include "test/gtest.h"
|
|
|
|
|
#include "test/mock_audio_decoder.h"
|
|
|
|
|
#include "test/mock_audio_decoder_factory.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2019-03-26 20:14:46 +01:00
|
|
|
using ::testing::_;
|
2015-03-16 12:30:37 +00:00
|
|
|
using ::testing::AtLeast;
|
2019-03-26 20:14:46 +01:00
|
|
|
using ::testing::DoAll;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
using ::testing::ElementsAre;
|
2019-03-26 20:14:46 +01:00
|
|
|
using ::testing::InSequence;
|
|
|
|
|
using ::testing::Invoke;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
using ::testing::IsEmpty;
|
2019-03-26 20:14:46 +01:00
|
|
|
using ::testing::IsNull;
|
|
|
|
|
using ::testing::Pointee;
|
2013-01-29 12:09:21 +00:00
|
|
|
using ::testing::Return;
|
|
|
|
|
using ::testing::ReturnNull;
|
|
|
|
|
using ::testing::SetArgPointee;
|
2014-11-04 14:03:58 +00:00
|
|
|
using ::testing::SetArrayArgument;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
using ::testing::SizeIs;
|
2013-01-29 12:09:21 +00:00
|
|
|
using ::testing::WithArg;
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// This function is called when inserting a packet list into the mock packet
|
|
|
|
|
// buffer. The purpose is to delete all inserted packets properly, to avoid
|
|
|
|
|
// memory leaks in the test.
|
|
|
|
|
int DeletePacketsAndReturnOk(PacketList* packet_list) {
|
2016-10-24 08:25:28 -07:00
|
|
|
packet_list->clear();
|
2013-01-29 12:09:21 +00:00
|
|
|
return PacketBuffer::kOK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class NetEqImplTest : public ::testing::Test {
|
|
|
|
|
protected:
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
NetEqImplTest() : clock_(0) { config_.sample_rate_hz = 8000; }
|
2014-03-12 05:55:10 +00:00
|
|
|
|
2018-11-30 10:45:12 +01:00
|
|
|
void CreateInstance(
|
|
|
|
|
const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) {
|
|
|
|
|
ASSERT_TRUE(decoder_factory);
|
2019-10-31 14:38:11 +01:00
|
|
|
NetEqImpl::Dependencies deps(config_, &clock_, decoder_factory,
|
|
|
|
|
DefaultNetEqControllerFactory());
|
2016-04-26 12:19:34 -07:00
|
|
|
|
|
|
|
|
// Get a local pointer to NetEq's TickTimer object.
|
|
|
|
|
tick_timer_ = deps.tick_timer.get();
|
|
|
|
|
|
2014-03-12 05:55:10 +00:00
|
|
|
if (use_mock_decoder_database_) {
|
2016-04-26 12:19:34 -07:00
|
|
|
std::unique_ptr<MockDecoderDatabase> mock(new MockDecoderDatabase);
|
|
|
|
|
mock_decoder_database_ = mock.get();
|
2014-03-12 05:55:10 +00:00
|
|
|
EXPECT_CALL(*mock_decoder_database_, GetActiveCngDecoder())
|
|
|
|
|
.WillOnce(ReturnNull());
|
2016-04-26 12:19:34 -07:00
|
|
|
deps.decoder_database = std::move(mock);
|
2014-03-12 05:55:10 +00:00
|
|
|
}
|
2016-04-26 12:19:34 -07:00
|
|
|
decoder_database_ = deps.decoder_database.get();
|
|
|
|
|
|
2014-03-12 05:55:10 +00:00
|
|
|
if (use_mock_dtmf_buffer_) {
|
2016-04-26 12:19:34 -07:00
|
|
|
std::unique_ptr<MockDtmfBuffer> mock(
|
|
|
|
|
new MockDtmfBuffer(config_.sample_rate_hz));
|
|
|
|
|
mock_dtmf_buffer_ = mock.get();
|
|
|
|
|
deps.dtmf_buffer = std::move(mock);
|
2014-03-12 05:55:10 +00:00
|
|
|
}
|
2016-04-26 12:19:34 -07:00
|
|
|
dtmf_buffer_ = deps.dtmf_buffer.get();
|
|
|
|
|
|
2014-03-12 05:55:10 +00:00
|
|
|
if (use_mock_dtmf_tone_generator_) {
|
2016-04-26 12:19:34 -07:00
|
|
|
std::unique_ptr<MockDtmfToneGenerator> mock(new MockDtmfToneGenerator);
|
|
|
|
|
mock_dtmf_tone_generator_ = mock.get();
|
|
|
|
|
deps.dtmf_tone_generator = std::move(mock);
|
2014-03-12 05:55:10 +00:00
|
|
|
}
|
2016-04-26 12:19:34 -07:00
|
|
|
dtmf_tone_generator_ = deps.dtmf_tone_generator.get();
|
|
|
|
|
|
2014-03-12 05:55:10 +00:00
|
|
|
if (use_mock_packet_buffer_) {
|
2016-04-26 12:19:34 -07:00
|
|
|
std::unique_ptr<MockPacketBuffer> mock(
|
|
|
|
|
new MockPacketBuffer(config_.max_packets_in_buffer, tick_timer_));
|
|
|
|
|
mock_packet_buffer_ = mock.get();
|
|
|
|
|
deps.packet_buffer = std::move(mock);
|
2014-03-12 05:55:10 +00:00
|
|
|
}
|
2016-04-26 12:19:34 -07:00
|
|
|
packet_buffer_ = deps.packet_buffer.get();
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
if (use_mock_neteq_controller_) {
|
|
|
|
|
std::unique_ptr<MockNetEqController> mock(new MockNetEqController());
|
|
|
|
|
mock_neteq_controller_ = mock.get();
|
|
|
|
|
deps.neteq_controller = std::move(mock);
|
|
|
|
|
} else {
|
|
|
|
|
deps.stats = std::make_unique<StatisticsCalculator>();
|
|
|
|
|
NetEqController::Config controller_config;
|
|
|
|
|
controller_config.tick_timer = tick_timer_;
|
|
|
|
|
controller_config.base_min_delay_ms = config_.min_delay_ms;
|
|
|
|
|
controller_config.enable_rtx_handling = config_.enable_rtx_handling;
|
|
|
|
|
controller_config.allow_time_stretching = true;
|
|
|
|
|
controller_config.max_packets_in_buffer = config_.max_packets_in_buffer;
|
2020-01-24 11:04:56 +01:00
|
|
|
controller_config.clock = &clock_;
|
2019-10-24 15:20:39 +02:00
|
|
|
deps.neteq_controller =
|
|
|
|
|
std::make_unique<DecisionLogic>(std::move(controller_config));
|
|
|
|
|
}
|
|
|
|
|
neteq_controller_ = deps.neteq_controller.get();
|
|
|
|
|
|
2014-03-12 05:55:10 +00:00
|
|
|
if (use_mock_payload_splitter_) {
|
2016-09-22 02:06:28 -07:00
|
|
|
std::unique_ptr<MockRedPayloadSplitter> mock(new MockRedPayloadSplitter);
|
2016-04-26 12:19:34 -07:00
|
|
|
mock_payload_splitter_ = mock.get();
|
2016-09-22 02:06:28 -07:00
|
|
|
deps.red_payload_splitter = std::move(mock);
|
2014-03-12 05:55:10 +00:00
|
|
|
}
|
2016-09-22 02:06:28 -07:00
|
|
|
red_payload_splitter_ = deps.red_payload_splitter.get();
|
2016-04-26 12:19:34 -07:00
|
|
|
|
|
|
|
|
deps.timestamp_scaler = std::unique_ptr<TimestampScaler>(
|
|
|
|
|
new TimestampScaler(*deps.decoder_database.get()));
|
|
|
|
|
|
|
|
|
|
neteq_.reset(new NetEqImpl(config_, std::move(deps)));
|
2014-03-12 05:55:10 +00:00
|
|
|
ASSERT_TRUE(neteq_ != NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-30 10:45:12 +01:00
|
|
|
void CreateInstance() { CreateInstance(CreateBuiltinAudioDecoderFactory()); }
|
|
|
|
|
|
2014-03-12 05:55:10 +00:00
|
|
|
void UseNoMocks() {
|
|
|
|
|
ASSERT_TRUE(neteq_ == NULL) << "Must call UseNoMocks before CreateInstance";
|
|
|
|
|
use_mock_decoder_database_ = false;
|
2019-10-24 15:20:39 +02:00
|
|
|
use_mock_neteq_controller_ = false;
|
2014-03-12 05:55:10 +00:00
|
|
|
use_mock_dtmf_buffer_ = false;
|
|
|
|
|
use_mock_dtmf_tone_generator_ = false;
|
|
|
|
|
use_mock_packet_buffer_ = false;
|
|
|
|
|
use_mock_payload_splitter_ = false;
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual ~NetEqImplTest() {
|
2014-03-12 05:55:10 +00:00
|
|
|
if (use_mock_decoder_database_) {
|
|
|
|
|
EXPECT_CALL(*mock_decoder_database_, Die()).Times(1);
|
|
|
|
|
}
|
2019-10-24 15:20:39 +02:00
|
|
|
if (use_mock_neteq_controller_) {
|
|
|
|
|
EXPECT_CALL(*mock_neteq_controller_, Die()).Times(1);
|
2014-03-12 05:55:10 +00:00
|
|
|
}
|
|
|
|
|
if (use_mock_dtmf_buffer_) {
|
|
|
|
|
EXPECT_CALL(*mock_dtmf_buffer_, Die()).Times(1);
|
|
|
|
|
}
|
|
|
|
|
if (use_mock_dtmf_tone_generator_) {
|
|
|
|
|
EXPECT_CALL(*mock_dtmf_tone_generator_, Die()).Times(1);
|
|
|
|
|
}
|
|
|
|
|
if (use_mock_packet_buffer_) {
|
|
|
|
|
EXPECT_CALL(*mock_packet_buffer_, Die()).Times(1);
|
|
|
|
|
}
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2019-01-10 16:55:06 +01:00
|
|
|
void TestDtmfPacket(int sample_rate_hz) {
|
2016-11-17 04:45:19 -08:00
|
|
|
const size_t kPayloadLength = 4;
|
|
|
|
|
const uint8_t kPayloadType = 110;
|
|
|
|
|
const int kSampleRateHz = 16000;
|
|
|
|
|
config_.sample_rate_hz = kSampleRateHz;
|
|
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance();
|
|
|
|
|
// Event: 2, E bit, Volume: 17, Length: 4336.
|
|
|
|
|
uint8_t payload[kPayloadLength] = {0x02, 0x80 + 0x11, 0x10, 0xF0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2016-11-17 04:45:19 -08:00
|
|
|
|
2019-01-10 16:55:06 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(
|
|
|
|
|
kPayloadType, SdpAudioFormat("telephone-event", sample_rate_hz, 1)));
|
2016-11-17 04:45:19 -08:00
|
|
|
|
|
|
|
|
// Insert first packet.
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2016-11-17 04:45:19 -08:00
|
|
|
|
|
|
|
|
// Pull audio once.
|
|
|
|
|
const size_t kMaxOutputSize =
|
|
|
|
|
static_cast<size_t>(10 * kSampleRateHz / 1000);
|
|
|
|
|
AudioFrame output;
|
|
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
ASSERT_FALSE(muted);
|
|
|
|
|
ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
|
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
|
|
|
|
|
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
// DTMF packets are immediately consumed by |InsertPacket()| and won't be
|
|
|
|
|
// returned by |GetAudio()|.
|
|
|
|
|
EXPECT_THAT(output.packet_infos_, IsEmpty());
|
|
|
|
|
|
2016-11-17 04:45:19 -08:00
|
|
|
// Verify first 64 samples of actual output.
|
|
|
|
|
const std::vector<int16_t> kOutput(
|
|
|
|
|
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
-1578, -2816, -3460, -3403, -2709, -1594, -363, 671, 1269, 1328,
|
|
|
|
|
908, 202, -513, -964, -955, -431, 504, 1617, 2602, 3164,
|
|
|
|
|
3101, 2364, 1073, -511, -2047, -3198, -3721, -3525, -2688, -1440,
|
|
|
|
|
-99, 1015, 1663, 1744, 1319, 588, -171, -680, -747, -315,
|
|
|
|
|
515, 1512, 2378, 2828, 2674, 1877, 568, -986, -2446, -3482,
|
|
|
|
|
-3864, -3516, -2534, -1163});
|
|
|
|
|
ASSERT_GE(kMaxOutputSize, kOutput.size());
|
2017-06-12 12:45:32 -07:00
|
|
|
EXPECT_TRUE(std::equal(kOutput.begin(), kOutput.end(), output.data()));
|
2016-11-17 04:45:19 -08:00
|
|
|
}
|
|
|
|
|
|
2016-04-26 12:19:34 -07:00
|
|
|
std::unique_ptr<NetEqImpl> neteq_;
|
2014-04-14 18:49:17 +00:00
|
|
|
NetEq::Config config_;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
SimulatedClock clock_;
|
2016-04-26 12:19:34 -07:00
|
|
|
TickTimer* tick_timer_ = nullptr;
|
|
|
|
|
MockDecoderDatabase* mock_decoder_database_ = nullptr;
|
|
|
|
|
DecoderDatabase* decoder_database_ = nullptr;
|
|
|
|
|
bool use_mock_decoder_database_ = true;
|
2019-10-24 15:20:39 +02:00
|
|
|
MockNetEqController* mock_neteq_controller_ = nullptr;
|
|
|
|
|
NetEqController* neteq_controller_ = nullptr;
|
|
|
|
|
bool use_mock_neteq_controller_ = true;
|
2016-04-26 12:19:34 -07:00
|
|
|
MockDtmfBuffer* mock_dtmf_buffer_ = nullptr;
|
|
|
|
|
DtmfBuffer* dtmf_buffer_ = nullptr;
|
|
|
|
|
bool use_mock_dtmf_buffer_ = true;
|
|
|
|
|
MockDtmfToneGenerator* mock_dtmf_tone_generator_ = nullptr;
|
|
|
|
|
DtmfToneGenerator* dtmf_tone_generator_ = nullptr;
|
|
|
|
|
bool use_mock_dtmf_tone_generator_ = true;
|
|
|
|
|
MockPacketBuffer* mock_packet_buffer_ = nullptr;
|
|
|
|
|
PacketBuffer* packet_buffer_ = nullptr;
|
|
|
|
|
bool use_mock_packet_buffer_ = true;
|
2016-09-22 02:06:28 -07:00
|
|
|
MockRedPayloadSplitter* mock_payload_splitter_ = nullptr;
|
|
|
|
|
RedPayloadSplitter* red_payload_splitter_ = nullptr;
|
2016-04-26 12:19:34 -07:00
|
|
|
bool use_mock_payload_splitter_ = true;
|
2013-01-29 12:09:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// This tests the interface class NetEq.
|
|
|
|
|
// TODO(hlundin): Move to separate file?
|
|
|
|
|
TEST(NetEq, CreateAndDestroy) {
|
2014-04-14 18:49:17 +00:00
|
|
|
NetEq::Config config;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
SimulatedClock clock(0);
|
2019-11-28 14:07:14 +01:00
|
|
|
auto decoder_factory = CreateBuiltinAudioDecoderFactory();
|
|
|
|
|
std::unique_ptr<NetEq> neteq =
|
|
|
|
|
DefaultNetEqFactory().CreateNetEq(config, decoder_factory, &clock);
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2016-10-04 09:33:27 -07:00
|
|
|
TEST_F(NetEqImplTest, RegisterPayloadType) {
|
|
|
|
|
CreateInstance();
|
|
|
|
|
constexpr int rtp_payload_type = 0;
|
|
|
|
|
const SdpAudioFormat format("pcmu", 8000, 1);
|
|
|
|
|
EXPECT_CALL(*mock_decoder_database_,
|
|
|
|
|
RegisterPayload(rtp_payload_type, format));
|
|
|
|
|
neteq_->RegisterPayloadType(rtp_payload_type, format);
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
TEST_F(NetEqImplTest, RemovePayloadType) {
|
2014-03-12 05:55:10 +00:00
|
|
|
CreateInstance();
|
2013-01-29 12:09:21 +00:00
|
|
|
uint8_t rtp_payload_type = 0;
|
2014-03-12 05:55:10 +00:00
|
|
|
EXPECT_CALL(*mock_decoder_database_, Remove(rtp_payload_type))
|
2013-01-29 12:09:21 +00:00
|
|
|
.WillOnce(Return(DecoderDatabase::kDecoderNotFound));
|
2017-06-14 12:29:03 +02:00
|
|
|
// Check that kOK is returned when database returns kDecoderNotFound, because
|
|
|
|
|
// removing a payload type that was never registered is not an error.
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->RemovePayloadType(rtp_payload_type));
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2016-09-20 04:02:25 -07:00
|
|
|
TEST_F(NetEqImplTest, RemoveAllPayloadTypes) {
|
|
|
|
|
CreateInstance();
|
|
|
|
|
EXPECT_CALL(*mock_decoder_database_, RemoveAll()).WillOnce(Return());
|
|
|
|
|
neteq_->RemoveAllPayloadTypes();
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
TEST_F(NetEqImplTest, InsertPacket) {
|
2020-10-14 17:54:22 +02:00
|
|
|
using ::testing::AllOf;
|
|
|
|
|
using ::testing::Field;
|
2014-03-12 05:55:10 +00:00
|
|
|
CreateInstance();
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
const size_t kPayloadLength = 100;
|
2013-01-29 12:09:21 +00:00
|
|
|
const uint8_t kPayloadType = 0;
|
|
|
|
|
const uint16_t kFirstSequenceNumber = 0x1234;
|
|
|
|
|
const uint32_t kFirstTimestamp = 0x12345678;
|
|
|
|
|
const uint32_t kSsrc = 0x87654321;
|
|
|
|
|
uint8_t payload[kPayloadLength] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = kFirstSequenceNumber;
|
|
|
|
|
rtp_header.timestamp = kFirstTimestamp;
|
|
|
|
|
rtp_header.ssrc = kSsrc;
|
2016-10-18 04:06:13 -07:00
|
|
|
Packet fake_packet;
|
|
|
|
|
fake_packet.payload_type = kPayloadType;
|
|
|
|
|
fake_packet.sequence_number = kFirstSequenceNumber;
|
|
|
|
|
fake_packet.timestamp = kFirstTimestamp;
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2021-04-27 14:43:08 +02:00
|
|
|
auto mock_decoder_factory = rtc::make_ref_counted<MockAudioDecoderFactory>();
|
2018-02-27 13:37:31 +01:00
|
|
|
EXPECT_CALL(*mock_decoder_factory, MakeAudioDecoderMock(_, _, _))
|
Don't capture variables explicitly in lambda expression.
As it is, the test fails to compile on some downstream compilers with the following error:
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:25: error: lambda capture 'kPayloadLength' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:41: error: lambda capture 'kFirstSequenceNumber' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:63: error: lambda capture 'kFirstTimestamp' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:317:25: error: lambda capture 'kFirstReceiveTime' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
kFirstReceiveTime](const SdpAudioFormat& format,
BUG=webrtc:7107
Review-Url: https://codereview.webrtc.org/2672823002
Cr-Commit-Position: refs/heads/master@{#16422}
2017-02-02 11:51:21 -08:00
|
|
|
.WillOnce(Invoke([&](const SdpAudioFormat& format,
|
2018-06-19 13:26:36 +02:00
|
|
|
absl::optional<AudioCodecPairId> codec_pair_id,
|
Don't capture variables explicitly in lambda expression.
As it is, the test fails to compile on some downstream compilers with the following error:
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:25: error: lambda capture 'kPayloadLength' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:41: error: lambda capture 'kFirstSequenceNumber' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:63: error: lambda capture 'kFirstTimestamp' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:317:25: error: lambda capture 'kFirstReceiveTime' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
kFirstReceiveTime](const SdpAudioFormat& format,
BUG=webrtc:7107
Review-Url: https://codereview.webrtc.org/2672823002
Cr-Commit-Position: refs/heads/master@{#16422}
2017-02-02 11:51:21 -08:00
|
|
|
std::unique_ptr<AudioDecoder>* dec) {
|
2016-05-31 06:28:03 -07:00
|
|
|
EXPECT_EQ("pcmu", format.name);
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<MockAudioDecoder> mock_decoder(new MockAudioDecoder);
|
|
|
|
|
EXPECT_CALL(*mock_decoder, Channels()).WillRepeatedly(Return(1));
|
|
|
|
|
EXPECT_CALL(*mock_decoder, SampleRateHz()).WillRepeatedly(Return(8000));
|
|
|
|
|
EXPECT_CALL(*mock_decoder, Die()).Times(1); // Called when deleted.
|
|
|
|
|
|
|
|
|
|
*dec = std::move(mock_decoder);
|
|
|
|
|
}));
|
2019-01-11 09:36:13 +01:00
|
|
|
DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1),
|
|
|
|
|
absl::nullopt, mock_decoder_factory);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Expectations for decoder database.
|
2014-03-12 05:55:10 +00:00
|
|
|
EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType))
|
2013-01-29 12:09:21 +00:00
|
|
|
.WillRepeatedly(Return(&info));
|
|
|
|
|
|
|
|
|
|
// Expectations for packet buffer.
|
2014-03-12 05:55:10 +00:00
|
|
|
EXPECT_CALL(*mock_packet_buffer_, Empty())
|
|
|
|
|
.WillOnce(Return(false)); // Called once after first packet is inserted.
|
2020-11-25 11:32:40 +01:00
|
|
|
EXPECT_CALL(*mock_packet_buffer_, Flush(_)).Times(1);
|
|
|
|
|
EXPECT_CALL(*mock_packet_buffer_, InsertPacketList(_, _, _, _, _, _, _, _))
|
2013-01-29 12:09:21 +00:00
|
|
|
.Times(2)
|
2017-11-16 15:31:38 +01:00
|
|
|
.WillRepeatedly(DoAll(SetArgPointee<2>(kPayloadType),
|
|
|
|
|
WithArg<0>(Invoke(DeletePacketsAndReturnOk))));
|
2013-01-29 12:09:21 +00:00
|
|
|
// SetArgPointee<2>(kPayloadType) means that the third argument (zero-based
|
|
|
|
|
// index) is a pointer, and the variable pointed to is set to kPayloadType.
|
|
|
|
|
// Also invoke the function DeletePacketsAndReturnOk to properly delete all
|
|
|
|
|
// packets in the list (to avoid memory leaks in the test).
|
2016-10-18 04:06:13 -07:00
|
|
|
EXPECT_CALL(*mock_packet_buffer_, PeekNextPacket())
|
2013-10-01 22:01:09 +00:00
|
|
|
.Times(1)
|
2016-10-18 04:06:13 -07:00
|
|
|
.WillOnce(Return(&fake_packet));
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Expectations for DTMF buffer.
|
2014-03-12 05:55:10 +00:00
|
|
|
EXPECT_CALL(*mock_dtmf_buffer_, Flush()).Times(1);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Expectations for delay manager.
|
|
|
|
|
{
|
|
|
|
|
// All expectations within this block must be called in this specific order.
|
|
|
|
|
InSequence sequence; // Dummy variable.
|
|
|
|
|
// Expectations when the first packet is inserted.
|
2020-10-14 17:54:22 +02:00
|
|
|
EXPECT_CALL(
|
|
|
|
|
*mock_neteq_controller_,
|
|
|
|
|
PacketArrived(
|
|
|
|
|
/*fs_hz*/ 8000,
|
|
|
|
|
/*should_update_stats*/ _,
|
|
|
|
|
/*info*/
|
|
|
|
|
AllOf(
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::is_cng_or_dtmf,
|
|
|
|
|
false),
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::main_sequence_number,
|
|
|
|
|
kFirstSequenceNumber),
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::main_timestamp,
|
|
|
|
|
kFirstTimestamp))));
|
|
|
|
|
EXPECT_CALL(
|
|
|
|
|
*mock_neteq_controller_,
|
|
|
|
|
PacketArrived(
|
|
|
|
|
/*fs_hz*/ 8000,
|
|
|
|
|
/*should_update_stats*/ _,
|
|
|
|
|
/*info*/
|
|
|
|
|
AllOf(
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::is_cng_or_dtmf,
|
|
|
|
|
false),
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::main_sequence_number,
|
|
|
|
|
kFirstSequenceNumber + 1),
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::main_timestamp,
|
|
|
|
|
kFirstTimestamp + 160))));
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Insert first packet.
|
2019-10-10 14:23:00 +02:00
|
|
|
neteq_->InsertPacket(rtp_header, payload);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Insert second packet.
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.timestamp += 160;
|
|
|
|
|
rtp_header.sequenceNumber += 1;
|
2019-10-10 14:23:00 +02:00
|
|
|
neteq_->InsertPacket(rtp_header, payload);
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2014-03-12 05:55:10 +00:00
|
|
|
TEST_F(NetEqImplTest, InsertPacketsUntilBufferIsFull) {
|
|
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance();
|
|
|
|
|
|
|
|
|
|
const int kPayloadLengthSamples = 80;
|
|
|
|
|
const size_t kPayloadLengthBytes = 2 * kPayloadLengthSamples; // PCM 16-bit.
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2014-03-12 05:55:10 +00:00
|
|
|
|
2019-01-10 16:55:06 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("l16", 8000, 1)));
|
2014-03-12 05:55:10 +00:00
|
|
|
|
|
|
|
|
// Insert packets. The buffer should not flush.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
for (size_t i = 1; i <= config_.max_packets_in_buffer; ++i) {
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.timestamp += kPayloadLengthSamples;
|
|
|
|
|
rtp_header.sequenceNumber += 1;
|
2014-03-12 05:55:10 +00:00
|
|
|
EXPECT_EQ(i, packet_buffer_->NumPacketsInBuffer());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Insert one more packet and make sure the buffer got flushed. That is, it
|
|
|
|
|
// should only hold one single packet.
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
EXPECT_EQ(1u, packet_buffer_->NumPacketsInBuffer());
|
2016-10-18 04:06:13 -07:00
|
|
|
const Packet* test_packet = packet_buffer_->PeekNextPacket();
|
2017-04-24 09:14:32 -07:00
|
|
|
EXPECT_EQ(rtp_header.timestamp, test_packet->timestamp);
|
|
|
|
|
EXPECT_EQ(rtp_header.sequenceNumber, test_packet->sequence_number);
|
2014-03-12 05:55:10 +00:00
|
|
|
}
|
|
|
|
|
|
2016-11-17 04:45:19 -08:00
|
|
|
TEST_F(NetEqImplTest, TestDtmfPacketAVT) {
|
2019-01-10 16:55:06 +01:00
|
|
|
TestDtmfPacket(8000);
|
2016-11-17 04:45:19 -08:00
|
|
|
}
|
2016-10-11 04:35:34 -07:00
|
|
|
|
2016-11-17 04:45:19 -08:00
|
|
|
TEST_F(NetEqImplTest, TestDtmfPacketAVT16kHz) {
|
2019-01-10 16:55:06 +01:00
|
|
|
TestDtmfPacket(16000);
|
2016-11-17 04:45:19 -08:00
|
|
|
}
|
2016-10-11 04:35:34 -07:00
|
|
|
|
2016-11-17 04:45:19 -08:00
|
|
|
TEST_F(NetEqImplTest, TestDtmfPacketAVT32kHz) {
|
2019-01-10 16:55:06 +01:00
|
|
|
TestDtmfPacket(32000);
|
2016-11-17 04:45:19 -08:00
|
|
|
}
|
2016-10-11 04:35:34 -07:00
|
|
|
|
2016-11-17 04:45:19 -08:00
|
|
|
TEST_F(NetEqImplTest, TestDtmfPacketAVT48kHz) {
|
2019-01-10 16:55:06 +01:00
|
|
|
TestDtmfPacket(48000);
|
2016-10-11 04:35:34 -07:00
|
|
|
}
|
|
|
|
|
|
2014-04-07 21:21:45 +00:00
|
|
|
// This test verifies that timestamps propagate from the incoming packets
|
|
|
|
|
// through to the sync buffer and to the playout timestamp.
|
|
|
|
|
TEST_F(NetEqImplTest, VerifyTimestampPropagation) {
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateHz = 8000;
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kPayloadLengthSamples =
|
|
|
|
|
static_cast<size_t>(10 * kSampleRateHz / 1000); // 10 ms.
|
2014-04-07 21:21:45 +00:00
|
|
|
const size_t kPayloadLengthBytes = kPayloadLengthSamples;
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
rtp_header.numCSRCs = 3;
|
|
|
|
|
rtp_header.arrOfCSRCs[0] = 43;
|
|
|
|
|
rtp_header.arrOfCSRCs[1] = 65;
|
|
|
|
|
rtp_header.arrOfCSRCs[2] = 17;
|
2014-04-07 21:21:45 +00:00
|
|
|
|
|
|
|
|
// This is a dummy decoder that produces as many output samples as the input
|
|
|
|
|
// has bytes. The output is an increasing series, starting at 1 for the first
|
|
|
|
|
// sample, and then increasing by 1 for each sample.
|
|
|
|
|
class CountingSamplesDecoder : public AudioDecoder {
|
|
|
|
|
public:
|
2014-11-04 11:51:46 +00:00
|
|
|
CountingSamplesDecoder() : next_value_(1) {}
|
2014-04-07 21:21:45 +00:00
|
|
|
|
|
|
|
|
// Produce as many samples as input bytes (|encoded_len|).
|
2015-12-08 13:41:35 +01:00
|
|
|
int DecodeInternal(const uint8_t* encoded,
|
|
|
|
|
size_t encoded_len,
|
|
|
|
|
int /* sample_rate_hz */,
|
|
|
|
|
int16_t* decoded,
|
|
|
|
|
SpeechType* speech_type) override {
|
2014-04-07 21:21:45 +00:00
|
|
|
for (size_t i = 0; i < encoded_len; ++i) {
|
|
|
|
|
decoded[i] = next_value_++;
|
|
|
|
|
}
|
|
|
|
|
*speech_type = kSpeech;
|
2017-10-19 09:00:17 +02:00
|
|
|
return rtc::checked_cast<int>(encoded_len);
|
2014-04-07 21:21:45 +00:00
|
|
|
}
|
|
|
|
|
|
2015-08-27 15:22:11 +02:00
|
|
|
void Reset() override { next_value_ = 1; }
|
2014-04-07 21:21:45 +00:00
|
|
|
|
2016-06-16 01:59:09 -07:00
|
|
|
int SampleRateHz() const override { return kSampleRateHz; }
|
|
|
|
|
|
2015-03-18 09:47:08 +00:00
|
|
|
size_t Channels() const override { return 1; }
|
|
|
|
|
|
2014-04-07 21:21:45 +00:00
|
|
|
uint16_t next_value() const { return next_value_; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int16_t next_value_;
|
2014-11-04 11:51:46 +00:00
|
|
|
} decoder_;
|
2014-04-07 21:21:45 +00:00
|
|
|
|
2021-04-27 14:43:08 +02:00
|
|
|
auto decoder_factory =
|
|
|
|
|
rtc::make_ref_counted<test::AudioDecoderProxyFactory>(&decoder_);
|
2018-12-06 13:07:11 +01:00
|
|
|
|
|
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance(decoder_factory);
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
2018-12-07 15:24:42 +01:00
|
|
|
SdpAudioFormat("L16", 8000, 1)));
|
2014-04-07 21:21:45 +00:00
|
|
|
|
|
|
|
|
// Insert one packet.
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
clock_.AdvanceTimeMilliseconds(123456);
|
2021-04-30 13:10:56 +02:00
|
|
|
Timestamp expected_receive_time = clock_.CurrentTime();
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2014-04-07 21:21:45 +00:00
|
|
|
|
|
|
|
|
// Pull audio once.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateHz / 1000);
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
ASSERT_FALSE(muted);
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
|
2014-04-07 21:21:45 +00:00
|
|
|
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
// Verify |output.packet_infos_|.
|
|
|
|
|
ASSERT_THAT(output.packet_infos_, SizeIs(1));
|
|
|
|
|
{
|
|
|
|
|
const auto& packet_info = output.packet_infos_[0];
|
|
|
|
|
EXPECT_EQ(packet_info.ssrc(), rtp_header.ssrc);
|
|
|
|
|
EXPECT_THAT(packet_info.csrcs(), ElementsAre(43, 65, 17));
|
|
|
|
|
EXPECT_EQ(packet_info.rtp_timestamp(), rtp_header.timestamp);
|
|
|
|
|
EXPECT_FALSE(packet_info.audio_level().has_value());
|
2021-04-30 13:10:56 +02:00
|
|
|
EXPECT_EQ(packet_info.receive_time(), expected_receive_time);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
}
|
|
|
|
|
|
2014-04-07 21:21:45 +00:00
|
|
|
// Start with a simple check that the fake decoder is behaving as expected.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
EXPECT_EQ(kPayloadLengthSamples,
|
|
|
|
|
static_cast<size_t>(decoder_.next_value() - 1));
|
2014-04-07 21:21:45 +00:00
|
|
|
|
|
|
|
|
// The value of the last of the output samples is the same as the number of
|
|
|
|
|
// samples played from the decoded packet. Thus, this number + the RTP
|
|
|
|
|
// timestamp should match the playout timestamp.
|
2018-06-19 13:26:36 +02:00
|
|
|
// Wrap the expected value in an absl::optional to compare them as such.
|
2016-04-06 01:39:22 -07:00
|
|
|
EXPECT_EQ(
|
2018-06-19 13:26:36 +02:00
|
|
|
absl::optional<uint32_t>(rtp_header.timestamp +
|
|
|
|
|
output.data()[output.samples_per_channel_ - 1]),
|
2016-04-06 01:39:22 -07:00
|
|
|
neteq_->GetPlayoutTimestamp());
|
2014-04-07 21:21:45 +00:00
|
|
|
|
|
|
|
|
// Check the timestamp for the last value in the sync buffer. This should
|
|
|
|
|
// be one full frame length ahead of the RTP timestamp.
|
|
|
|
|
const SyncBuffer* sync_buffer = neteq_->sync_buffer_for_test();
|
|
|
|
|
ASSERT_TRUE(sync_buffer != NULL);
|
2017-04-24 09:14:32 -07:00
|
|
|
EXPECT_EQ(rtp_header.timestamp + kPayloadLengthSamples,
|
2014-04-07 21:21:45 +00:00
|
|
|
sync_buffer->end_timestamp());
|
|
|
|
|
|
|
|
|
|
// Check that the number of samples still to play from the sync buffer add
|
|
|
|
|
// up with what was already played out.
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(
|
2017-06-12 12:45:32 -07:00
|
|
|
kPayloadLengthSamples - output.data()[output.samples_per_channel_ - 1],
|
2016-03-04 10:34:21 -08:00
|
|
|
sync_buffer->FutureLength());
|
2014-04-07 21:21:45 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-04 14:03:58 +00:00
|
|
|
TEST_F(NetEqImplTest, ReorderedPacket) {
|
|
|
|
|
UseNoMocks();
|
2018-12-07 15:24:42 +01:00
|
|
|
// Create a mock decoder object.
|
|
|
|
|
MockAudioDecoder mock_decoder;
|
|
|
|
|
|
|
|
|
|
CreateInstance(
|
2021-04-27 14:43:08 +02:00
|
|
|
rtc::make_ref_counted<test::AudioDecoderProxyFactory>(&mock_decoder));
|
2014-11-04 14:03:58 +00:00
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateHz = 8000;
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kPayloadLengthSamples =
|
|
|
|
|
static_cast<size_t>(10 * kSampleRateHz / 1000); // 10 ms.
|
2014-11-04 14:03:58 +00:00
|
|
|
const size_t kPayloadLengthBytes = kPayloadLengthSamples;
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
rtp_header.extension.hasAudioLevel = true;
|
|
|
|
|
rtp_header.extension.audioLevel = 42;
|
2014-11-04 14:03:58 +00:00
|
|
|
|
2015-08-27 15:22:11 +02:00
|
|
|
EXPECT_CALL(mock_decoder, Reset()).WillRepeatedly(Return());
|
2016-06-16 03:18:00 -07:00
|
|
|
EXPECT_CALL(mock_decoder, SampleRateHz())
|
|
|
|
|
.WillRepeatedly(Return(kSampleRateHz));
|
2015-03-18 09:47:08 +00:00
|
|
|
EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1));
|
2016-04-27 06:11:50 -07:00
|
|
|
EXPECT_CALL(mock_decoder, PacketDuration(_, kPayloadLengthBytes))
|
2017-10-19 11:40:55 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kPayloadLengthSamples)));
|
2014-11-04 14:03:58 +00:00
|
|
|
int16_t dummy_output[kPayloadLengthSamples] = {0};
|
|
|
|
|
// The below expectation will make the mock decoder write
|
|
|
|
|
// |kPayloadLengthSamples| zeros to the output array, and mark it as speech.
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder, DecodeInternal(Pointee(0), kPayloadLengthBytes,
|
|
|
|
|
kSampleRateHz, _, _))
|
|
|
|
|
.WillOnce(DoAll(SetArrayArgument<3>(dummy_output,
|
2014-11-04 14:03:58 +00:00
|
|
|
dummy_output + kPayloadLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kPayloadLengthSamples))));
|
2018-12-07 15:24:42 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("L16", 8000, 1)));
|
2014-11-04 14:03:58 +00:00
|
|
|
|
|
|
|
|
// Insert one packet.
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
clock_.AdvanceTimeMilliseconds(123456);
|
2021-04-30 13:10:56 +02:00
|
|
|
Timestamp expected_receive_time = clock_.CurrentTime();
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2014-11-04 14:03:58 +00:00
|
|
|
|
|
|
|
|
// Pull audio once.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateHz / 1000);
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
|
2014-11-04 14:03:58 +00:00
|
|
|
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
// Verify |output.packet_infos_|.
|
|
|
|
|
ASSERT_THAT(output.packet_infos_, SizeIs(1));
|
|
|
|
|
{
|
|
|
|
|
const auto& packet_info = output.packet_infos_[0];
|
|
|
|
|
EXPECT_EQ(packet_info.ssrc(), rtp_header.ssrc);
|
|
|
|
|
EXPECT_THAT(packet_info.csrcs(), IsEmpty());
|
|
|
|
|
EXPECT_EQ(packet_info.rtp_timestamp(), rtp_header.timestamp);
|
|
|
|
|
EXPECT_EQ(packet_info.audio_level(), rtp_header.extension.audioLevel);
|
2021-04-30 13:10:56 +02:00
|
|
|
EXPECT_EQ(packet_info.receive_time(), expected_receive_time);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-04 14:03:58 +00:00
|
|
|
// Insert two more packets. The first one is out of order, and is already too
|
|
|
|
|
// old, the second one is the expected next packet.
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.sequenceNumber -= 1;
|
|
|
|
|
rtp_header.timestamp -= kPayloadLengthSamples;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
rtp_header.extension.audioLevel = 1;
|
2014-11-04 14:03:58 +00:00
|
|
|
payload[0] = 1;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
clock_.AdvanceTimeMilliseconds(1000);
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.sequenceNumber += 2;
|
|
|
|
|
rtp_header.timestamp += 2 * kPayloadLengthSamples;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
rtp_header.extension.audioLevel = 2;
|
2014-11-04 14:03:58 +00:00
|
|
|
payload[0] = 2;
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
clock_.AdvanceTimeMilliseconds(2000);
|
2021-04-30 13:10:56 +02:00
|
|
|
expected_receive_time = clock_.CurrentTime();
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2014-11-04 14:03:58 +00:00
|
|
|
|
|
|
|
|
// Expect only the second packet to be decoded (the one with "2" as the first
|
|
|
|
|
// payload byte).
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder, DecodeInternal(Pointee(2), kPayloadLengthBytes,
|
|
|
|
|
kSampleRateHz, _, _))
|
|
|
|
|
.WillOnce(DoAll(SetArrayArgument<3>(dummy_output,
|
2014-11-04 14:03:58 +00:00
|
|
|
dummy_output + kPayloadLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kPayloadLengthSamples))));
|
2014-11-04 14:03:58 +00:00
|
|
|
|
|
|
|
|
// Pull audio once.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
|
2014-11-04 14:03:58 +00:00
|
|
|
|
|
|
|
|
// Now check the packet buffer, and make sure it is empty, since the
|
|
|
|
|
// out-of-order packet should have been discarded.
|
|
|
|
|
EXPECT_TRUE(packet_buffer_->Empty());
|
|
|
|
|
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
// Verify |output.packet_infos_|. Expect to only see the second packet.
|
|
|
|
|
ASSERT_THAT(output.packet_infos_, SizeIs(1));
|
|
|
|
|
{
|
|
|
|
|
const auto& packet_info = output.packet_infos_[0];
|
|
|
|
|
EXPECT_EQ(packet_info.ssrc(), rtp_header.ssrc);
|
|
|
|
|
EXPECT_THAT(packet_info.csrcs(), IsEmpty());
|
|
|
|
|
EXPECT_EQ(packet_info.rtp_timestamp(), rtp_header.timestamp);
|
|
|
|
|
EXPECT_EQ(packet_info.audio_level(), rtp_header.extension.audioLevel);
|
2021-04-30 13:10:56 +02:00
|
|
|
EXPECT_EQ(packet_info.receive_time(), expected_receive_time);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-04 14:03:58 +00:00
|
|
|
EXPECT_CALL(mock_decoder, Die());
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-20 11:01:02 +00:00
|
|
|
// This test verifies that NetEq can handle the situation where the first
|
|
|
|
|
// incoming packet is rejected.
|
2014-11-20 14:14:49 +00:00
|
|
|
TEST_F(NetEqImplTest, FirstPacketUnknown) {
|
2014-11-20 11:01:02 +00:00
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance();
|
|
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateHz = 8000;
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kPayloadLengthSamples =
|
|
|
|
|
static_cast<size_t>(10 * kSampleRateHz / 1000); // 10 ms.
|
2016-10-13 02:43:34 -07:00
|
|
|
const size_t kPayloadLengthBytes = kPayloadLengthSamples * 2;
|
2014-11-20 11:01:02 +00:00
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2014-11-20 11:01:02 +00:00
|
|
|
|
|
|
|
|
// Insert one packet. Note that we have not registered any payload type, so
|
|
|
|
|
// this packet will be rejected.
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kFail, neteq_->InsertPacket(rtp_header, payload));
|
2014-11-20 11:01:02 +00:00
|
|
|
|
|
|
|
|
// Pull audio once.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateHz / 1000);
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_LE(output.samples_per_channel_, kMaxOutputSize);
|
|
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kPLC, output.speech_type_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, IsEmpty());
|
2014-11-20 11:01:02 +00:00
|
|
|
|
|
|
|
|
// Register the payload type.
|
2019-01-10 16:55:06 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("l16", 8000, 1)));
|
2014-11-20 11:01:02 +00:00
|
|
|
|
|
|
|
|
// Insert 10 packets.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
for (size_t i = 0; i < 10; ++i) {
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.sequenceNumber++;
|
|
|
|
|
rtp_header.timestamp += kPayloadLengthSamples;
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2014-11-20 11:01:02 +00:00
|
|
|
EXPECT_EQ(i + 1, packet_buffer_->NumPacketsInBuffer());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Pull audio repeatedly and make sure we get normal output, that is not PLC.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
for (size_t i = 0; i < 3; ++i) {
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_LE(output.samples_per_channel_, kMaxOutputSize);
|
|
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_)
|
2014-11-20 11:01:02 +00:00
|
|
|
<< "NetEq did not decode the packets as expected.";
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, SizeIs(1));
|
2014-11-20 11:01:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
2014-12-09 10:46:39 +00:00
|
|
|
|
2019-04-26 09:47:07 +02:00
|
|
|
// This test verifies that audio interruption is not logged for the initial
|
|
|
|
|
// PLC period before the first packet is deocoded.
|
|
|
|
|
// TODO(henrik.lundin) Maybe move this test to neteq_network_stats_unittest.cc.
|
2019-11-19 12:58:11 +01:00
|
|
|
// Make the test parametrized, so that we can test with different initial
|
|
|
|
|
// sample rates in NetEq.
|
|
|
|
|
class NetEqImplTestSampleRateParameter
|
|
|
|
|
: public NetEqImplTest,
|
|
|
|
|
public testing::WithParamInterface<int> {
|
|
|
|
|
protected:
|
|
|
|
|
NetEqImplTestSampleRateParameter()
|
|
|
|
|
: NetEqImplTest(), initial_sample_rate_hz_(GetParam()) {
|
|
|
|
|
config_.sample_rate_hz = initial_sample_rate_hz_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int initial_sample_rate_hz_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// This test does the following:
|
|
|
|
|
// 0. Set up NetEq with initial sample rate given by test parameter, and a codec
|
|
|
|
|
// sample rate of 16000.
|
|
|
|
|
// 1. Start calling GetAudio before inserting any encoded audio. The audio
|
|
|
|
|
// produced will be PLC.
|
|
|
|
|
// 2. Insert a number of encoded audio packets.
|
|
|
|
|
// 3. Keep calling GetAudio and verify that no audio interruption was logged.
|
|
|
|
|
// Call GetAudio until NetEq runs out of data again; PLC starts.
|
|
|
|
|
// 4. Insert one more packet.
|
|
|
|
|
// 5. Call GetAudio until that packet is decoded and the PLC ends.
|
|
|
|
|
|
|
|
|
|
TEST_P(NetEqImplTestSampleRateParameter,
|
|
|
|
|
NoAudioInterruptionLoggedBeforeFirstDecode) {
|
2019-04-26 09:47:07 +02:00
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance();
|
|
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
2019-11-19 12:58:11 +01:00
|
|
|
const int kPayloadSampleRateHz = 16000;
|
2019-04-26 09:47:07 +02:00
|
|
|
const size_t kPayloadLengthSamples =
|
2019-11-19 12:58:11 +01:00
|
|
|
static_cast<size_t>(10 * kPayloadSampleRateHz / 1000); // 10 ms.
|
2019-04-26 09:47:07 +02:00
|
|
|
const size_t kPayloadLengthBytes = kPayloadLengthSamples * 2;
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
|
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
|
|
|
|
|
|
|
|
|
// Register the payload type.
|
2019-11-19 12:58:11 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(
|
|
|
|
|
kPayloadType, SdpAudioFormat("l16", kPayloadSampleRateHz, 1)));
|
2019-04-26 09:47:07 +02:00
|
|
|
|
|
|
|
|
// Pull audio several times. No packets have been inserted yet.
|
2019-11-19 12:58:11 +01:00
|
|
|
const size_t initial_output_size =
|
|
|
|
|
static_cast<size_t>(10 * initial_sample_rate_hz_ / 1000); // 10 ms
|
2019-04-26 09:47:07 +02:00
|
|
|
AudioFrame output;
|
|
|
|
|
bool muted;
|
|
|
|
|
for (int i = 0; i < 100; ++i) {
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2019-11-19 12:58:11 +01:00
|
|
|
EXPECT_EQ(initial_output_size, output.samples_per_channel_);
|
2019-04-26 09:47:07 +02:00
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
|
|
|
|
EXPECT_NE(AudioFrame::kNormalSpeech, output.speech_type_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, IsEmpty());
|
2019-04-26 09:47:07 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-19 12:58:11 +01:00
|
|
|
// Lambda for inserting packets.
|
|
|
|
|
auto insert_packet = [&]() {
|
2019-04-26 09:47:07 +02:00
|
|
|
rtp_header.sequenceNumber++;
|
|
|
|
|
rtp_header.timestamp += kPayloadLengthSamples;
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2019-11-19 12:58:11 +01:00
|
|
|
};
|
|
|
|
|
// Insert 10 packets.
|
|
|
|
|
for (size_t i = 0; i < 10; ++i) {
|
|
|
|
|
insert_packet();
|
2019-04-26 09:47:07 +02:00
|
|
|
EXPECT_EQ(i + 1, packet_buffer_->NumPacketsInBuffer());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Pull audio repeatedly and make sure we get normal output, that is not PLC.
|
2019-11-19 12:58:11 +01:00
|
|
|
constexpr size_t kOutputSize =
|
|
|
|
|
static_cast<size_t>(10 * kPayloadSampleRateHz / 1000); // 10 ms
|
2019-04-26 09:47:07 +02:00
|
|
|
for (size_t i = 0; i < 3; ++i) {
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2019-11-19 12:58:11 +01:00
|
|
|
EXPECT_EQ(kOutputSize, output.samples_per_channel_);
|
2019-04-26 09:47:07 +02:00
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
|
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_)
|
|
|
|
|
<< "NetEq did not decode the packets as expected.";
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, SizeIs(1));
|
2019-04-26 09:47:07 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-19 12:58:11 +01:00
|
|
|
// Verify that no interruption was logged.
|
2019-04-26 09:47:07 +02:00
|
|
|
auto lifetime_stats = neteq_->GetLifetimeStatistics();
|
2019-04-29 17:00:46 +02:00
|
|
|
EXPECT_EQ(0, lifetime_stats.interruption_count);
|
2019-11-19 12:58:11 +01:00
|
|
|
|
|
|
|
|
// Keep pulling audio data until a new PLC period is started.
|
|
|
|
|
size_t count_loops = 0;
|
|
|
|
|
while (output.speech_type_ == AudioFrame::kNormalSpeech) {
|
|
|
|
|
// Make sure we don't hang the test if we never go to PLC.
|
|
|
|
|
ASSERT_LT(++count_loops, 100u);
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-09 13:41:06 +02:00
|
|
|
// Insert a few packets to avoid postpone decoding after expand.
|
|
|
|
|
for (size_t i = 0; i < 5; ++i) {
|
|
|
|
|
insert_packet();
|
|
|
|
|
}
|
2019-11-19 12:58:11 +01:00
|
|
|
|
|
|
|
|
// Pull audio until the newly inserted packet is decoded and the PLC ends.
|
|
|
|
|
while (output.speech_type_ != AudioFrame::kNormalSpeech) {
|
|
|
|
|
// Make sure we don't hang the test if we never go to PLC.
|
|
|
|
|
ASSERT_LT(++count_loops, 100u);
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Verify that no interruption was logged.
|
|
|
|
|
lifetime_stats = neteq_->GetLifetimeStatistics();
|
|
|
|
|
EXPECT_EQ(0, lifetime_stats.interruption_count);
|
2019-04-26 09:47:07 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-19 12:58:11 +01:00
|
|
|
// This test does the following:
|
|
|
|
|
// 0. Set up NetEq with initial sample rate given by test parameter, and a codec
|
|
|
|
|
// sample rate of 16000.
|
|
|
|
|
// 1. Insert a number of encoded audio packets.
|
|
|
|
|
// 2. Call GetAudio and verify that decoded audio is produced.
|
|
|
|
|
// 3. Keep calling GetAudio until NetEq runs out of data; PLC starts.
|
|
|
|
|
// 4. Keep calling GetAudio until PLC has been produced for at least 150 ms.
|
|
|
|
|
// 5. Insert one more packet.
|
|
|
|
|
// 6. Call GetAudio until that packet is decoded and the PLC ends.
|
|
|
|
|
// 7. Verify that an interruption was logged.
|
|
|
|
|
|
|
|
|
|
TEST_P(NetEqImplTestSampleRateParameter, AudioInterruptionLogged) {
|
|
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance();
|
|
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kPayloadSampleRateHz = 16000;
|
|
|
|
|
const size_t kPayloadLengthSamples =
|
|
|
|
|
static_cast<size_t>(10 * kPayloadSampleRateHz / 1000); // 10 ms.
|
|
|
|
|
const size_t kPayloadLengthBytes = kPayloadLengthSamples * 2;
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
|
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
|
|
|
|
|
|
|
|
|
// Register the payload type.
|
|
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(
|
|
|
|
|
kPayloadType, SdpAudioFormat("l16", kPayloadSampleRateHz, 1)));
|
|
|
|
|
|
|
|
|
|
// Lambda for inserting packets.
|
|
|
|
|
auto insert_packet = [&]() {
|
|
|
|
|
rtp_header.sequenceNumber++;
|
|
|
|
|
rtp_header.timestamp += kPayloadLengthSamples;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
|
|
|
|
};
|
|
|
|
|
// Insert 10 packets.
|
|
|
|
|
for (size_t i = 0; i < 10; ++i) {
|
|
|
|
|
insert_packet();
|
|
|
|
|
EXPECT_EQ(i + 1, packet_buffer_->NumPacketsInBuffer());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AudioFrame output;
|
|
|
|
|
bool muted;
|
|
|
|
|
// Keep pulling audio data until a new PLC period is started.
|
|
|
|
|
size_t count_loops = 0;
|
|
|
|
|
do {
|
|
|
|
|
// Make sure we don't hang the test if we never go to PLC.
|
|
|
|
|
ASSERT_LT(++count_loops, 100u);
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
} while (output.speech_type_ == AudioFrame::kNormalSpeech);
|
|
|
|
|
|
|
|
|
|
// Pull audio 15 times, which produces 150 ms of output audio. This should
|
|
|
|
|
// all be produced as PLC. The total length of the gap will then be 150 ms
|
|
|
|
|
// plus an initial fraction of 10 ms at the start and the end of the PLC
|
|
|
|
|
// period. In total, less than 170 ms.
|
|
|
|
|
for (size_t i = 0; i < 15; ++i) {
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
EXPECT_NE(AudioFrame::kNormalSpeech, output.speech_type_);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-09 13:41:06 +02:00
|
|
|
// Insert a few packets to avoid postpone decoding after expand.
|
|
|
|
|
for (size_t i = 0; i < 5; ++i) {
|
|
|
|
|
insert_packet();
|
|
|
|
|
}
|
2019-11-19 12:58:11 +01:00
|
|
|
|
|
|
|
|
// Pull audio until the newly inserted packet is decoded and the PLC ends.
|
|
|
|
|
while (output.speech_type_ != AudioFrame::kNormalSpeech) {
|
|
|
|
|
// Make sure we don't hang the test if we never go to PLC.
|
|
|
|
|
ASSERT_LT(++count_loops, 100u);
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Verify that the interruption was logged.
|
|
|
|
|
auto lifetime_stats = neteq_->GetLifetimeStatistics();
|
|
|
|
|
EXPECT_EQ(1, lifetime_stats.interruption_count);
|
|
|
|
|
EXPECT_GT(lifetime_stats.total_interruption_duration_ms, 150);
|
|
|
|
|
EXPECT_LT(lifetime_stats.total_interruption_duration_ms, 170);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
INSTANTIATE_TEST_SUITE_P(SampleRates,
|
|
|
|
|
NetEqImplTestSampleRateParameter,
|
|
|
|
|
testing::Values(8000, 16000, 32000, 48000));
|
|
|
|
|
|
2014-12-09 10:46:39 +00:00
|
|
|
// This test verifies that NetEq can handle comfort noise and enters/quits codec
|
|
|
|
|
// internal CNG mode properly.
|
|
|
|
|
TEST_F(NetEqImplTest, CodecInternalCng) {
|
|
|
|
|
UseNoMocks();
|
2018-12-11 14:43:21 +01:00
|
|
|
// Create a mock decoder object.
|
|
|
|
|
MockAudioDecoder mock_decoder;
|
|
|
|
|
CreateInstance(
|
2021-04-27 14:43:08 +02:00
|
|
|
rtc::make_ref_counted<test::AudioDecoderProxyFactory>(&mock_decoder));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateKhz = 48;
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kPayloadLengthSamples =
|
|
|
|
|
static_cast<size_t>(20 * kSampleRateKhz); // 20 ms.
|
|
|
|
|
const size_t kPayloadLengthBytes = 10;
|
2014-12-09 10:46:39 +00:00
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
|
|
|
|
int16_t dummy_output[kPayloadLengthSamples] = {0};
|
|
|
|
|
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2014-12-09 10:46:39 +00:00
|
|
|
|
2015-08-27 15:22:11 +02:00
|
|
|
EXPECT_CALL(mock_decoder, Reset()).WillRepeatedly(Return());
|
2016-06-16 03:18:00 -07:00
|
|
|
EXPECT_CALL(mock_decoder, SampleRateHz())
|
|
|
|
|
.WillRepeatedly(Return(kSampleRateKhz * 1000));
|
2015-03-18 09:47:08 +00:00
|
|
|
EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1));
|
2016-04-06 12:28:26 -07:00
|
|
|
EXPECT_CALL(mock_decoder, PacketDuration(_, kPayloadLengthBytes))
|
2017-10-20 11:18:47 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kPayloadLengthSamples)));
|
2016-04-06 12:28:26 -07:00
|
|
|
// Packed duration when asking the decoder for more CNG data (without a new
|
|
|
|
|
// packet).
|
|
|
|
|
EXPECT_CALL(mock_decoder, PacketDuration(nullptr, 0))
|
2017-10-20 11:18:47 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kPayloadLengthSamples)));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
|
|
|
|
// Pointee(x) verifies that first byte of the payload equals x, this makes it
|
|
|
|
|
// possible to verify that the correct payload is fed to Decode().
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder, DecodeInternal(Pointee(0), kPayloadLengthBytes,
|
|
|
|
|
kSampleRateKhz * 1000, _, _))
|
|
|
|
|
.WillOnce(DoAll(SetArrayArgument<3>(dummy_output,
|
2014-12-09 10:46:39 +00:00
|
|
|
dummy_output + kPayloadLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kPayloadLengthSamples))));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder, DecodeInternal(Pointee(1), kPayloadLengthBytes,
|
|
|
|
|
kSampleRateKhz * 1000, _, _))
|
|
|
|
|
.WillOnce(DoAll(SetArrayArgument<3>(dummy_output,
|
2014-12-09 10:46:39 +00:00
|
|
|
dummy_output + kPayloadLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kComfortNoise),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kPayloadLengthSamples))));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder,
|
|
|
|
|
DecodeInternal(IsNull(), 0, kSampleRateKhz * 1000, _, _))
|
|
|
|
|
.WillOnce(DoAll(SetArrayArgument<3>(dummy_output,
|
2014-12-09 10:46:39 +00:00
|
|
|
dummy_output + kPayloadLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kComfortNoise),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kPayloadLengthSamples))));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder, DecodeInternal(Pointee(2), kPayloadLengthBytes,
|
|
|
|
|
kSampleRateKhz * 1000, _, _))
|
|
|
|
|
.WillOnce(DoAll(SetArrayArgument<3>(dummy_output,
|
2014-12-09 10:46:39 +00:00
|
|
|
dummy_output + kPayloadLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kPayloadLengthSamples))));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
2018-12-11 14:43:21 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("opus", 48000, 2)));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateKhz);
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-03-08 02:37:57 -08:00
|
|
|
AudioFrame::SpeechType expected_type[8] = {
|
|
|
|
|
AudioFrame::kNormalSpeech, AudioFrame::kNormalSpeech, AudioFrame::kCNG,
|
|
|
|
|
AudioFrame::kCNG, AudioFrame::kCNG, AudioFrame::kCNG,
|
|
|
|
|
AudioFrame::kNormalSpeech, AudioFrame::kNormalSpeech};
|
2014-12-09 10:46:39 +00:00
|
|
|
int expected_timestamp_increment[8] = {
|
|
|
|
|
-1, // will not be used.
|
|
|
|
|
10 * kSampleRateKhz,
|
2016-04-06 12:28:26 -07:00
|
|
|
-1,
|
|
|
|
|
-1, // timestamp will be empty during CNG mode; indicated by -1 here.
|
|
|
|
|
-1,
|
|
|
|
|
-1,
|
2014-12-09 10:46:39 +00:00
|
|
|
50 * kSampleRateKhz,
|
|
|
|
|
10 * kSampleRateKhz};
|
|
|
|
|
|
2021-01-15 17:44:56 +01:00
|
|
|
// Insert one packet (decoder will return speech).
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
|
|
|
|
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2018-06-19 13:26:36 +02:00
|
|
|
absl::optional<uint32_t> last_timestamp = neteq_->GetPlayoutTimestamp();
|
2016-04-06 01:39:22 -07:00
|
|
|
ASSERT_TRUE(last_timestamp);
|
2014-12-09 10:46:39 +00:00
|
|
|
|
2021-01-15 17:44:56 +01:00
|
|
|
// Insert second packet (decoder will return CNG).
|
|
|
|
|
payload[0] = 1;
|
|
|
|
|
rtp_header.sequenceNumber++;
|
|
|
|
|
rtp_header.timestamp += kPayloadLengthSamples;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
|
|
|
|
|
2016-04-06 12:28:26 -07:00
|
|
|
// Lambda for verifying the timestamps.
|
|
|
|
|
auto verify_timestamp = [&last_timestamp, &expected_timestamp_increment](
|
2018-06-19 13:26:36 +02:00
|
|
|
absl::optional<uint32_t> ts, size_t i) {
|
2016-04-06 12:28:26 -07:00
|
|
|
if (expected_timestamp_increment[i] == -1) {
|
|
|
|
|
// Expect to get an empty timestamp value during CNG and PLC.
|
|
|
|
|
EXPECT_FALSE(ts) << "i = " << i;
|
|
|
|
|
} else {
|
|
|
|
|
ASSERT_TRUE(ts) << "i = " << i;
|
|
|
|
|
EXPECT_EQ(*ts, *last_timestamp + expected_timestamp_increment[i])
|
|
|
|
|
<< "i = " << i;
|
|
|
|
|
last_timestamp = ts;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
for (size_t i = 1; i < 6; ++i) {
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(expected_type[i - 1], output.speech_type_);
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-04-06 12:28:26 -07:00
|
|
|
SCOPED_TRACE("");
|
|
|
|
|
verify_timestamp(neteq_->GetPlayoutTimestamp(), i);
|
2014-12-09 10:46:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Insert third packet, which leaves a gap from last packet.
|
|
|
|
|
payload[0] = 2;
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.sequenceNumber += 2;
|
|
|
|
|
rtp_header.timestamp += 2 * kPayloadLengthSamples;
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2014-12-09 10:46:39 +00:00
|
|
|
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
for (size_t i = 6; i < 8; ++i) {
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(expected_type[i - 1], output.speech_type_);
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-04-06 12:28:26 -07:00
|
|
|
SCOPED_TRACE("");
|
|
|
|
|
verify_timestamp(neteq_->GetPlayoutTimestamp(), i);
|
2014-12-09 10:46:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Now check the packet buffer, and make sure it is empty.
|
|
|
|
|
EXPECT_TRUE(packet_buffer_->Empty());
|
|
|
|
|
|
|
|
|
|
EXPECT_CALL(mock_decoder, Die());
|
|
|
|
|
}
|
2015-03-16 12:30:37 +00:00
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest, UnsupportedDecoder) {
|
|
|
|
|
UseNoMocks();
|
2018-12-07 15:24:42 +01:00
|
|
|
::testing::NiceMock<MockAudioDecoder> decoder;
|
|
|
|
|
|
|
|
|
|
CreateInstance(
|
2021-04-27 14:43:08 +02:00
|
|
|
rtc::make_ref_counted<test::AudioDecoderProxyFactory>(&decoder));
|
2016-05-02 04:46:11 -07:00
|
|
|
static const size_t kNetEqMaxFrameSize = 5760; // 120 ms @ 48 kHz.
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
static const size_t kChannels = 2;
|
2015-03-16 12:30:37 +00:00
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateHz = 8000;
|
|
|
|
|
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t kPayloadLengthSamples =
|
|
|
|
|
static_cast<size_t>(10 * kSampleRateHz / 1000); // 10 ms.
|
2015-03-16 12:30:37 +00:00
|
|
|
const size_t kPayloadLengthBytes = 1;
|
2016-05-02 04:46:11 -07:00
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2015-05-25 13:49:37 +02:00
|
|
|
int16_t dummy_output[kPayloadLengthSamples * kChannels] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2015-03-16 12:30:37 +00:00
|
|
|
|
|
|
|
|
const uint8_t kFirstPayloadValue = 1;
|
|
|
|
|
const uint8_t kSecondPayloadValue = 2;
|
|
|
|
|
|
2016-09-20 01:38:00 -07:00
|
|
|
EXPECT_CALL(decoder,
|
|
|
|
|
PacketDuration(Pointee(kFirstPayloadValue), kPayloadLengthBytes))
|
|
|
|
|
.Times(AtLeast(1))
|
2017-10-20 11:18:47 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kNetEqMaxFrameSize + 1)));
|
2015-03-16 12:30:37 +00:00
|
|
|
|
2016-09-20 01:38:00 -07:00
|
|
|
EXPECT_CALL(decoder, DecodeInternal(Pointee(kFirstPayloadValue), _, _, _, _))
|
2015-03-16 12:30:37 +00:00
|
|
|
.Times(0);
|
|
|
|
|
|
2016-09-20 01:38:00 -07:00
|
|
|
EXPECT_CALL(decoder, DecodeInternal(Pointee(kSecondPayloadValue),
|
|
|
|
|
kPayloadLengthBytes, kSampleRateHz, _, _))
|
2015-03-16 12:30:37 +00:00
|
|
|
.Times(1)
|
2016-09-20 01:38:00 -07:00
|
|
|
.WillOnce(DoAll(
|
|
|
|
|
SetArrayArgument<3>(dummy_output,
|
|
|
|
|
dummy_output + kPayloadLengthSamples * kChannels),
|
|
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
|
|
|
|
Return(static_cast<int>(kPayloadLengthSamples * kChannels))));
|
|
|
|
|
|
|
|
|
|
EXPECT_CALL(decoder,
|
|
|
|
|
PacketDuration(Pointee(kSecondPayloadValue), kPayloadLengthBytes))
|
|
|
|
|
.Times(AtLeast(1))
|
2017-10-20 11:18:47 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kNetEqMaxFrameSize)));
|
2016-09-20 01:38:00 -07:00
|
|
|
|
|
|
|
|
EXPECT_CALL(decoder, SampleRateHz()).WillRepeatedly(Return(kSampleRateHz));
|
2015-03-16 12:30:37 +00:00
|
|
|
|
2016-09-20 01:38:00 -07:00
|
|
|
EXPECT_CALL(decoder, Channels()).WillRepeatedly(Return(kChannels));
|
2015-03-16 12:30:37 +00:00
|
|
|
|
2018-12-07 15:24:42 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("L16", 8000, 1)));
|
2015-03-16 12:30:37 +00:00
|
|
|
|
|
|
|
|
// Insert one packet.
|
|
|
|
|
payload[0] = kFirstPayloadValue; // This will make Decode() fail.
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2015-03-16 12:30:37 +00:00
|
|
|
|
|
|
|
|
// Insert another packet.
|
|
|
|
|
payload[0] = kSecondPayloadValue; // This will make Decode() successful.
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.sequenceNumber++;
|
2015-03-16 12:30:37 +00:00
|
|
|
// The second timestamp needs to be at least 30 ms after the first to make
|
|
|
|
|
// the second packet get decoded.
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.timestamp += 3 * kPayloadLengthSamples;
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2015-03-16 12:30:37 +00:00
|
|
|
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
2016-03-04 10:34:21 -08:00
|
|
|
// First call to GetAudio will try to decode the "faulty" packet.
|
2017-06-14 12:29:03 +02:00
|
|
|
// Expect kFail return value.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kFail, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
// Output size and number of channels should be correct.
|
|
|
|
|
const size_t kExpectedOutputSize = 10 * (kSampleRateHz / 1000) * kChannels;
|
|
|
|
|
EXPECT_EQ(kExpectedOutputSize, output.samples_per_channel_ * kChannels);
|
|
|
|
|
EXPECT_EQ(kChannels, output.num_channels_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, IsEmpty());
|
2016-03-04 10:34:21 -08:00
|
|
|
|
|
|
|
|
// Second call to GetAudio will decode the packet that is ok. No errors are
|
|
|
|
|
// expected.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kExpectedOutputSize, output.samples_per_channel_ * kChannels);
|
|
|
|
|
EXPECT_EQ(kChannels, output.num_channels_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, SizeIs(1));
|
2016-09-20 01:38:00 -07:00
|
|
|
|
|
|
|
|
// Die isn't called through NiceMock (since it's called by the
|
|
|
|
|
// MockAudioDecoder constructor), so it needs to be mocked explicitly.
|
|
|
|
|
EXPECT_CALL(decoder, Die());
|
2015-03-16 12:30:37 +00:00
|
|
|
}
|
|
|
|
|
|
NetEq: Fixing a bug that caused rtc::checked_cast to trigger
This is a bug that was introduced in
https://codereview.webrtc.org/1230503003, where the variable "int
temp_bufsize" was changed to a size_t. If the packet buffer was
flushed while inserting a packet, temp_bufsize became negative, which
was tested later in an if-statement. Now, with size_t instead, it
would just become very large, and the if-statement would never see a
negative value. The effect was that the packet size in samples could
be updated with a very large positive number, causing an overflow
which triggered rtc::checked_cast in
StatisticsCalculator::GetNetworkStatistics, line 220.
Also adding a test to reproduce the crash. Without the fix, the test
results in the above mentioned checked_cast to trigger. With the fix,
everything works fine.
BUG=chromium:525260
Review URL: https://codereview.webrtc.org/1307893004
Cr-Commit-Position: refs/heads/master@{#9802}
2015-08-27 13:14:48 -07:00
|
|
|
// This test inserts packets until the buffer is flushed. After that, it asks
|
|
|
|
|
// NetEq for the network statistics. The purpose of the test is to make sure
|
|
|
|
|
// that even though the buffer size increment is negative (which it becomes when
|
|
|
|
|
// the packet causing a flush is inserted), the packet length stored in the
|
|
|
|
|
// decision logic remains valid.
|
|
|
|
|
TEST_F(NetEqImplTest, FloodBufferAndGetNetworkStats) {
|
|
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance();
|
|
|
|
|
|
|
|
|
|
const size_t kPayloadLengthSamples = 80;
|
|
|
|
|
const size_t kPayloadLengthBytes = 2 * kPayloadLengthSamples; // PCM 16-bit.
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
NetEq: Fixing a bug that caused rtc::checked_cast to trigger
This is a bug that was introduced in
https://codereview.webrtc.org/1230503003, where the variable "int
temp_bufsize" was changed to a size_t. If the packet buffer was
flushed while inserting a packet, temp_bufsize became negative, which
was tested later in an if-statement. Now, with size_t instead, it
would just become very large, and the if-statement would never see a
negative value. The effect was that the packet size in samples could
be updated with a very large positive number, causing an overflow
which triggered rtc::checked_cast in
StatisticsCalculator::GetNetworkStatistics, line 220.
Also adding a test to reproduce the crash. Without the fix, the test
results in the above mentioned checked_cast to trigger. With the fix,
everything works fine.
BUG=chromium:525260
Review URL: https://codereview.webrtc.org/1307893004
Cr-Commit-Position: refs/heads/master@{#9802}
2015-08-27 13:14:48 -07:00
|
|
|
|
2019-01-10 16:55:06 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("l16", 8000, 1)));
|
NetEq: Fixing a bug that caused rtc::checked_cast to trigger
This is a bug that was introduced in
https://codereview.webrtc.org/1230503003, where the variable "int
temp_bufsize" was changed to a size_t. If the packet buffer was
flushed while inserting a packet, temp_bufsize became negative, which
was tested later in an if-statement. Now, with size_t instead, it
would just become very large, and the if-statement would never see a
negative value. The effect was that the packet size in samples could
be updated with a very large positive number, causing an overflow
which triggered rtc::checked_cast in
StatisticsCalculator::GetNetworkStatistics, line 220.
Also adding a test to reproduce the crash. Without the fix, the test
results in the above mentioned checked_cast to trigger. With the fix,
everything works fine.
BUG=chromium:525260
Review URL: https://codereview.webrtc.org/1307893004
Cr-Commit-Position: refs/heads/master@{#9802}
2015-08-27 13:14:48 -07:00
|
|
|
|
|
|
|
|
// Insert packets until the buffer flushes.
|
|
|
|
|
for (size_t i = 0; i <= config_.max_packets_in_buffer; ++i) {
|
|
|
|
|
EXPECT_EQ(i, packet_buffer_->NumPacketsInBuffer());
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.timestamp += rtc::checked_cast<uint32_t>(kPayloadLengthSamples);
|
|
|
|
|
++rtp_header.sequenceNumber;
|
NetEq: Fixing a bug that caused rtc::checked_cast to trigger
This is a bug that was introduced in
https://codereview.webrtc.org/1230503003, where the variable "int
temp_bufsize" was changed to a size_t. If the packet buffer was
flushed while inserting a packet, temp_bufsize became negative, which
was tested later in an if-statement. Now, with size_t instead, it
would just become very large, and the if-statement would never see a
negative value. The effect was that the packet size in samples could
be updated with a very large positive number, causing an overflow
which triggered rtc::checked_cast in
StatisticsCalculator::GetNetworkStatistics, line 220.
Also adding a test to reproduce the crash. Without the fix, the test
results in the above mentioned checked_cast to trigger. With the fix,
everything works fine.
BUG=chromium:525260
Review URL: https://codereview.webrtc.org/1307893004
Cr-Commit-Position: refs/heads/master@{#9802}
2015-08-27 13:14:48 -07:00
|
|
|
}
|
|
|
|
|
EXPECT_EQ(1u, packet_buffer_->NumPacketsInBuffer());
|
|
|
|
|
|
|
|
|
|
// Ask for network statistics. This should not crash.
|
|
|
|
|
NetEqNetworkStatistics stats;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->NetworkStatistics(&stats));
|
|
|
|
|
}
|
2015-09-01 11:51:58 +02:00
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest, DecodedPayloadTooShort) {
|
|
|
|
|
UseNoMocks();
|
2018-12-07 15:24:42 +01:00
|
|
|
// Create a mock decoder object.
|
|
|
|
|
MockAudioDecoder mock_decoder;
|
|
|
|
|
|
|
|
|
|
CreateInstance(
|
2021-04-27 14:43:08 +02:00
|
|
|
rtc::make_ref_counted<test::AudioDecoderProxyFactory>(&mock_decoder));
|
2015-09-01 11:51:58 +02:00
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateHz = 8000;
|
|
|
|
|
const size_t kPayloadLengthSamples =
|
|
|
|
|
static_cast<size_t>(10 * kSampleRateHz / 1000); // 10 ms.
|
|
|
|
|
const size_t kPayloadLengthBytes = 2 * kPayloadLengthSamples;
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2015-09-01 11:51:58 +02:00
|
|
|
|
|
|
|
|
EXPECT_CALL(mock_decoder, Reset()).WillRepeatedly(Return());
|
2016-06-16 03:18:00 -07:00
|
|
|
EXPECT_CALL(mock_decoder, SampleRateHz())
|
|
|
|
|
.WillRepeatedly(Return(kSampleRateHz));
|
2015-09-01 11:51:58 +02:00
|
|
|
EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1));
|
|
|
|
|
EXPECT_CALL(mock_decoder, PacketDuration(_, _))
|
2017-10-20 11:18:47 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kPayloadLengthSamples)));
|
2015-09-01 11:51:58 +02:00
|
|
|
int16_t dummy_output[kPayloadLengthSamples] = {0};
|
|
|
|
|
// The below expectation will make the mock decoder write
|
|
|
|
|
// |kPayloadLengthSamples| - 5 zeros to the output array, and mark it as
|
|
|
|
|
// speech. That is, the decoded length is 5 samples shorter than the expected.
|
|
|
|
|
EXPECT_CALL(mock_decoder,
|
2015-12-08 13:41:35 +01:00
|
|
|
DecodeInternal(_, kPayloadLengthBytes, kSampleRateHz, _, _))
|
2015-09-01 11:51:58 +02:00
|
|
|
.WillOnce(
|
2015-12-08 13:41:35 +01:00
|
|
|
DoAll(SetArrayArgument<3>(dummy_output,
|
2015-09-01 11:51:58 +02:00
|
|
|
dummy_output + kPayloadLengthSamples - 5),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kPayloadLengthSamples - 5))));
|
2018-12-07 15:24:42 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("L16", 8000, 1)));
|
2015-09-01 11:51:58 +02:00
|
|
|
|
|
|
|
|
// Insert one packet.
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2015-09-01 11:51:58 +02:00
|
|
|
|
|
|
|
|
EXPECT_EQ(5u, neteq_->sync_buffer_for_test()->FutureLength());
|
|
|
|
|
|
|
|
|
|
// Pull audio once.
|
|
|
|
|
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateHz / 1000);
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
ASSERT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, SizeIs(1));
|
2015-09-01 11:51:58 +02:00
|
|
|
|
|
|
|
|
EXPECT_CALL(mock_decoder, Die());
|
|
|
|
|
}
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// This test checks the behavior of NetEq when audio decoder fails.
|
|
|
|
|
TEST_F(NetEqImplTest, DecodingError) {
|
|
|
|
|
UseNoMocks();
|
2018-12-07 15:24:42 +01:00
|
|
|
// Create a mock decoder object.
|
|
|
|
|
MockAudioDecoder mock_decoder;
|
|
|
|
|
|
|
|
|
|
CreateInstance(
|
2021-04-27 14:43:08 +02:00
|
|
|
rtc::make_ref_counted<test::AudioDecoderProxyFactory>(&mock_decoder));
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateHz = 8000;
|
|
|
|
|
const int kDecoderErrorCode = -97; // Any negative number.
|
|
|
|
|
|
|
|
|
|
// We let decoder return 5 ms each time, and therefore, 2 packets make 10 ms.
|
|
|
|
|
const size_t kFrameLengthSamples =
|
|
|
|
|
static_cast<size_t>(5 * kSampleRateHz / 1000);
|
|
|
|
|
|
|
|
|
|
const size_t kPayloadLengthBytes = 1; // This can be arbitrary.
|
|
|
|
|
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
|
|
|
|
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
EXPECT_CALL(mock_decoder, Reset()).WillRepeatedly(Return());
|
2016-06-16 03:18:00 -07:00
|
|
|
EXPECT_CALL(mock_decoder, SampleRateHz())
|
|
|
|
|
.WillRepeatedly(Return(kSampleRateHz));
|
2015-09-23 15:20:39 +02:00
|
|
|
EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1));
|
|
|
|
|
EXPECT_CALL(mock_decoder, PacketDuration(_, _))
|
2017-10-20 11:18:47 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kFrameLengthSamples)));
|
2015-09-23 15:20:39 +02:00
|
|
|
EXPECT_CALL(mock_decoder, ErrorCode()).WillOnce(Return(kDecoderErrorCode));
|
|
|
|
|
EXPECT_CALL(mock_decoder, HasDecodePlc()).WillOnce(Return(false));
|
|
|
|
|
int16_t dummy_output[kFrameLengthSamples] = {0};
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
InSequence sequence; // Dummy variable.
|
|
|
|
|
// Mock decoder works normally the first time.
|
|
|
|
|
EXPECT_CALL(mock_decoder,
|
2015-12-08 13:41:35 +01:00
|
|
|
DecodeInternal(_, kPayloadLengthBytes, kSampleRateHz, _, _))
|
2015-09-23 15:20:39 +02:00
|
|
|
.Times(3)
|
|
|
|
|
.WillRepeatedly(
|
2015-12-08 13:41:35 +01:00
|
|
|
DoAll(SetArrayArgument<3>(dummy_output,
|
2015-09-23 15:20:39 +02:00
|
|
|
dummy_output + kFrameLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kFrameLengthSamples))))
|
2015-09-23 15:20:39 +02:00
|
|
|
.RetiresOnSaturation();
|
|
|
|
|
|
|
|
|
|
// Then mock decoder fails. A common reason for failure can be buffer being
|
|
|
|
|
// too short
|
|
|
|
|
EXPECT_CALL(mock_decoder,
|
2015-12-08 13:41:35 +01:00
|
|
|
DecodeInternal(_, kPayloadLengthBytes, kSampleRateHz, _, _))
|
2015-09-23 15:20:39 +02:00
|
|
|
.WillOnce(Return(-1))
|
|
|
|
|
.RetiresOnSaturation();
|
|
|
|
|
|
|
|
|
|
// Mock decoder finally returns to normal.
|
|
|
|
|
EXPECT_CALL(mock_decoder,
|
2015-12-08 13:41:35 +01:00
|
|
|
DecodeInternal(_, kPayloadLengthBytes, kSampleRateHz, _, _))
|
2015-09-23 15:20:39 +02:00
|
|
|
.Times(2)
|
|
|
|
|
.WillRepeatedly(
|
2015-12-08 13:41:35 +01:00
|
|
|
DoAll(SetArrayArgument<3>(dummy_output,
|
|
|
|
|
dummy_output + kFrameLengthSamples),
|
|
|
|
|
SetArgPointee<4>(AudioDecoder::kSpeech),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kFrameLengthSamples))));
|
2015-09-23 15:20:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-12-07 15:24:42 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("L16", 8000, 1)));
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// Insert packets.
|
2020-10-09 13:41:06 +02:00
|
|
|
for (int i = 0; i < 20; ++i) {
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.sequenceNumber += 1;
|
|
|
|
|
rtp_header.timestamp += kFrameLengthSamples;
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2015-09-23 15:20:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Pull audio.
|
|
|
|
|
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateHz / 1000);
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, SizeIs(2)); // 5 ms packets vs 10 ms output
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// Pull audio again. Decoder fails.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kFail, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
// We are not expecting anything for output.speech_type_, since an error was
|
|
|
|
|
// returned.
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// Pull audio again, should continue an expansion.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kPLC, output.speech_type_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, IsEmpty());
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// Pull audio again, should behave normal.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
EXPECT_THAT(output.packet_infos_, SizeIs(2)); // 5 ms packets vs 10 ms output
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
EXPECT_CALL(mock_decoder, Die());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This test checks the behavior of NetEq when audio decoder fails during CNG.
|
|
|
|
|
TEST_F(NetEqImplTest, DecodingErrorDuringInternalCng) {
|
|
|
|
|
UseNoMocks();
|
2018-12-11 14:43:21 +01:00
|
|
|
|
|
|
|
|
// Create a mock decoder object.
|
|
|
|
|
MockAudioDecoder mock_decoder;
|
|
|
|
|
CreateInstance(
|
2021-04-27 14:43:08 +02:00
|
|
|
rtc::make_ref_counted<test::AudioDecoderProxyFactory>(&mock_decoder));
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
const int kSampleRateHz = 8000;
|
|
|
|
|
const int kDecoderErrorCode = -97; // Any negative number.
|
|
|
|
|
|
|
|
|
|
// We let decoder return 5 ms each time, and therefore, 2 packets make 10 ms.
|
|
|
|
|
const size_t kFrameLengthSamples =
|
|
|
|
|
static_cast<size_t>(5 * kSampleRateHz / 1000);
|
|
|
|
|
|
|
|
|
|
const size_t kPayloadLengthBytes = 1; // This can be arbitrary.
|
|
|
|
|
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
|
|
|
|
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
EXPECT_CALL(mock_decoder, Reset()).WillRepeatedly(Return());
|
2016-06-16 03:18:00 -07:00
|
|
|
EXPECT_CALL(mock_decoder, SampleRateHz())
|
|
|
|
|
.WillRepeatedly(Return(kSampleRateHz));
|
2015-09-23 15:20:39 +02:00
|
|
|
EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1));
|
|
|
|
|
EXPECT_CALL(mock_decoder, PacketDuration(_, _))
|
2017-10-20 11:18:47 +02:00
|
|
|
.WillRepeatedly(Return(rtc::checked_cast<int>(kFrameLengthSamples)));
|
2015-09-23 15:20:39 +02:00
|
|
|
EXPECT_CALL(mock_decoder, ErrorCode()).WillOnce(Return(kDecoderErrorCode));
|
|
|
|
|
int16_t dummy_output[kFrameLengthSamples] = {0};
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
InSequence sequence; // Dummy variable.
|
|
|
|
|
// Mock decoder works normally the first 2 times.
|
|
|
|
|
EXPECT_CALL(mock_decoder,
|
2015-12-08 13:41:35 +01:00
|
|
|
DecodeInternal(_, kPayloadLengthBytes, kSampleRateHz, _, _))
|
2015-09-23 15:20:39 +02:00
|
|
|
.Times(2)
|
|
|
|
|
.WillRepeatedly(
|
2015-12-08 13:41:35 +01:00
|
|
|
DoAll(SetArrayArgument<3>(dummy_output,
|
2015-09-23 15:20:39 +02:00
|
|
|
dummy_output + kFrameLengthSamples),
|
2015-12-08 13:41:35 +01:00
|
|
|
SetArgPointee<4>(AudioDecoder::kComfortNoise),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kFrameLengthSamples))))
|
2015-09-23 15:20:39 +02:00
|
|
|
.RetiresOnSaturation();
|
|
|
|
|
|
|
|
|
|
// Then mock decoder fails. A common reason for failure can be buffer being
|
|
|
|
|
// too short
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder, DecodeInternal(nullptr, 0, kSampleRateHz, _, _))
|
2015-09-23 15:20:39 +02:00
|
|
|
.WillOnce(Return(-1))
|
|
|
|
|
.RetiresOnSaturation();
|
|
|
|
|
|
|
|
|
|
// Mock decoder finally returns to normal.
|
2015-12-08 13:41:35 +01:00
|
|
|
EXPECT_CALL(mock_decoder, DecodeInternal(nullptr, 0, kSampleRateHz, _, _))
|
2015-09-23 15:20:39 +02:00
|
|
|
.Times(2)
|
|
|
|
|
.WillRepeatedly(
|
2015-12-08 13:41:35 +01:00
|
|
|
DoAll(SetArrayArgument<3>(dummy_output,
|
|
|
|
|
dummy_output + kFrameLengthSamples),
|
|
|
|
|
SetArgPointee<4>(AudioDecoder::kComfortNoise),
|
2017-10-20 11:18:47 +02:00
|
|
|
Return(rtc::checked_cast<int>(kFrameLengthSamples))));
|
2015-09-23 15:20:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-12-11 14:43:21 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("l16", 8000, 1)));
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// Insert 2 packets. This will make netEq into codec internal CNG mode.
|
|
|
|
|
for (int i = 0; i < 2; ++i) {
|
2017-04-24 09:14:32 -07:00
|
|
|
rtp_header.sequenceNumber += 1;
|
|
|
|
|
rtp_header.timestamp += kFrameLengthSamples;
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2015-09-23 15:20:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Pull audio.
|
|
|
|
|
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateHz / 1000);
|
2016-03-04 10:34:21 -08:00
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kCNG, output.speech_type_);
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// Pull audio again. Decoder fails.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kFail, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
// We are not expecting anything for output.speech_type_, since an error was
|
|
|
|
|
// returned.
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
// Pull audio again, should resume codec CNG.
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-03-04 10:34:21 -08:00
|
|
|
EXPECT_EQ(kMaxOutputSize, output.samples_per_channel_);
|
|
|
|
|
EXPECT_EQ(1u, output.num_channels_);
|
2016-03-08 02:37:57 -08:00
|
|
|
EXPECT_EQ(AudioFrame::kCNG, output.speech_type_);
|
2015-09-23 15:20:39 +02:00
|
|
|
|
|
|
|
|
EXPECT_CALL(mock_decoder, Die());
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-23 06:49:25 -08:00
|
|
|
// Tests that the return value from last_output_sample_rate_hz() is equal to the
|
|
|
|
|
// configured inital sample rate.
|
|
|
|
|
TEST_F(NetEqImplTest, InitialLastOutputSampleRate) {
|
|
|
|
|
UseNoMocks();
|
|
|
|
|
config_.sample_rate_hz = 48000;
|
|
|
|
|
CreateInstance();
|
|
|
|
|
EXPECT_EQ(48000, neteq_->last_output_sample_rate_hz());
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-25 10:11:38 -07:00
|
|
|
TEST_F(NetEqImplTest, TickTimerIncrement) {
|
|
|
|
|
UseNoMocks();
|
|
|
|
|
CreateInstance();
|
|
|
|
|
ASSERT_TRUE(tick_timer_);
|
|
|
|
|
EXPECT_EQ(0u, tick_timer_->ticks());
|
|
|
|
|
AudioFrame output;
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
2016-04-25 10:11:38 -07:00
|
|
|
EXPECT_EQ(1u, tick_timer_->ticks());
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-05 13:49:26 +01:00
|
|
|
TEST_F(NetEqImplTest, SetBaseMinimumDelay) {
|
|
|
|
|
UseNoMocks();
|
2019-10-24 15:20:39 +02:00
|
|
|
use_mock_neteq_controller_ = true;
|
2019-02-05 13:49:26 +01:00
|
|
|
CreateInstance();
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, SetBaseMinimumDelay(_))
|
2019-02-05 13:49:26 +01:00
|
|
|
.WillOnce(Return(true))
|
|
|
|
|
.WillOnce(Return(false));
|
|
|
|
|
|
|
|
|
|
const int delay_ms = 200;
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(true, neteq_->SetBaseMinimumDelayMs(delay_ms));
|
|
|
|
|
EXPECT_EQ(false, neteq_->SetBaseMinimumDelayMs(delay_ms));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest, GetBaseMinimumDelayMs) {
|
|
|
|
|
UseNoMocks();
|
2019-10-24 15:20:39 +02:00
|
|
|
use_mock_neteq_controller_ = true;
|
2019-02-05 13:49:26 +01:00
|
|
|
CreateInstance();
|
|
|
|
|
|
|
|
|
|
const int delay_ms = 200;
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, GetBaseMinimumDelay())
|
2019-02-05 13:49:26 +01:00
|
|
|
.WillOnce(Return(delay_ms));
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(delay_ms, neteq_->GetBaseMinimumDelayMs());
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-26 07:47:32 -07:00
|
|
|
TEST_F(NetEqImplTest, TargetDelayMs) {
|
|
|
|
|
UseNoMocks();
|
2019-10-24 15:20:39 +02:00
|
|
|
use_mock_neteq_controller_ = true;
|
2017-04-26 07:47:32 -07:00
|
|
|
CreateInstance();
|
2019-10-24 15:20:39 +02:00
|
|
|
constexpr int kTargetLevelMs = 510;
|
|
|
|
|
EXPECT_CALL(*mock_neteq_controller_, TargetLevelMs())
|
|
|
|
|
.WillOnce(Return(kTargetLevelMs));
|
|
|
|
|
EXPECT_EQ(510, neteq_->TargetDelayMs());
|
2017-04-26 07:47:32 -07:00
|
|
|
}
|
|
|
|
|
|
Handle padded audio packets correctly
RTP packets can be padded with extra data at the end of the payload. The usable
payload length of the packet should then be reduced with the padding length,
since the padding must be discarded. This was not the case; instead, the entire
payload, including padding data, was forwarded to the audio channel and in the
end to the decoder.
A special case of padding is packets which are empty except for the padding.
That is, they carry no usable payload. These packets are sometimes used for
probing the network and were discarded in
RTPReceiverAudio::ParseAudioCodecSpecific. The result is that NetEq never sees
those empty packets, just the holes in the sequence number series; this can
throw off the target buffer calculations.
With this change, the empty (after removing the padding) packets are let through,
all the way down to NetEq, to a new method called NetEq::InsertEmptyPacket. This
method notifies the DelayManager that an empty packet was received.
BUG=webrtc:7610, webrtc:7625
Review-Url: https://codereview.webrtc.org/2870043003
Cr-Commit-Position: refs/heads/master@{#18083}
2017-05-10 07:38:01 -07:00
|
|
|
TEST_F(NetEqImplTest, InsertEmptyPacket) {
|
|
|
|
|
UseNoMocks();
|
2019-10-24 15:20:39 +02:00
|
|
|
use_mock_neteq_controller_ = true;
|
Handle padded audio packets correctly
RTP packets can be padded with extra data at the end of the payload. The usable
payload length of the packet should then be reduced with the padding length,
since the padding must be discarded. This was not the case; instead, the entire
payload, including padding data, was forwarded to the audio channel and in the
end to the decoder.
A special case of padding is packets which are empty except for the padding.
That is, they carry no usable payload. These packets are sometimes used for
probing the network and were discarded in
RTPReceiverAudio::ParseAudioCodecSpecific. The result is that NetEq never sees
those empty packets, just the holes in the sequence number series; this can
throw off the target buffer calculations.
With this change, the empty (after removing the padding) packets are let through,
all the way down to NetEq, to a new method called NetEq::InsertEmptyPacket. This
method notifies the DelayManager that an empty packet was received.
BUG=webrtc:7610, webrtc:7625
Review-Url: https://codereview.webrtc.org/2870043003
Cr-Commit-Position: refs/heads/master@{#18083}
2017-05-10 07:38:01 -07:00
|
|
|
CreateInstance();
|
|
|
|
|
|
|
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = 17;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, RegisterEmptyPacket());
|
Handle padded audio packets correctly
RTP packets can be padded with extra data at the end of the payload. The usable
payload length of the packet should then be reduced with the padding length,
since the padding must be discarded. This was not the case; instead, the entire
payload, including padding data, was forwarded to the audio channel and in the
end to the decoder.
A special case of padding is packets which are empty except for the padding.
That is, they carry no usable payload. These packets are sometimes used for
probing the network and were discarded in
RTPReceiverAudio::ParseAudioCodecSpecific. The result is that NetEq never sees
those empty packets, just the holes in the sequence number series; this can
throw off the target buffer calculations.
With this change, the empty (after removing the padding) packets are let through,
all the way down to NetEq, to a new method called NetEq::InsertEmptyPacket. This
method notifies the DelayManager that an empty packet was received.
BUG=webrtc:7610, webrtc:7625
Review-Url: https://codereview.webrtc.org/2870043003
Cr-Commit-Position: refs/heads/master@{#18083}
2017-05-10 07:38:01 -07:00
|
|
|
neteq_->InsertEmptyPacket(rtp_header);
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-10 10:28:23 +01:00
|
|
|
TEST_F(NetEqImplTest, EnableRtxHandling) {
|
2020-10-14 17:54:22 +02:00
|
|
|
using ::testing::AllOf;
|
|
|
|
|
using ::testing::Field;
|
2019-01-10 10:28:23 +01:00
|
|
|
UseNoMocks();
|
2019-10-24 15:20:39 +02:00
|
|
|
use_mock_neteq_controller_ = true;
|
2019-01-10 10:28:23 +01:00
|
|
|
config_.enable_rtx_handling = true;
|
|
|
|
|
CreateInstance();
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, GetDecision(_, _))
|
2019-01-10 10:28:23 +01:00
|
|
|
.Times(1)
|
2019-10-31 14:38:11 +01:00
|
|
|
.WillOnce(Return(NetEq::Operation::kNormal));
|
2019-01-10 10:28:23 +01:00
|
|
|
|
|
|
|
|
const int kPayloadLengthSamples = 80;
|
|
|
|
|
const size_t kPayloadLengthBytes = 2 * kPayloadLengthSamples; // PCM 16-bit.
|
|
|
|
|
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
|
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = 0x1234;
|
|
|
|
|
rtp_header.timestamp = 0x12345678;
|
|
|
|
|
rtp_header.ssrc = 0x87654321;
|
|
|
|
|
|
2019-01-10 16:55:06 +01:00
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
|
|
|
|
SdpAudioFormat("l16", 8000, 1)));
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2019-01-10 10:28:23 +01:00
|
|
|
AudioFrame output;
|
|
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
|
|
|
|
|
|
|
|
|
// Insert second packet that was sent before the first packet.
|
|
|
|
|
rtp_header.sequenceNumber -= 1;
|
|
|
|
|
rtp_header.timestamp -= kPayloadLengthSamples;
|
2020-10-14 17:54:22 +02:00
|
|
|
EXPECT_CALL(
|
|
|
|
|
*mock_neteq_controller_,
|
|
|
|
|
PacketArrived(
|
|
|
|
|
/*fs_hz*/ 8000,
|
|
|
|
|
/*should_update_stats*/ _,
|
|
|
|
|
/*info*/
|
|
|
|
|
AllOf(
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::packet_length_samples,
|
|
|
|
|
kPayloadLengthSamples),
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::main_sequence_number,
|
|
|
|
|
rtp_header.sequenceNumber),
|
|
|
|
|
Field(&NetEqController::PacketArrivedInfo::main_timestamp,
|
|
|
|
|
rtp_header.timestamp))));
|
2019-10-24 15:20:39 +02:00
|
|
|
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2019-01-10 10:28:23 +01:00
|
|
|
}
|
|
|
|
|
|
2016-05-02 04:46:11 -07:00
|
|
|
class Decoder120ms : public AudioDecoder {
|
|
|
|
|
public:
|
2016-06-16 01:59:09 -07:00
|
|
|
Decoder120ms(int sample_rate_hz, SpeechType speech_type)
|
|
|
|
|
: sample_rate_hz_(sample_rate_hz),
|
|
|
|
|
next_value_(1),
|
2016-05-02 04:46:11 -07:00
|
|
|
speech_type_(speech_type) {}
|
|
|
|
|
|
|
|
|
|
int DecodeInternal(const uint8_t* encoded,
|
|
|
|
|
size_t encoded_len,
|
|
|
|
|
int sample_rate_hz,
|
|
|
|
|
int16_t* decoded,
|
|
|
|
|
SpeechType* speech_type) override {
|
2016-06-16 01:59:09 -07:00
|
|
|
EXPECT_EQ(sample_rate_hz_, sample_rate_hz);
|
2016-05-02 04:46:11 -07:00
|
|
|
size_t decoded_len =
|
|
|
|
|
rtc::CheckedDivExact(sample_rate_hz, 1000) * 120 * Channels();
|
|
|
|
|
for (size_t i = 0; i < decoded_len; ++i) {
|
|
|
|
|
decoded[i] = next_value_++;
|
|
|
|
|
}
|
|
|
|
|
*speech_type = speech_type_;
|
2017-10-19 09:00:17 +02:00
|
|
|
return rtc::checked_cast<int>(decoded_len);
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Reset() override { next_value_ = 1; }
|
2016-06-16 01:59:09 -07:00
|
|
|
int SampleRateHz() const override { return sample_rate_hz_; }
|
2016-05-02 04:46:11 -07:00
|
|
|
size_t Channels() const override { return 2; }
|
|
|
|
|
|
|
|
|
|
private:
|
2016-06-16 01:59:09 -07:00
|
|
|
int sample_rate_hz_;
|
2016-05-02 04:46:11 -07:00
|
|
|
int16_t next_value_;
|
|
|
|
|
SpeechType speech_type_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class NetEqImplTest120ms : public NetEqImplTest {
|
|
|
|
|
protected:
|
|
|
|
|
NetEqImplTest120ms() : NetEqImplTest() {}
|
|
|
|
|
virtual ~NetEqImplTest120ms() {}
|
|
|
|
|
|
|
|
|
|
void CreateInstanceNoMocks() {
|
|
|
|
|
UseNoMocks();
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstance(decoder_factory_);
|
|
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(
|
|
|
|
|
kPayloadType, SdpAudioFormat("opus", 48000, 2, {{"stereo", "1"}})));
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CreateInstanceWithDelayManagerMock() {
|
|
|
|
|
UseNoMocks();
|
2019-10-24 15:20:39 +02:00
|
|
|
use_mock_neteq_controller_ = true;
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstance(decoder_factory_);
|
|
|
|
|
EXPECT_TRUE(neteq_->RegisterPayloadType(
|
|
|
|
|
kPayloadType, SdpAudioFormat("opus", 48000, 2, {{"stereo", "1"}})));
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t timestamp_diff_between_packets() const {
|
|
|
|
|
return rtc::CheckedDivExact(kSamplingFreq_, 1000u) * 120;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t first_timestamp() const { return 10u; }
|
|
|
|
|
|
|
|
|
|
void GetFirstPacket() {
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
2016-05-02 04:46:11 -07:00
|
|
|
for (int i = 0; i < 12; i++) {
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
|
|
|
|
EXPECT_FALSE(muted);
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void InsertPacket(uint32_t timestamp) {
|
2017-04-24 09:14:32 -07:00
|
|
|
RTPHeader rtp_header;
|
|
|
|
|
rtp_header.payloadType = kPayloadType;
|
|
|
|
|
rtp_header.sequenceNumber = sequence_number_;
|
|
|
|
|
rtp_header.timestamp = timestamp;
|
|
|
|
|
rtp_header.ssrc = 15;
|
2016-05-02 04:46:11 -07:00
|
|
|
const size_t kPayloadLengthBytes = 1; // This can be arbitrary.
|
|
|
|
|
uint8_t payload[kPayloadLengthBytes] = {0};
|
2019-10-10 14:23:00 +02:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));
|
2016-05-02 04:46:11 -07:00
|
|
|
sequence_number_++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register120msCodec(AudioDecoder::SpeechType speech_type) {
|
2018-11-30 10:45:12 +01:00
|
|
|
const uint32_t sampling_freq = kSamplingFreq_;
|
2021-04-27 14:43:08 +02:00
|
|
|
decoder_factory_ = rtc::make_ref_counted<test::FunctionAudioDecoderFactory>(
|
|
|
|
|
[sampling_freq, speech_type]() {
|
|
|
|
|
std::unique_ptr<AudioDecoder> decoder =
|
|
|
|
|
std::make_unique<Decoder120ms>(sampling_freq, speech_type);
|
|
|
|
|
RTC_CHECK_EQ(2, decoder->Channels());
|
|
|
|
|
return decoder;
|
|
|
|
|
});
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
2018-11-30 10:45:12 +01:00
|
|
|
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
|
2016-05-02 04:46:11 -07:00
|
|
|
AudioFrame output_;
|
|
|
|
|
const uint32_t kPayloadType = 17;
|
|
|
|
|
const uint32_t kSamplingFreq_ = 48000;
|
|
|
|
|
uint16_t sequence_number_ = 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest120ms, CodecInternalCng) {
|
|
|
|
|
Register120msCodec(AudioDecoder::kComfortNoise);
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstanceNoMocks();
|
2016-05-02 04:46:11 -07:00
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp());
|
|
|
|
|
GetFirstPacket();
|
|
|
|
|
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
2019-10-31 14:38:11 +01:00
|
|
|
EXPECT_EQ(NetEq::Operation::kCodecInternalCng,
|
|
|
|
|
neteq_->last_operation_for_test());
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest120ms, Normal) {
|
|
|
|
|
Register120msCodec(AudioDecoder::kSpeech);
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstanceNoMocks();
|
2016-05-02 04:46:11 -07:00
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp());
|
|
|
|
|
GetFirstPacket();
|
|
|
|
|
|
2019-10-31 14:38:11 +01:00
|
|
|
EXPECT_EQ(NetEq::Operation::kNormal, neteq_->last_operation_for_test());
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest120ms, Merge) {
|
2018-11-30 10:45:12 +01:00
|
|
|
Register120msCodec(AudioDecoder::kSpeech);
|
2016-05-02 04:46:11 -07:00
|
|
|
CreateInstanceWithDelayManagerMock();
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, CngOff()).WillRepeatedly(Return(true));
|
2016-05-02 04:46:11 -07:00
|
|
|
InsertPacket(first_timestamp());
|
|
|
|
|
|
|
|
|
|
GetFirstPacket();
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, GetDecision(_, _))
|
2019-10-31 14:38:11 +01:00
|
|
|
.WillOnce(Return(NetEq::Operation::kExpand));
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
2016-05-02 04:46:11 -07:00
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp() + 2 * timestamp_diff_between_packets());
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, GetDecision(_, _))
|
2019-10-31 14:38:11 +01:00
|
|
|
.WillOnce(Return(NetEq::Operation::kMerge));
|
2016-05-02 04:46:11 -07:00
|
|
|
|
2016-05-12 13:51:28 -07:00
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
2019-10-31 14:38:11 +01:00
|
|
|
EXPECT_EQ(NetEq::Operation::kMerge, neteq_->last_operation_for_test());
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest120ms, Expand) {
|
|
|
|
|
Register120msCodec(AudioDecoder::kSpeech);
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstanceNoMocks();
|
2016-05-02 04:46:11 -07:00
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp());
|
|
|
|
|
GetFirstPacket();
|
|
|
|
|
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
2019-10-31 14:38:11 +01:00
|
|
|
EXPECT_EQ(NetEq::Operation::kExpand, neteq_->last_operation_for_test());
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest120ms, FastAccelerate) {
|
|
|
|
|
Register120msCodec(AudioDecoder::kSpeech);
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstanceWithDelayManagerMock();
|
2016-05-02 04:46:11 -07:00
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp());
|
|
|
|
|
GetFirstPacket();
|
|
|
|
|
InsertPacket(first_timestamp() + timestamp_diff_between_packets());
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, GetDecision(_, _))
|
2016-05-02 04:46:11 -07:00
|
|
|
.Times(1)
|
2019-10-31 14:38:11 +01:00
|
|
|
.WillOnce(Return(NetEq::Operation::kFastAccelerate));
|
2016-05-02 04:46:11 -07:00
|
|
|
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
2019-10-31 14:38:11 +01:00
|
|
|
EXPECT_EQ(NetEq::Operation::kFastAccelerate,
|
|
|
|
|
neteq_->last_operation_for_test());
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest120ms, PreemptiveExpand) {
|
|
|
|
|
Register120msCodec(AudioDecoder::kSpeech);
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstanceWithDelayManagerMock();
|
2016-05-02 04:46:11 -07:00
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp());
|
|
|
|
|
GetFirstPacket();
|
|
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp() + timestamp_diff_between_packets());
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, GetDecision(_, _))
|
2016-05-02 04:46:11 -07:00
|
|
|
.Times(1)
|
2019-10-31 14:38:11 +01:00
|
|
|
.WillOnce(Return(NetEq::Operation::kPreemptiveExpand));
|
2016-05-02 04:46:11 -07:00
|
|
|
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
2019-10-31 14:38:11 +01:00
|
|
|
EXPECT_EQ(NetEq::Operation::kPreemptiveExpand,
|
|
|
|
|
neteq_->last_operation_for_test());
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(NetEqImplTest120ms, Accelerate) {
|
|
|
|
|
Register120msCodec(AudioDecoder::kSpeech);
|
2018-11-30 10:45:12 +01:00
|
|
|
CreateInstanceWithDelayManagerMock();
|
2016-05-02 04:46:11 -07:00
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp());
|
|
|
|
|
GetFirstPacket();
|
|
|
|
|
|
|
|
|
|
InsertPacket(first_timestamp() + timestamp_diff_between_packets());
|
|
|
|
|
|
2019-10-24 15:20:39 +02:00
|
|
|
EXPECT_CALL(*mock_neteq_controller_, GetDecision(_, _))
|
2016-05-02 04:46:11 -07:00
|
|
|
.Times(1)
|
2019-10-31 14:38:11 +01:00
|
|
|
.WillOnce(Return(NetEq::Operation::kAccelerate));
|
2016-05-02 04:46:11 -07:00
|
|
|
|
2016-05-12 13:51:28 -07:00
|
|
|
bool muted;
|
|
|
|
|
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
|
2019-10-31 14:38:11 +01:00
|
|
|
EXPECT_EQ(NetEq::Operation::kAccelerate, neteq_->last_operation_for_test());
|
2016-05-02 04:46:11 -07:00
|
|
|
}
|
|
|
|
|
|
Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
This reverts commit fab3460a821abe336ab610c6d6dfc0d392dac263.
Reason for revert: fix downstream instead
Original change's description:
> Revert "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.""
>
> This reverts commit 9973933d2e606d64fcdc753acb9ba3afd6e30569.
>
> Reason for revert: breaking downstream projects and not reviewed by direct owners
>
> Original change's description:
> > Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> >
> > This reverts commit 24192c267a40eb7d6b1850489ccdbf7a84f8ff0f.
> >
> > Reason for revert: Analyzed the performance regression in more detail.
> >
> > Most of the regression comes from the extra RtpPacketInfos-related memory allocations in every `NetEq::GetAudio()` call. Commit 1796a820f60cb9429bf4bcf13a40a41794ac8fb0 has removed roughly 2/3rds of the extra allocations from the impacted perf tests. Remaining perf impact is expected to be about "8 microseconds of CPU time per second" on the Linux benchmarking machines and "15 us per second" on Windows/Mac.
> >
> > There are options to optimize further but they are unlikely worth doing. Note for example that `NetEqPerformanceTest` uses the PCM codec while the real-world use cases would likely use the much heavier Opus codec. The numbers from `OpusSpeedTest` and `NetEqPerformanceTest` suggest that Opus decoding is about 10x as expensive as NetEq overall.
> >
> > Original change's description:
> > > Revert "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."
> > >
> > > This reverts commit 3e8ef940fe86cf6285afb80e68d2a0bedc631b9f.
> > >
> > > Reason for revert: This CL causes a performance regression in NetEq, see https://bugs.chromium.org/p/chromium/issues/detail?id=982260.
> > >
> > > Original change's description:
> > > > Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker.
> > > >
> > > > This change adds the plumbing of RtpPacketInfo from ChannelReceive::OnRtpPacket() to ChannelReceive::GetAudioFrameWithInfo() for audio. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.
> > > >
> > > > Bug: webrtc:10668
> > > > Change-Id: I03385d6865bbc7bfbef7634f88de820a934f787a
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139890
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Reviewed-by: Minyue Li <minyue@webrtc.org>
> > > > Commit-Queue: Chen Xing <chxg@google.com>
> > > > Cr-Commit-Position: refs/heads/master@{#28434}
> > >
> > > TBR=kwiberg@webrtc.org,stefan@webrtc.org,minyue@webrtc.org,chxg@google.com
> > >
> > > Bug: webrtc:10668, chromium:982260
> > > Change-Id: I5e2cfde78c59d1123e21869564d76ed3f6193a5c
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145339
> > > Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28561}
> >
> > TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:10668, chromium:982260
> > Change-Id: Ie375a0b327ee368317bf3a04b2f1415c3a974470
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146707
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Chen Xing <chxg@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28664}
>
> TBR=kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
>
> Change-Id: I652cb0814d83b514d3bee34e65ca3bb693099b22
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10668, chromium:982260
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146712
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28671}
TBR=alessiob@webrtc.org,kwiberg@webrtc.org,stefan@webrtc.org,ivoc@webrtc.org,minyue@webrtc.org,chxg@google.com
Change-Id: Id43b7b3da79b4f48004b41767482bae1c1fa1e16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10668, chromium:982260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146713
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28672}
2019-07-24 16:47:02 +00:00
|
|
|
} // namespace webrtc
|