Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 class NetEqImpl : public webrtc::NetEq { | 59 class NetEqImpl : public webrtc::NetEq { |
| 60 public: | 60 public: |
| 61 enum class OutputType { | 61 enum class OutputType { |
| 62 kNormalSpeech, | 62 kNormalSpeech, |
| 63 kPLC, | 63 kPLC, |
| 64 kCNG, | 64 kCNG, |
| 65 kPLCCNG, | 65 kPLCCNG, |
| 66 kVadPassive | 66 kVadPassive |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 struct Dependencies { | |
| 70 // The constructor populates the Dependencies struct with the default | |
| 71 // implementations of the objects. They can all be replaced by the user | |
| 72 // before sending the struct to the NetEqImpl constructor. However, there | |
| 73 // are dependencies between some of the classes inside the struct, so | |
| 74 // swapping out one may make it necessary to re-create another one. | |
| 75 explicit Dependencies(const NetEq::Config& config); | |
| 76 ~Dependencies(); | |
| 77 | |
| 78 std::unique_ptr<TickTimer> tick_timer; | |
| 79 std::unique_ptr<BufferLevelFilter> buffer_level_filter; | |
| 80 std::unique_ptr<DecoderDatabase> decoder_database; | |
| 81 std::unique_ptr<DelayPeakDetector> delay_peak_detector; | |
| 82 std::unique_ptr<DelayManager> delay_manager; | |
| 83 std::unique_ptr<DtmfBuffer> dtmf_buffer; | |
| 84 std::unique_ptr<DtmfToneGenerator> dtmf_tone_generator; | |
| 85 std::unique_ptr<PacketBuffer> packet_buffer; | |
| 86 std::unique_ptr<PayloadSplitter> payload_splitter; | |
| 87 std::unique_ptr<TimestampScaler> timestamp_scaler; | |
| 88 std::unique_ptr<AccelerateFactory> accelerate_factory; | |
| 89 std::unique_ptr<ExpandFactory> expand_factory; | |
| 90 std::unique_ptr<PreemptiveExpandFactory> preemptive_expand_factory; | |
| 91 }; | |
| 92 | |
| 69 // Creates a new NetEqImpl object. The object will assume ownership of all | 93 // Creates a new NetEqImpl object. The object will assume ownership of all |
| 70 // injected dependencies, and will delete them when done. | 94 // injected dependencies, and will delete them when done. |
|
kwiberg-webrtc
2016/04/26 13:00:04
You no longer need the second sentence in this com
hlundin-webrtc
2016/04/26 13:20:38
Done.
| |
| 71 NetEqImpl(const NetEq::Config& config, | 95 NetEqImpl(const NetEq::Config& config, |
| 72 std::unique_ptr<TickTimer> tick_timer, | 96 Dependencies&& deps, |
| 73 BufferLevelFilter* buffer_level_filter, | |
| 74 DecoderDatabase* decoder_database, | |
| 75 DelayManager* delay_manager, | |
| 76 DelayPeakDetector* delay_peak_detector, | |
| 77 DtmfBuffer* dtmf_buffer, | |
| 78 DtmfToneGenerator* dtmf_tone_generator, | |
| 79 PacketBuffer* packet_buffer, | |
| 80 PayloadSplitter* payload_splitter, | |
| 81 TimestampScaler* timestamp_scaler, | |
| 82 AccelerateFactory* accelerate_factory, | |
| 83 ExpandFactory* expand_factory, | |
| 84 PreemptiveExpandFactory* preemptive_expand_factory, | |
| 85 bool create_components = true); | 97 bool create_components = true); |
| 86 | 98 |
| 87 ~NetEqImpl() override; | 99 ~NetEqImpl() override; |
| 88 | 100 |
| 89 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication | 101 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication |
| 90 // of the time when the packet was received, and should be measured with | 102 // of the time when the packet was received, and should be measured with |
| 91 // the same tick rate as the RTP timestamp of the current payload. | 103 // the same tick rate as the RTP timestamp of the current payload. |
| 92 // Returns 0 on success, -1 on failure. | 104 // Returns 0 on success, -1 on failure. |
| 93 int InsertPacket(const WebRtcRTPHeader& rtp_header, | 105 int InsertPacket(const WebRtcRTPHeader& rtp_header, |
| 94 rtc::ArrayView<const uint8_t> payload, | 106 rtc::ArrayView<const uint8_t> payload, |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 bool nack_enabled_ GUARDED_BY(crit_sect_); | 404 bool nack_enabled_ GUARDED_BY(crit_sect_); |
| 393 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = | 405 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = |
| 394 AudioFrame::kVadPassive; | 406 AudioFrame::kVadPassive; |
| 395 | 407 |
| 396 private: | 408 private: |
| 397 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); | 409 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); |
| 398 }; | 410 }; |
| 399 | 411 |
| 400 } // namespace webrtc | 412 } // namespace webrtc |
| 401 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ | 413 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ |
| OLD | NEW |