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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); | 273 uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); |
274 uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); | 274 uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); |
275 | 275 |
276 const rtc::scoped_ptr<CriticalSectionWrapper> callback_crit_sect_; | 276 const rtc::scoped_ptr<CriticalSectionWrapper> callback_crit_sect_; |
277 AudioPacketizationCallback* packetization_callback_ | 277 AudioPacketizationCallback* packetization_callback_ |
278 GUARDED_BY(callback_crit_sect_); | 278 GUARDED_BY(callback_crit_sect_); |
279 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); | 279 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); |
280 }; | 280 }; |
281 | 281 |
282 } // namespace acm2 | 282 } // namespace acm2 |
283 | |
284 class AudioCodingImpl : public AudioCoding { | |
285 public: | |
286 AudioCodingImpl(const Config& config); | |
287 ~AudioCodingImpl() override; | |
288 | |
289 bool RegisterSendCodec(AudioEncoder* send_codec) override; | |
290 | |
291 bool RegisterSendCodec(int encoder_type, | |
292 uint8_t payload_type, | |
293 int frame_size_samples = 0) override; | |
294 | |
295 const AudioEncoder* GetSenderInfo() const override; | |
296 | |
297 const CodecInst* GetSenderCodecInst() override; | |
298 | |
299 int Add10MsAudio(const AudioFrame& audio_frame) override; | |
300 | |
301 const ReceiverInfo* GetReceiverInfo() const override; | |
302 | |
303 bool RegisterReceiveCodec(AudioDecoder* receive_codec) override; | |
304 | |
305 bool RegisterReceiveCodec(int decoder_type, uint8_t payload_type) override; | |
306 | |
307 bool InsertPacket(const uint8_t* incoming_payload, | |
308 size_t payload_len_bytes, | |
309 const WebRtcRTPHeader& rtp_info) override; | |
310 | |
311 bool InsertPayload(const uint8_t* incoming_payload, | |
312 size_t payload_len_byte, | |
313 uint8_t payload_type, | |
314 uint32_t timestamp) override; | |
315 | |
316 bool SetMinimumPlayoutDelay(int time_ms) override; | |
317 | |
318 bool SetMaximumPlayoutDelay(int time_ms) override; | |
319 | |
320 int LeastRequiredDelayMs() const override; | |
321 | |
322 bool PlayoutTimestamp(uint32_t* timestamp) override; | |
323 | |
324 bool Get10MsAudio(AudioFrame* audio_frame) override; | |
325 | |
326 bool GetNetworkStatistics(NetworkStatistics* network_statistics) override; | |
327 | |
328 bool EnableNack(size_t max_nack_list_size) override; | |
329 | |
330 void DisableNack() override; | |
331 | |
332 bool SetVad(bool enable_dtx, bool enable_vad, ACMVADMode vad_mode) override; | |
333 | |
334 std::vector<uint16_t> GetNackList(int round_trip_time_ms) const override; | |
335 | |
336 void GetDecodingCallStatistics( | |
337 AudioDecodingCallStats* call_stats) const override; | |
338 | |
339 private: | |
340 // Temporary method to be used during redesign phase. | |
341 // Maps |codec_type| (a value from the anonymous enum in acm2::ACMCodecDB) to | |
342 // |codec_name|, |sample_rate_hz|, and |channels|. | |
343 // TODO(henrik.lundin) Remove this when no longer needed. | |
344 static bool MapCodecTypeToParameters(int codec_type, | |
345 std::string* codec_name, | |
346 int* sample_rate_hz, | |
347 int* channels); | |
348 | |
349 int playout_frequency_hz_; | |
350 // TODO(henrik.lundin): All members below this line are temporary and should | |
351 // be removed after refactoring is completed. | |
352 rtc::scoped_ptr<acm2::AudioCodingModuleImpl> acm_old_; | |
353 CodecInst current_send_codec_; | |
354 }; | |
355 | |
356 } // namespace webrtc | 283 } // namespace webrtc |
357 | 284 |
358 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_AUDIO_CODING_MODULE_IMPL_H_ | 285 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_AUDIO_CODING_MODULE_IMPL_H_ |
OLD | NEW |