OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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_MAIN_ACM2_CODEC_MANAGER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_MANAGER_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_MANAGER_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_MANAGER_H_ |
13 | 13 |
| 14 #include <map> |
| 15 |
14 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
15 #include "webrtc/base/optional.h" | 17 #include "webrtc/base/optional.h" |
16 #include "webrtc/base/scoped_ptr.h" | 18 #include "webrtc/base/scoped_ptr.h" |
17 #include "webrtc/base/thread_checker.h" | 19 #include "webrtc/base/thread_checker.h" |
18 #include "webrtc/modules/audio_coding/main/acm2/rent_a_codec.h" | 20 #include "webrtc/modules/audio_coding/main/acm2/rent_a_codec.h" |
19 #include "webrtc/modules/audio_coding/main/include/audio_coding_module_typedefs.
h" | 21 #include "webrtc/modules/audio_coding/main/include/audio_coding_module_typedefs.
h" |
20 #include "webrtc/common_types.h" | 22 #include "webrtc/common_types.h" |
21 | 23 |
22 namespace webrtc { | 24 namespace webrtc { |
23 | 25 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 64 } |
63 | 65 |
64 bool CurrentEncoderIsOpus() const { return encoder_is_opus_; } | 66 bool CurrentEncoderIsOpus() const { return encoder_is_opus_; } |
65 | 67 |
66 private: | 68 private: |
67 int CngPayloadType(int sample_rate_hz) const; | 69 int CngPayloadType(int sample_rate_hz) const; |
68 int RedPayloadType(int sample_rate_hz) const; | 70 int RedPayloadType(int sample_rate_hz) const; |
69 void RentEncoderStack(AudioEncoder* speech_encoder, int sample_rate_hz); | 71 void RentEncoderStack(AudioEncoder* speech_encoder, int sample_rate_hz); |
70 | 72 |
71 rtc::ThreadChecker thread_checker_; | 73 rtc::ThreadChecker thread_checker_; |
72 uint8_t cng_nb_pltype_; | |
73 uint8_t cng_wb_pltype_; | |
74 uint8_t cng_swb_pltype_; | |
75 uint8_t cng_fb_pltype_; | |
76 uint8_t red_nb_pltype_; | |
77 bool dtx_enabled_; | 74 bool dtx_enabled_; |
78 ACMVADMode vad_mode_; | 75 ACMVADMode vad_mode_; |
79 CodecInst send_codec_inst_; | 76 CodecInst send_codec_inst_; |
80 bool red_enabled_; | 77 bool red_enabled_; |
81 bool codec_fec_enabled_; | 78 bool codec_fec_enabled_; |
82 RentACodec rent_a_codec_; | 79 RentACodec rent_a_codec_; |
| 80 |
| 81 // Maps from RTP timestamp rate (in Hz) to payload type. |
| 82 std::map<int, int> cng_payload_types_; |
| 83 std::map<int, int> red_payload_types_; |
| 84 |
83 bool encoder_is_opus_; | 85 bool encoder_is_opus_; |
84 | 86 |
85 RTC_DISALLOW_COPY_AND_ASSIGN(CodecManager); | 87 RTC_DISALLOW_COPY_AND_ASSIGN(CodecManager); |
86 }; | 88 }; |
87 | 89 |
88 } // namespace acm2 | 90 } // namespace acm2 |
89 } // namespace webrtc | 91 } // namespace webrtc |
90 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_MANAGER_H_ | 92 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_MANAGER_H_ |
OLD | NEW |