| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 NetEqImpl(const NetEq::Config& config, | 98 NetEqImpl(const NetEq::Config& config, |
| 99 Dependencies&& deps, | 99 Dependencies&& deps, |
| 100 bool create_components = true); | 100 bool create_components = true); |
| 101 | 101 |
| 102 ~NetEqImpl() override; | 102 ~NetEqImpl() override; |
| 103 | 103 |
| 104 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication | 104 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication |
| 105 // of the time when the packet was received, and should be measured with | 105 // of the time when the packet was received, and should be measured with |
| 106 // the same tick rate as the RTP timestamp of the current payload. | 106 // the same tick rate as the RTP timestamp of the current payload. |
| 107 // Returns 0 on success, -1 on failure. | 107 // Returns 0 on success, -1 on failure. |
| 108 int InsertPacket(const WebRtcRTPHeader& rtp_header, | 108 int InsertPacket(const RTPHeader& rtp_header, |
| 109 rtc::ArrayView<const uint8_t> payload, | 109 rtc::ArrayView<const uint8_t> payload, |
| 110 uint32_t receive_timestamp) override; | 110 uint32_t receive_timestamp) override; |
| 111 | 111 |
| 112 int GetAudio(AudioFrame* audio_frame, bool* muted) override; | 112 int GetAudio(AudioFrame* audio_frame, bool* muted) override; |
| 113 | 113 |
| 114 void SetCodecs(const std::map<int, SdpAudioFormat>& codecs) override; | 114 void SetCodecs(const std::map<int, SdpAudioFormat>& codecs) override; |
| 115 | 115 |
| 116 int RegisterPayloadType(NetEqDecoder codec, | 116 int RegisterPayloadType(NetEqDecoder codec, |
| 117 const std::string& codec_name, | 117 const std::string& codec_name, |
| 118 uint8_t rtp_payload_type) override; | 118 uint8_t rtp_payload_type) override; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 static const int kOutputSizeMs = 10; | 215 static const int kOutputSizeMs = 10; |
| 216 static const size_t kMaxFrameSize = 5760; // 120 ms @ 48 kHz. | 216 static const size_t kMaxFrameSize = 5760; // 120 ms @ 48 kHz. |
| 217 // TODO(hlundin): Provide a better value for kSyncBufferSize. | 217 // TODO(hlundin): Provide a better value for kSyncBufferSize. |
| 218 // Current value is kMaxFrameSize + 60 ms * 48 kHz, which is enough for | 218 // Current value is kMaxFrameSize + 60 ms * 48 kHz, which is enough for |
| 219 // calculating correlations of current frame against history. | 219 // calculating correlations of current frame against history. |
| 220 static const size_t kSyncBufferSize = kMaxFrameSize + 60 * 48; | 220 static const size_t kSyncBufferSize = kMaxFrameSize + 60 * 48; |
| 221 | 221 |
| 222 // Inserts a new packet into NetEq. This is used by the InsertPacket method | 222 // Inserts a new packet into NetEq. This is used by the InsertPacket method |
| 223 // above. Returns 0 on success, otherwise an error code. | 223 // above. Returns 0 on success, otherwise an error code. |
| 224 // TODO(hlundin): Merge this with InsertPacket above? | 224 // TODO(hlundin): Merge this with InsertPacket above? |
| 225 int InsertPacketInternal(const WebRtcRTPHeader& rtp_header, | 225 int InsertPacketInternal(const RTPHeader& rtp_header, |
| 226 rtc::ArrayView<const uint8_t> payload, | 226 rtc::ArrayView<const uint8_t> payload, |
| 227 uint32_t receive_timestamp) | 227 uint32_t receive_timestamp) |
| 228 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 228 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 229 | 229 |
| 230 // Delivers 10 ms of audio data. The data is written to |audio_frame|. | 230 // Delivers 10 ms of audio data. The data is written to |audio_frame|. |
| 231 // Returns 0 on success, otherwise an error code. | 231 // Returns 0 on success, otherwise an error code. |
| 232 int GetAudioInternal(AudioFrame* audio_frame, bool* muted) | 232 int GetAudioInternal(AudioFrame* audio_frame, bool* muted) |
| 233 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 233 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 234 | 234 |
| 235 // Provides a decision to the GetAudioInternal method. The decision what to | 235 // Provides a decision to the GetAudioInternal method. The decision what to |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 AudioFrame::kVadPassive; | 414 AudioFrame::kVadPassive; |
| 415 std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_ | 415 std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_ |
| 416 GUARDED_BY(crit_sect_); | 416 GUARDED_BY(crit_sect_); |
| 417 | 417 |
| 418 private: | 418 private: |
| 419 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); | 419 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); |
| 420 }; | 420 }; |
| 421 | 421 |
| 422 } // namespace webrtc | 422 } // namespace webrtc |
| 423 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ | 423 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ |
| OLD | NEW |