mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00

This reverts commit9973933d2e
. 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 commit24192c267a
. > > 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. Commit1796a820f6
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 commit3e8ef940fe
. > > > > 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}
411 lines
17 KiB
C++
411 lines
17 KiB
C++
/*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_
|
|
#define MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "absl/types/optional.h"
|
|
#include "api/audio/audio_frame.h"
|
|
#include "modules/audio_coding/neteq/audio_multi_vector.h"
|
|
#include "modules/audio_coding/neteq/defines.h" // Modes, Operations
|
|
#include "modules/audio_coding/neteq/expand_uma_logger.h"
|
|
#include "modules/audio_coding/neteq/include/neteq.h"
|
|
#include "modules/audio_coding/neteq/packet.h"
|
|
#include "modules/audio_coding/neteq/random_vector.h"
|
|
#include "modules/audio_coding/neteq/statistics_calculator.h"
|
|
#include "modules/audio_coding/neteq/tick_timer.h"
|
|
#include "rtc_base/constructor_magic.h"
|
|
#include "rtc_base/critical_section.h"
|
|
#include "rtc_base/thread_annotations.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// Forward declarations.
|
|
class Accelerate;
|
|
class BackgroundNoise;
|
|
class BufferLevelFilter;
|
|
class ComfortNoise;
|
|
class DecisionLogic;
|
|
class DecoderDatabase;
|
|
class DelayManager;
|
|
class DelayPeakDetector;
|
|
class DtmfBuffer;
|
|
class DtmfToneGenerator;
|
|
class Expand;
|
|
class Merge;
|
|
class NackTracker;
|
|
class Normal;
|
|
class PacketBuffer;
|
|
class RedPayloadSplitter;
|
|
class PostDecodeVad;
|
|
class PreemptiveExpand;
|
|
class RandomVector;
|
|
class SyncBuffer;
|
|
class TimestampScaler;
|
|
struct AccelerateFactory;
|
|
struct DtmfEvent;
|
|
struct ExpandFactory;
|
|
struct PreemptiveExpandFactory;
|
|
|
|
class NetEqImpl : public webrtc::NetEq {
|
|
public:
|
|
enum class OutputType { kNormalSpeech, kPLC, kCNG, kPLCCNG, kVadPassive };
|
|
|
|
enum ErrorCodes {
|
|
kNoError = 0,
|
|
kOtherError,
|
|
kUnknownRtpPayloadType,
|
|
kDecoderNotFound,
|
|
kInvalidPointer,
|
|
kAccelerateError,
|
|
kPreemptiveExpandError,
|
|
kComfortNoiseErrorCode,
|
|
kDecoderErrorCode,
|
|
kOtherDecoderError,
|
|
kInvalidOperation,
|
|
kDtmfParsingError,
|
|
kDtmfInsertError,
|
|
kSampleUnderrun,
|
|
kDecodedTooMuch,
|
|
kRedundancySplitError,
|
|
kPacketBufferCorruption
|
|
};
|
|
|
|
struct Dependencies {
|
|
// The constructor populates the Dependencies struct with the default
|
|
// implementations of the objects. They can all be replaced by the user
|
|
// before sending the struct to the NetEqImpl constructor. However, there
|
|
// are dependencies between some of the classes inside the struct, so
|
|
// swapping out one may make it necessary to re-create another one.
|
|
explicit Dependencies(
|
|
const NetEq::Config& config,
|
|
const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory);
|
|
~Dependencies();
|
|
|
|
std::unique_ptr<TickTimer> tick_timer;
|
|
std::unique_ptr<StatisticsCalculator> stats;
|
|
std::unique_ptr<BufferLevelFilter> buffer_level_filter;
|
|
std::unique_ptr<DecoderDatabase> decoder_database;
|
|
std::unique_ptr<DelayPeakDetector> delay_peak_detector;
|
|
std::unique_ptr<DelayManager> delay_manager;
|
|
std::unique_ptr<DtmfBuffer> dtmf_buffer;
|
|
std::unique_ptr<DtmfToneGenerator> dtmf_tone_generator;
|
|
std::unique_ptr<PacketBuffer> packet_buffer;
|
|
std::unique_ptr<RedPayloadSplitter> red_payload_splitter;
|
|
std::unique_ptr<TimestampScaler> timestamp_scaler;
|
|
std::unique_ptr<AccelerateFactory> accelerate_factory;
|
|
std::unique_ptr<ExpandFactory> expand_factory;
|
|
std::unique_ptr<PreemptiveExpandFactory> preemptive_expand_factory;
|
|
};
|
|
|
|
// Creates a new NetEqImpl object.
|
|
NetEqImpl(const NetEq::Config& config,
|
|
Dependencies&& deps,
|
|
bool create_components = true);
|
|
|
|
~NetEqImpl() override;
|
|
|
|
// Inserts a new packet into NetEq. The |receive_timestamp| is an indication
|
|
// of the time when the packet was received, and should be measured with
|
|
// the same tick rate as the RTP timestamp of the current payload.
|
|
// Returns 0 on success, -1 on failure.
|
|
int InsertPacket(const RTPHeader& rtp_header,
|
|
rtc::ArrayView<const uint8_t> payload,
|
|
uint32_t receive_timestamp) override;
|
|
|
|
void InsertEmptyPacket(const RTPHeader& rtp_header) override;
|
|
|
|
int GetAudio(
|
|
AudioFrame* audio_frame,
|
|
bool* muted,
|
|
absl::optional<Operations> action_override = absl::nullopt) override;
|
|
|
|
void SetCodecs(const std::map<int, SdpAudioFormat>& codecs) override;
|
|
|
|
bool RegisterPayloadType(int rtp_payload_type,
|
|
const SdpAudioFormat& audio_format) override;
|
|
|
|
// Removes |rtp_payload_type| from the codec database. Returns 0 on success,
|
|
// -1 on failure.
|
|
int RemovePayloadType(uint8_t rtp_payload_type) override;
|
|
|
|
void RemoveAllPayloadTypes() override;
|
|
|
|
bool SetMinimumDelay(int delay_ms) override;
|
|
|
|
bool SetMaximumDelay(int delay_ms) override;
|
|
|
|
bool SetBaseMinimumDelayMs(int delay_ms) override;
|
|
|
|
int GetBaseMinimumDelayMs() const override;
|
|
|
|
int TargetDelayMs() const override;
|
|
|
|
int FilteredCurrentDelayMs() const override;
|
|
|
|
// Writes the current network statistics to |stats|. The statistics are reset
|
|
// after the call.
|
|
int NetworkStatistics(NetEqNetworkStatistics* stats) override;
|
|
|
|
NetEqLifetimeStatistics GetLifetimeStatistics() const override;
|
|
|
|
NetEqOperationsAndState GetOperationsAndState() const override;
|
|
|
|
// Enables post-decode VAD. When enabled, GetAudio() will return
|
|
// kOutputVADPassive when the signal contains no speech.
|
|
void EnableVad() override;
|
|
|
|
// Disables post-decode VAD.
|
|
void DisableVad() override;
|
|
|
|
absl::optional<uint32_t> GetPlayoutTimestamp() const override;
|
|
|
|
int last_output_sample_rate_hz() const override;
|
|
|
|
absl::optional<SdpAudioFormat> GetDecoderFormat(
|
|
int payload_type) const override;
|
|
|
|
// Flushes both the packet buffer and the sync buffer.
|
|
void FlushBuffers() override;
|
|
|
|
void EnableNack(size_t max_nack_list_size) override;
|
|
|
|
void DisableNack() override;
|
|
|
|
std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const override;
|
|
|
|
std::vector<uint32_t> LastDecodedTimestamps() const override;
|
|
|
|
int SyncBufferSizeMs() const override;
|
|
|
|
// This accessor method is only intended for testing purposes.
|
|
const SyncBuffer* sync_buffer_for_test() const;
|
|
Operations last_operation_for_test() const;
|
|
|
|
protected:
|
|
static const int kOutputSizeMs = 10;
|
|
static const size_t kMaxFrameSize = 5760; // 120 ms @ 48 kHz.
|
|
// TODO(hlundin): Provide a better value for kSyncBufferSize.
|
|
// Current value is kMaxFrameSize + 60 ms * 48 kHz, which is enough for
|
|
// calculating correlations of current frame against history.
|
|
static const size_t kSyncBufferSize = kMaxFrameSize + 60 * 48;
|
|
|
|
// Inserts a new packet into NetEq. This is used by the InsertPacket method
|
|
// above. Returns 0 on success, otherwise an error code.
|
|
// TODO(hlundin): Merge this with InsertPacket above?
|
|
int InsertPacketInternal(const RTPHeader& rtp_header,
|
|
rtc::ArrayView<const uint8_t> payload,
|
|
uint32_t receive_timestamp)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Delivers 10 ms of audio data. The data is written to |audio_frame|.
|
|
// Returns 0 on success, otherwise an error code.
|
|
int GetAudioInternal(AudioFrame* audio_frame,
|
|
bool* muted,
|
|
absl::optional<Operations> action_override)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Provides a decision to the GetAudioInternal method. The decision what to
|
|
// do is written to |operation|. Packets to decode are written to
|
|
// |packet_list|, and a DTMF event to play is written to |dtmf_event|. When
|
|
// DTMF should be played, |play_dtmf| is set to true by the method.
|
|
// Returns 0 on success, otherwise an error code.
|
|
int GetDecision(Operations* operation,
|
|
PacketList* packet_list,
|
|
DtmfEvent* dtmf_event,
|
|
bool* play_dtmf,
|
|
absl::optional<Operations> action_override)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Decodes the speech packets in |packet_list|, and writes the results to
|
|
// |decoded_buffer|, which is allocated to hold |decoded_buffer_length|
|
|
// elements. The length of the decoded data is written to |decoded_length|.
|
|
// The speech type -- speech or (codec-internal) comfort noise -- is written
|
|
// to |speech_type|. If |packet_list| contains any SID frames for RFC 3389
|
|
// comfort noise, those are not decoded.
|
|
int Decode(PacketList* packet_list,
|
|
Operations* operation,
|
|
int* decoded_length,
|
|
AudioDecoder::SpeechType* speech_type)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method to Decode(). Performs codec internal CNG.
|
|
int DecodeCng(AudioDecoder* decoder,
|
|
int* decoded_length,
|
|
AudioDecoder::SpeechType* speech_type)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method to Decode(). Performs the actual decoding.
|
|
int DecodeLoop(PacketList* packet_list,
|
|
const Operations& operation,
|
|
AudioDecoder* decoder,
|
|
int* decoded_length,
|
|
AudioDecoder::SpeechType* speech_type)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method which calls the Normal class to perform the normal operation.
|
|
void DoNormal(const int16_t* decoded_buffer,
|
|
size_t decoded_length,
|
|
AudioDecoder::SpeechType speech_type,
|
|
bool play_dtmf) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method which calls the Merge class to perform the merge operation.
|
|
void DoMerge(int16_t* decoded_buffer,
|
|
size_t decoded_length,
|
|
AudioDecoder::SpeechType speech_type,
|
|
bool play_dtmf) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
bool DoCodecPlc() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method which calls the Expand class to perform the expand operation.
|
|
int DoExpand(bool play_dtmf) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method which calls the Accelerate class to perform the accelerate
|
|
// operation.
|
|
int DoAccelerate(int16_t* decoded_buffer,
|
|
size_t decoded_length,
|
|
AudioDecoder::SpeechType speech_type,
|
|
bool play_dtmf,
|
|
bool fast_accelerate)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method which calls the PreemptiveExpand class to perform the
|
|
// preemtive expand operation.
|
|
int DoPreemptiveExpand(int16_t* decoded_buffer,
|
|
size_t decoded_length,
|
|
AudioDecoder::SpeechType speech_type,
|
|
bool play_dtmf)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Sub-method which calls the ComfortNoise class to generate RFC 3389 comfort
|
|
// noise. |packet_list| can either contain one SID frame to update the
|
|
// noise parameters, or no payload at all, in which case the previously
|
|
// received parameters are used.
|
|
int DoRfc3389Cng(PacketList* packet_list, bool play_dtmf)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Calls the audio decoder to generate codec-internal comfort noise when
|
|
// no packet was received.
|
|
void DoCodecInternalCng(const int16_t* decoded_buffer, size_t decoded_length)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Calls the DtmfToneGenerator class to generate DTMF tones.
|
|
int DoDtmf(const DtmfEvent& dtmf_event, bool* play_dtmf)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Overdub DTMF on top of |output|.
|
|
int DtmfOverdub(const DtmfEvent& dtmf_event,
|
|
size_t num_channels,
|
|
int16_t* output) const
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Extracts packets from |packet_buffer_| to produce at least
|
|
// |required_samples| samples. The packets are inserted into |packet_list|.
|
|
// Returns the number of samples that the packets in the list will produce, or
|
|
// -1 in case of an error.
|
|
int ExtractPackets(size_t required_samples, PacketList* packet_list)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Resets various variables and objects to new values based on the sample rate
|
|
// |fs_hz| and |channels| number audio channels.
|
|
void SetSampleRateAndChannels(int fs_hz, size_t channels)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Returns the output type for the audio produced by the latest call to
|
|
// GetAudio().
|
|
OutputType LastOutputType() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Updates Expand and Merge.
|
|
virtual void UpdatePlcComponents(int fs_hz, size_t channels)
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
// Creates DecisionLogic object with the mode given by |playout_mode_|.
|
|
virtual void CreateDecisionLogic() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
|
|
|
|
rtc::CriticalSection crit_sect_;
|
|
const std::unique_ptr<TickTimer> tick_timer_ RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<BufferLevelFilter> buffer_level_filter_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<DecoderDatabase> decoder_database_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<DelayManager> delay_manager_ RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<DelayPeakDetector> delay_peak_detector_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<DtmfBuffer> dtmf_buffer_ RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<DtmfToneGenerator> dtmf_tone_generator_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<PacketBuffer> packet_buffer_ RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<RedPayloadSplitter> red_payload_splitter_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<TimestampScaler> timestamp_scaler_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<PostDecodeVad> vad_ RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<ExpandFactory> expand_factory_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<AccelerateFactory> accelerate_factory_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<PreemptiveExpandFactory> preemptive_expand_factory_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
const std::unique_ptr<StatisticsCalculator> stats_ RTC_GUARDED_BY(crit_sect_);
|
|
|
|
std::unique_ptr<BackgroundNoise> background_noise_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<DecisionLogic> decision_logic_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<AudioMultiVector> algorithm_buffer_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<SyncBuffer> sync_buffer_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<Expand> expand_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<Normal> normal_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<Merge> merge_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<Accelerate> accelerate_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<PreemptiveExpand> preemptive_expand_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
RandomVector random_vector_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<ComfortNoise> comfort_noise_ RTC_GUARDED_BY(crit_sect_);
|
|
int fs_hz_ RTC_GUARDED_BY(crit_sect_);
|
|
int fs_mult_ RTC_GUARDED_BY(crit_sect_);
|
|
int last_output_sample_rate_hz_ RTC_GUARDED_BY(crit_sect_);
|
|
size_t output_size_samples_ RTC_GUARDED_BY(crit_sect_);
|
|
size_t decoder_frame_length_ RTC_GUARDED_BY(crit_sect_);
|
|
Modes last_mode_ RTC_GUARDED_BY(crit_sect_);
|
|
Operations last_operation_ RTC_GUARDED_BY(crit_sect_);
|
|
size_t decoded_buffer_length_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<int16_t[]> decoded_buffer_ RTC_GUARDED_BY(crit_sect_);
|
|
uint32_t playout_timestamp_ RTC_GUARDED_BY(crit_sect_);
|
|
bool new_codec_ RTC_GUARDED_BY(crit_sect_);
|
|
uint32_t timestamp_ RTC_GUARDED_BY(crit_sect_);
|
|
bool reset_decoder_ RTC_GUARDED_BY(crit_sect_);
|
|
absl::optional<uint8_t> current_rtp_payload_type_ RTC_GUARDED_BY(crit_sect_);
|
|
absl::optional<uint8_t> current_cng_rtp_payload_type_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
bool first_packet_ RTC_GUARDED_BY(crit_sect_);
|
|
bool enable_fast_accelerate_ RTC_GUARDED_BY(crit_sect_);
|
|
std::unique_ptr<NackTracker> nack_ RTC_GUARDED_BY(crit_sect_);
|
|
bool nack_enabled_ RTC_GUARDED_BY(crit_sect_);
|
|
const bool enable_muted_state_ RTC_GUARDED_BY(crit_sect_);
|
|
AudioFrame::VADActivity last_vad_activity_ RTC_GUARDED_BY(crit_sect_) =
|
|
AudioFrame::kVadPassive;
|
|
std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_
|
|
RTC_GUARDED_BY(crit_sect_);
|
|
std::vector<uint32_t> last_decoded_timestamps_ RTC_GUARDED_BY(crit_sect_);
|
|
ExpandUmaLogger expand_uma_logger_ RTC_GUARDED_BY(crit_sect_);
|
|
ExpandUmaLogger speech_expand_uma_logger_ RTC_GUARDED_BY(crit_sect_);
|
|
bool no_time_stretching_ RTC_GUARDED_BY(crit_sect_); // Only used for test.
|
|
rtc::BufferT<int16_t> concealment_audio_ RTC_GUARDED_BY(crit_sect_);
|
|
const bool enable_rtx_handling_ RTC_GUARDED_BY(crit_sect_);
|
|
|
|
private:
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl);
|
|
};
|
|
|
|
} // namespace webrtc
|
|
#endif // MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_
|