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_VOICE_ENGINE_CHANNEL_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/api/audio/audio_mixer.h" | 16 #include "webrtc/api/audio/audio_mixer.h" |
17 #include "webrtc/api/call/audio_sink.h" | 17 #include "webrtc/api/call/audio_sink.h" |
18 #include "webrtc/base/criticalsection.h" | 18 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/base/event.h" | 19 #include "webrtc/base/event.h" |
20 #include "webrtc/base/optional.h" | 20 #include "webrtc/base/optional.h" |
21 #include "webrtc/base/thread_checker.h" | 21 #include "webrtc/base/thread_checker.h" |
22 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 22 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
23 #include "webrtc/common_types.h" | 23 #include "webrtc/common_types.h" |
24 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" | 24 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" |
25 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 25 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
| 26 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" |
26 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 27 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
27 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 28 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
28 #include "webrtc/modules/audio_processing/rms_level.h" | 29 #include "webrtc/modules/audio_processing/rms_level.h" |
29 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 30 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
30 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 31 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
31 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 32 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
32 #include "webrtc/voice_engine/audio_level.h" | 33 #include "webrtc/voice_engine/audio_level.h" |
33 #include "webrtc/voice_engine/file_player.h" | 34 #include "webrtc/voice_engine/file_player.h" |
34 #include "webrtc/voice_engine/file_recorder.h" | 35 #include "webrtc/voice_engine/file_recorder.h" |
35 #include "webrtc/voice_engine/include/voe_base.h" | 36 #include "webrtc/voice_engine/include/voe_base.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 void SetSink(std::unique_ptr<AudioSinkInterface> sink); | 166 void SetSink(std::unique_ptr<AudioSinkInterface> sink); |
166 | 167 |
167 // TODO(ossu): Don't use! It's only here to confirm that the decoder factory | 168 // TODO(ossu): Don't use! It's only here to confirm that the decoder factory |
168 // passed into AudioReceiveStream is the same as the one set when creating the | 169 // passed into AudioReceiveStream is the same as the one set when creating the |
169 // ADM. Once Channel creation is moved into Audio{Send,Receive}Stream this can | 170 // ADM. Once Channel creation is moved into Audio{Send,Receive}Stream this can |
170 // go. | 171 // go. |
171 const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const; | 172 const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const; |
172 | 173 |
173 void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); | 174 void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); |
174 | 175 |
| 176 // Send using this encoder, with this payload type. |
| 177 bool SetEncoder(int payload_type, std::unique_ptr<AudioEncoder> encoder); |
| 178 |
175 // API methods | 179 // API methods |
176 | 180 |
177 // VoEBase | 181 // VoEBase |
178 int32_t StartPlayout(); | 182 int32_t StartPlayout(); |
179 int32_t StopPlayout(); | 183 int32_t StopPlayout(); |
180 int32_t StartSend(); | 184 int32_t StartSend(); |
181 void StopSend(); | 185 void StopSend(); |
182 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); | 186 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); |
183 int32_t DeRegisterVoiceEngineObserver(); | 187 int32_t DeRegisterVoiceEngineObserver(); |
184 | 188 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 540 |
537 const bool use_twcc_plr_for_ana_; | 541 const bool use_twcc_plr_for_ana_; |
538 | 542 |
539 rtc::TaskQueue* encoder_queue_ = nullptr; | 543 rtc::TaskQueue* encoder_queue_ = nullptr; |
540 }; | 544 }; |
541 | 545 |
542 } // namespace voe | 546 } // namespace voe |
543 } // namespace webrtc | 547 } // namespace webrtc |
544 | 548 |
545 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 549 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
OLD | NEW |