Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl.h

Issue 1410073006: ACM: Move NACK functionality inside NetEq (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 21 matching lines...) Expand all
32 class ComfortNoise; 32 class ComfortNoise;
33 class CriticalSectionWrapper; 33 class CriticalSectionWrapper;
34 class DecisionLogic; 34 class DecisionLogic;
35 class DecoderDatabase; 35 class DecoderDatabase;
36 class DelayManager; 36 class DelayManager;
37 class DelayPeakDetector; 37 class DelayPeakDetector;
38 class DtmfBuffer; 38 class DtmfBuffer;
39 class DtmfToneGenerator; 39 class DtmfToneGenerator;
40 class Expand; 40 class Expand;
41 class Merge; 41 class Merge;
42 class Nack;
42 class Normal; 43 class Normal;
43 class PacketBuffer; 44 class PacketBuffer;
44 class PayloadSplitter; 45 class PayloadSplitter;
45 class PostDecodeVad; 46 class PostDecodeVad;
46 class PreemptiveExpand; 47 class PreemptiveExpand;
47 class RandomVector; 48 class RandomVector;
48 class SyncBuffer; 49 class SyncBuffer;
49 class TimestampScaler; 50 class TimestampScaler;
50 struct AccelerateFactory; 51 struct AccelerateFactory;
51 struct DtmfEvent; 52 struct DtmfEvent;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // When LastError() returns kDecoderErrorCode or kComfortNoiseErrorCode, check 181 // When LastError() returns kDecoderErrorCode or kComfortNoiseErrorCode, check
181 // this method to get the decoder's error code. 182 // this method to get the decoder's error code.
182 int LastDecoderError() override; 183 int LastDecoderError() override;
183 184
184 // Flushes both the packet buffer and the sync buffer. 185 // Flushes both the packet buffer and the sync buffer.
185 void FlushBuffers() override; 186 void FlushBuffers() override;
186 187
187 void PacketBufferStatistics(int* current_num_packets, 188 void PacketBufferStatistics(int* current_num_packets,
188 int* max_num_packets) const override; 189 int* max_num_packets) const override;
189 190
190 // Get sequence number and timestamp of the latest RTP. 191 void EnableNack(size_t max_nack_list_size) override;
191 // This method is to facilitate NACK. 192
192 int DecodedRtpInfo(int* sequence_number, uint32_t* timestamp) const override; 193 void DisableNack() override;
194
195 std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const override;
193 196
194 // This accessor method is only intended for testing purposes. 197 // This accessor method is only intended for testing purposes.
195 const SyncBuffer* sync_buffer_for_test() const; 198 const SyncBuffer* sync_buffer_for_test() const;
196 199
197 protected: 200 protected:
198 static const int kOutputSizeMs = 10; 201 static const int kOutputSizeMs = 10;
199 static const size_t kMaxFrameSize = 2880; // 60 ms @ 48 kHz. 202 static const size_t kMaxFrameSize = 2880; // 60 ms @ 48 kHz.
200 // TODO(hlundin): Provide a better value for kSyncBufferSize. 203 // TODO(hlundin): Provide a better value for kSyncBufferSize.
201 static const size_t kSyncBufferSize = 2 * kMaxFrameSize; 204 static const size_t kSyncBufferSize = 2 * kMaxFrameSize;
202 205
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 bool reset_decoder_ GUARDED_BY(crit_sect_); 389 bool reset_decoder_ GUARDED_BY(crit_sect_);
387 uint8_t current_rtp_payload_type_ GUARDED_BY(crit_sect_); 390 uint8_t current_rtp_payload_type_ GUARDED_BY(crit_sect_);
388 uint8_t current_cng_rtp_payload_type_ GUARDED_BY(crit_sect_); 391 uint8_t current_cng_rtp_payload_type_ GUARDED_BY(crit_sect_);
389 uint32_t ssrc_ GUARDED_BY(crit_sect_); 392 uint32_t ssrc_ GUARDED_BY(crit_sect_);
390 bool first_packet_ GUARDED_BY(crit_sect_); 393 bool first_packet_ GUARDED_BY(crit_sect_);
391 int error_code_ GUARDED_BY(crit_sect_); // Store last error code. 394 int error_code_ GUARDED_BY(crit_sect_); // Store last error code.
392 int decoder_error_code_ GUARDED_BY(crit_sect_); 395 int decoder_error_code_ GUARDED_BY(crit_sect_);
393 const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_); 396 const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_);
394 NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_); 397 NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_);
395 bool enable_fast_accelerate_ GUARDED_BY(crit_sect_); 398 bool enable_fast_accelerate_ GUARDED_BY(crit_sect_);
396 399 rtc::scoped_ptr<Nack> nack_ GUARDED_BY(crit_sect_);
397 // These values are used by NACK module to estimate time-to-play of 400 bool nack_enabled_ GUARDED_BY(crit_sect_);
398 // a missing packet. Occasionally, NetEq might decide to decode more
399 // than one packet. Therefore, these values store sequence number and
400 // timestamp of the first packet pulled from the packet buffer. In
401 // such cases, these values do not exactly represent the sequence number
402 // or timestamp associated with a 10ms audio pulled from NetEq. NACK
403 // module is designed to compensate for this.
404 int decoded_packet_sequence_number_ GUARDED_BY(crit_sect_);
405 uint32_t decoded_packet_timestamp_ GUARDED_BY(crit_sect_);
406 401
407 private: 402 private:
408 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); 403 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl);
409 }; 404 };
410 405
411 } // namespace webrtc 406 } // namespace webrtc
412 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ 407 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq.gypi ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698