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_VOICE_ENGINE_CHANNEL_PROXY_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
12 #define WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
13 | 13 |
14 #include "webrtc/api/audio/audio_mixer.h" | 14 #include "webrtc/api/audio/audio_mixer.h" |
15 #include "webrtc/base/constructormagic.h" | 15 #include "webrtc/base/constructormagic.h" |
16 #include "webrtc/base/race_checker.h" | 16 #include "webrtc/base/race_checker.h" |
17 #include "webrtc/base/thread_checker.h" | 17 #include "webrtc/base/thread_checker.h" |
| 18 #include "webrtc/modules/audio_coding/codecs/audio_encoder_factory.h" |
18 #include "webrtc/voice_engine/channel_manager.h" | 19 #include "webrtc/voice_engine/channel_manager.h" |
19 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" | 20 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
20 | 21 |
21 #include <memory> | 22 #include <memory> |
22 #include <string> | 23 #include <string> |
23 #include <vector> | 24 #include <vector> |
24 | 25 |
25 namespace webrtc { | 26 namespace webrtc { |
26 | 27 |
27 class AudioSinkInterface; | 28 class AudioSinkInterface; |
(...skipping 17 matching lines...) Expand all Loading... |
45 // 1. Allow mocking just the interfaces used, instead of the entire | 46 // 1. Allow mocking just the interfaces used, instead of the entire |
46 // voe::Channel class. | 47 // voe::Channel class. |
47 // 2. Provide a refined interface for the stream classes, including assumptions | 48 // 2. Provide a refined interface for the stream classes, including assumptions |
48 // on return values and input adaptation. | 49 // on return values and input adaptation. |
49 class ChannelProxy { | 50 class ChannelProxy { |
50 public: | 51 public: |
51 ChannelProxy(); | 52 ChannelProxy(); |
52 explicit ChannelProxy(const ChannelOwner& channel_owner); | 53 explicit ChannelProxy(const ChannelOwner& channel_owner); |
53 virtual ~ChannelProxy(); | 54 virtual ~ChannelProxy(); |
54 | 55 |
| 56 virtual bool SetSendFormat(int payload_type, |
| 57 const SdpAudioFormat& format, |
| 58 AudioEncoderFactory* factory); |
| 59 |
55 virtual void SetRTCPStatus(bool enable); | 60 virtual void SetRTCPStatus(bool enable); |
56 virtual void SetLocalSSRC(uint32_t ssrc); | 61 virtual void SetLocalSSRC(uint32_t ssrc); |
57 virtual void SetRTCP_CNAME(const std::string& c_name); | 62 virtual void SetRTCP_CNAME(const std::string& c_name); |
58 virtual void SetNACKStatus(bool enable, int max_packets); | 63 virtual void SetNACKStatus(bool enable, int max_packets); |
59 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); | 64 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); |
60 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id); | 65 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id); |
61 virtual void EnableSendTransportSequenceNumber(int id); | 66 virtual void EnableSendTransportSequenceNumber(int id); |
62 virtual void EnableReceiveTransportSequenceNumber(int id); | 67 virtual void EnableReceiveTransportSequenceNumber(int id); |
63 virtual void RegisterSenderCongestionControlObjects( | 68 virtual void RegisterSenderCongestionControlObjects( |
64 RtpPacketSender* rtp_packet_sender, | 69 RtpPacketSender* rtp_packet_sender, |
(...skipping 18 matching lines...) Expand all Loading... |
83 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); | 88 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); |
84 virtual void SetInputMute(bool muted); | 89 virtual void SetInputMute(bool muted); |
85 virtual void RegisterExternalTransport(Transport* transport); | 90 virtual void RegisterExternalTransport(Transport* transport); |
86 virtual void DeRegisterExternalTransport(); | 91 virtual void DeRegisterExternalTransport(); |
87 virtual bool ReceivedRTPPacket(const uint8_t* packet, | 92 virtual bool ReceivedRTPPacket(const uint8_t* packet, |
88 size_t length, | 93 size_t length, |
89 const PacketTime& packet_time); | 94 const PacketTime& packet_time); |
90 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); | 95 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); |
91 virtual const rtc::scoped_refptr<AudioDecoderFactory>& | 96 virtual const rtc::scoped_refptr<AudioDecoderFactory>& |
92 GetAudioDecoderFactory() const; | 97 GetAudioDecoderFactory() const; |
| 98 virtual AudioCodingModule& GetAudioCodingModule(); |
93 virtual void SetChannelOutputVolumeScaling(float scaling); | 99 virtual void SetChannelOutputVolumeScaling(float scaling); |
94 virtual void SetRtcEventLog(RtcEventLog* event_log); | 100 virtual void SetRtcEventLog(RtcEventLog* event_log); |
95 virtual void EnableAudioNetworkAdaptor(const std::string& config_string); | 101 virtual void EnableAudioNetworkAdaptor(const std::string& config_string); |
96 virtual void DisableAudioNetworkAdaptor(); | 102 virtual void DisableAudioNetworkAdaptor(); |
97 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, | 103 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, |
98 int max_frame_length_ms); | 104 int max_frame_length_ms); |
99 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( | 105 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( |
100 int sample_rate_hz, | 106 int sample_rate_hz, |
101 AudioFrame* audio_frame); | 107 AudioFrame* audio_frame); |
102 virtual int NeededFrequency() const; | 108 virtual int NeededFrequency() const; |
(...skipping 30 matching lines...) Expand all Loading... |
133 rtc::RaceChecker audio_thread_race_checker_; | 139 rtc::RaceChecker audio_thread_race_checker_; |
134 rtc::RaceChecker video_capture_thread_race_checker_; | 140 rtc::RaceChecker video_capture_thread_race_checker_; |
135 ChannelOwner channel_owner_; | 141 ChannelOwner channel_owner_; |
136 | 142 |
137 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); | 143 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); |
138 }; | 144 }; |
139 } // namespace voe | 145 } // namespace voe |
140 } // namespace webrtc | 146 } // namespace webrtc |
141 | 147 |
142 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ | 148 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
OLD | NEW |