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 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ |
13 | 13 |
14 #include <string.h> // Provide access to size_t. | 14 #include <string.h> // Provide access to size_t. |
15 | 15 |
16 #include <string> | 16 #include <string> |
17 | 17 |
18 #include "webrtc/base/constructormagic.h" | 18 #include "webrtc/base/constructormagic.h" |
19 #include "webrtc/base/optional.h" | 19 #include "webrtc/base/optional.h" |
20 #include "webrtc/common_types.h" | 20 #include "webrtc/common_types.h" |
21 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" | 21 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" |
22 #include "webrtc/typedefs.h" | 22 #include "webrtc/typedefs.h" |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 | 25 |
26 // Forward declarations. | 26 // Forward declarations. |
27 class AudioFrame; | 27 class AudioFrame; |
28 struct WebRtcRTPHeader; | 28 struct WebRtcRTPHeader; |
| 29 class AudioDecoderFactory; |
29 | 30 |
30 struct NetEqNetworkStatistics { | 31 struct NetEqNetworkStatistics { |
31 uint16_t current_buffer_size_ms; // Current jitter buffer size in ms. | 32 uint16_t current_buffer_size_ms; // Current jitter buffer size in ms. |
32 uint16_t preferred_buffer_size_ms; // Target buffer size in ms. | 33 uint16_t preferred_buffer_size_ms; // Target buffer size in ms. |
33 uint16_t jitter_peaks_found; // 1 if adding extra delay due to peaky | 34 uint16_t jitter_peaks_found; // 1 if adding extra delay due to peaky |
34 // jitter; 0 otherwise. | 35 // jitter; 0 otherwise. |
35 uint16_t packet_loss_rate; // Loss rate (network + late) in Q14. | 36 uint16_t packet_loss_rate; // Loss rate (network + late) in Q14. |
36 uint16_t packet_discard_rate; // Late loss rate in Q14. | 37 uint16_t packet_discard_rate; // Late loss rate in Q14. |
37 uint16_t expand_rate; // Fraction (of original stream) of synthesized | 38 uint16_t expand_rate; // Fraction (of original stream) of synthesized |
38 // audio inserted through expansion (in Q14). | 39 // audio inserted through expansion (in Q14). |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 kDecodedTooMuch, | 126 kDecodedTooMuch, |
126 kFrameSplitError, | 127 kFrameSplitError, |
127 kRedundancySplitError, | 128 kRedundancySplitError, |
128 kPacketBufferCorruption, | 129 kPacketBufferCorruption, |
129 kSyncPacketNotAccepted | 130 kSyncPacketNotAccepted |
130 }; | 131 }; |
131 | 132 |
132 // Creates a new NetEq object, with parameters set in |config|. The |config| | 133 // Creates a new NetEq object, with parameters set in |config|. The |config| |
133 // object will only have to be valid for the duration of the call to this | 134 // object will only have to be valid for the duration of the call to this |
134 // method. | 135 // method. |
135 static NetEq* Create(const NetEq::Config& config); | 136 static NetEq* Create( |
| 137 const NetEq::Config& config, |
| 138 std::shared_ptr<AudioDecoderFactory> decoder_factory); |
136 | 139 |
137 virtual ~NetEq() {} | 140 virtual ~NetEq() {} |
138 | 141 |
139 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication | 142 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication |
140 // of the time when the packet was received, and should be measured with | 143 // of the time when the packet was received, and should be measured with |
141 // the same tick rate as the RTP timestamp of the current payload. | 144 // the same tick rate as the RTP timestamp of the current payload. |
142 // Returns 0 on success, -1 on failure. | 145 // Returns 0 on success, -1 on failure. |
143 virtual int InsertPacket(const WebRtcRTPHeader& rtp_header, | 146 virtual int InsertPacket(const WebRtcRTPHeader& rtp_header, |
144 rtc::ArrayView<const uint8_t> payload, | 147 rtc::ArrayView<const uint8_t> payload, |
145 uint32_t receive_timestamp) = 0; | 148 uint32_t receive_timestamp) = 0; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 292 |
290 protected: | 293 protected: |
291 NetEq() {} | 294 NetEq() {} |
292 | 295 |
293 private: | 296 private: |
294 RTC_DISALLOW_COPY_AND_ASSIGN(NetEq); | 297 RTC_DISALLOW_COPY_AND_ASSIGN(NetEq); |
295 }; | 298 }; |
296 | 299 |
297 } // namespace webrtc | 300 } // namespace webrtc |
298 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ | 301 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ |
OLD | NEW |