| 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/api/rtpreceiverinterface.h" | 15 #include "webrtc/api/rtpreceiverinterface.h" |
| 16 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
| 17 #include "webrtc/base/race_checker.h" | 17 #include "webrtc/base/race_checker.h" |
| 18 #include "webrtc/base/thread_checker.h" | 18 #include "webrtc/base/thread_checker.h" |
| 19 #include "webrtc/call/rtp_transport_controller_receive.h" |
| 19 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" | 20 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" |
| 20 #include "webrtc/voice_engine/channel_manager.h" | 21 #include "webrtc/voice_engine/channel_manager.h" |
| 21 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" | 22 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
| 22 | 23 |
| 23 #include <memory> | 24 #include <memory> |
| 24 #include <string> | 25 #include <string> |
| 25 #include <vector> | 26 #include <vector> |
| 26 | 27 |
| 27 namespace webrtc { | 28 namespace webrtc { |
| 28 | 29 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 43 | 44 |
| 44 class Channel; | 45 class Channel; |
| 45 | 46 |
| 46 // This class provides the "view" of a voe::Channel that we need to implement | 47 // This class provides the "view" of a voe::Channel that we need to implement |
| 47 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two | 48 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two |
| 48 // purposes: | 49 // purposes: |
| 49 // 1. Allow mocking just the interfaces used, instead of the entire | 50 // 1. Allow mocking just the interfaces used, instead of the entire |
| 50 // voe::Channel class. | 51 // voe::Channel class. |
| 51 // 2. Provide a refined interface for the stream classes, including assumptions | 52 // 2. Provide a refined interface for the stream classes, including assumptions |
| 52 // on return values and input adaptation. | 53 // on return values and input adaptation. |
| 53 class ChannelProxy { | 54 class ChannelProxy : public RtpPacketSinkInterface { |
| 54 public: | 55 public: |
| 55 ChannelProxy(); | 56 ChannelProxy(); |
| 56 explicit ChannelProxy(const ChannelOwner& channel_owner); | 57 explicit ChannelProxy(const ChannelOwner& channel_owner); |
| 57 virtual ~ChannelProxy(); | 58 virtual ~ChannelProxy(); |
| 58 | 59 |
| 59 virtual bool SetEncoder(int payload_type, | 60 virtual bool SetEncoder(int payload_type, |
| 60 std::unique_ptr<AudioEncoder> encoder); | 61 std::unique_ptr<AudioEncoder> encoder); |
| 61 | 62 |
| 62 virtual void SetRTCPStatus(bool enable); | 63 virtual void SetRTCPStatus(bool enable); |
| 63 virtual void SetLocalSSRC(uint32_t ssrc); | 64 virtual void SetLocalSSRC(uint32_t ssrc); |
| 64 virtual void SetRTCP_CNAME(const std::string& c_name); | 65 virtual void SetRTCP_CNAME(const std::string& c_name); |
| 65 virtual void SetNACKStatus(bool enable, int max_packets); | 66 virtual void SetNACKStatus(bool enable, int max_packets); |
| 66 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); | 67 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); |
| 67 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id); | |
| 68 virtual void EnableSendTransportSequenceNumber(int id); | 68 virtual void EnableSendTransportSequenceNumber(int id); |
| 69 virtual void EnableReceiveTransportSequenceNumber(int id); | |
| 70 virtual void RegisterSenderCongestionControlObjects( | 69 virtual void RegisterSenderCongestionControlObjects( |
| 71 RtpTransportControllerSendInterface* transport, | 70 RtpTransportControllerSendInterface* transport, |
| 72 RtcpBandwidthObserver* bandwidth_observer); | 71 RtcpBandwidthObserver* bandwidth_observer); |
| 73 virtual void RegisterReceiverCongestionControlObjects( | 72 virtual void RegisterReceiverCongestionControlObjects( |
| 74 PacketRouter* packet_router); | 73 PacketRouter* packet_router); |
| 75 virtual void ResetSenderCongestionControlObjects(); | 74 virtual void ResetSenderCongestionControlObjects(); |
| 76 virtual void ResetReceiverCongestionControlObjects(); | 75 virtual void ResetReceiverCongestionControlObjects(); |
| 77 virtual CallStatistics GetRTCPStatistics() const; | 76 virtual CallStatistics GetRTCPStatistics() const; |
| 78 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const; | 77 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const; |
| 79 virtual NetworkStatistics GetNetworkStatistics() const; | 78 virtual NetworkStatistics GetNetworkStatistics() const; |
| 80 virtual AudioDecodingCallStats GetDecodingCallStatistics() const; | 79 virtual AudioDecodingCallStats GetDecodingCallStatistics() const; |
| 81 virtual int GetSpeechOutputLevel() const; | 80 virtual int GetSpeechOutputLevel() const; |
| 82 virtual int GetSpeechOutputLevelFullRange() const; | 81 virtual int GetSpeechOutputLevelFullRange() const; |
| 83 virtual uint32_t GetDelayEstimate() const; | 82 virtual uint32_t GetDelayEstimate() const; |
| 84 virtual bool SetSendTelephoneEventPayloadType(int payload_type, | 83 virtual bool SetSendTelephoneEventPayloadType(int payload_type, |
| 85 int payload_frequency); | 84 int payload_frequency); |
| 86 virtual bool SendTelephoneEventOutband(int event, int duration_ms); | 85 virtual bool SendTelephoneEventOutband(int event, int duration_ms); |
| 87 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms); | 86 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms); |
| 88 virtual void SetRecPayloadType(int payload_type, | 87 virtual void SetRecPayloadType(int payload_type, |
| 89 const SdpAudioFormat& format); | 88 const SdpAudioFormat& format); |
| 90 virtual void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); | 89 virtual void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); |
| 91 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); | 90 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); |
| 92 virtual void SetInputMute(bool muted); | 91 virtual void SetInputMute(bool muted); |
| 93 virtual void RegisterExternalTransport(Transport* transport); | 92 virtual void RegisterExternalTransport(Transport* transport); |
| 94 virtual void DeRegisterExternalTransport(); | 93 virtual void DeRegisterExternalTransport(); |
| 95 virtual void OnRtpPacket(const RtpPacketReceived& packet); | 94 // RtpPacketSinkInterface implementation. |
| 95 void OnRtpPacket(const RtpPacketReceived& packet) override; |
| 96 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); | 96 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); |
| 97 virtual const rtc::scoped_refptr<AudioDecoderFactory>& | 97 virtual const rtc::scoped_refptr<AudioDecoderFactory>& |
| 98 GetAudioDecoderFactory() const; | 98 GetAudioDecoderFactory() const; |
| 99 virtual void SetChannelOutputVolumeScaling(float scaling); | 99 virtual void SetChannelOutputVolumeScaling(float scaling); |
| 100 virtual void SetRtcEventLog(RtcEventLog* event_log); | 100 virtual void SetRtcEventLog(RtcEventLog* event_log); |
| 101 virtual void EnableAudioNetworkAdaptor(const std::string& config_string); | 101 virtual void EnableAudioNetworkAdaptor(const std::string& config_string); |
| 102 virtual void DisableAudioNetworkAdaptor(); | 102 virtual void DisableAudioNetworkAdaptor(); |
| 103 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, | 103 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, |
| 104 int max_frame_length_ms); | 104 int max_frame_length_ms); |
| 105 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( | 105 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 rtc::RaceChecker audio_thread_race_checker_; | 144 rtc::RaceChecker audio_thread_race_checker_; |
| 145 rtc::RaceChecker video_capture_thread_race_checker_; | 145 rtc::RaceChecker video_capture_thread_race_checker_; |
| 146 ChannelOwner channel_owner_; | 146 ChannelOwner channel_owner_; |
| 147 | 147 |
| 148 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); | 148 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); |
| 149 }; | 149 }; |
| 150 } // namespace voe | 150 } // namespace voe |
| 151 } // namespace webrtc | 151 } // namespace webrtc |
| 152 | 152 |
| 153 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ | 153 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
| OLD | NEW |