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/call/rtp_transport_controller_receive.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 12 matching lines...) Expand all Loading... |
40 | 41 |
41 class Channel; | 42 class Channel; |
42 | 43 |
43 // This class provides the "view" of a voe::Channel that we need to implement | 44 // This class provides the "view" of a voe::Channel that we need to implement |
44 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two | 45 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two |
45 // purposes: | 46 // purposes: |
46 // 1. Allow mocking just the interfaces used, instead of the entire | 47 // 1. Allow mocking just the interfaces used, instead of the entire |
47 // voe::Channel class. | 48 // voe::Channel class. |
48 // 2. Provide a refined interface for the stream classes, including assumptions | 49 // 2. Provide a refined interface for the stream classes, including assumptions |
49 // on return values and input adaptation. | 50 // on return values and input adaptation. |
50 class ChannelProxy { | 51 class ChannelProxy : public RtpPacketSinkInterface { |
51 public: | 52 public: |
52 ChannelProxy(); | 53 ChannelProxy(); |
53 explicit ChannelProxy(const ChannelOwner& channel_owner); | 54 explicit ChannelProxy(const ChannelOwner& channel_owner); |
54 virtual ~ChannelProxy(); | 55 virtual ~ChannelProxy(); |
55 | 56 |
56 virtual void SetRTCPStatus(bool enable); | 57 virtual void SetRTCPStatus(bool enable); |
57 virtual void SetLocalSSRC(uint32_t ssrc); | 58 virtual void SetLocalSSRC(uint32_t ssrc); |
58 virtual void SetRTCP_CNAME(const std::string& c_name); | 59 virtual void SetRTCP_CNAME(const std::string& c_name); |
59 virtual void SetNACKStatus(bool enable, int max_packets); | 60 virtual void SetNACKStatus(bool enable, int max_packets); |
60 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); | 61 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); |
61 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id); | |
62 virtual void EnableSendTransportSequenceNumber(int id); | 62 virtual void EnableSendTransportSequenceNumber(int id); |
63 virtual void EnableReceiveTransportSequenceNumber(int id); | |
64 virtual void RegisterSenderCongestionControlObjects( | 63 virtual void RegisterSenderCongestionControlObjects( |
65 RtpPacketSender* rtp_packet_sender, | 64 RtpPacketSender* rtp_packet_sender, |
66 TransportFeedbackObserver* transport_feedback_observer, | 65 TransportFeedbackObserver* transport_feedback_observer, |
67 PacketRouter* packet_router, | 66 PacketRouter* packet_router, |
68 RtcpBandwidthObserver* bandwidth_observer); | 67 RtcpBandwidthObserver* bandwidth_observer); |
69 virtual void RegisterReceiverCongestionControlObjects( | 68 virtual void RegisterReceiverCongestionControlObjects( |
70 PacketRouter* packet_router); | 69 PacketRouter* packet_router); |
71 virtual void ResetCongestionControlObjects(); | 70 virtual void ResetCongestionControlObjects(); |
72 virtual CallStatistics GetRTCPStatistics() const; | 71 virtual CallStatistics GetRTCPStatistics() const; |
73 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const; | 72 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const; |
74 virtual NetworkStatistics GetNetworkStatistics() const; | 73 virtual NetworkStatistics GetNetworkStatistics() const; |
75 virtual AudioDecodingCallStats GetDecodingCallStatistics() const; | 74 virtual AudioDecodingCallStats GetDecodingCallStatistics() const; |
76 virtual int GetSpeechOutputLevel() const; | 75 virtual int GetSpeechOutputLevel() const; |
77 virtual int GetSpeechOutputLevelFullRange() const; | 76 virtual int GetSpeechOutputLevelFullRange() const; |
78 virtual uint32_t GetDelayEstimate() const; | 77 virtual uint32_t GetDelayEstimate() const; |
79 virtual bool SetSendTelephoneEventPayloadType(int payload_type, | 78 virtual bool SetSendTelephoneEventPayloadType(int payload_type, |
80 int payload_frequency); | 79 int payload_frequency); |
81 virtual bool SendTelephoneEventOutband(int event, int duration_ms); | 80 virtual bool SendTelephoneEventOutband(int event, int duration_ms); |
82 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms); | 81 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms); |
83 virtual void SetRecPayloadType(int payload_type, | 82 virtual void SetRecPayloadType(int payload_type, |
84 const SdpAudioFormat& format); | 83 const SdpAudioFormat& format); |
85 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); | 84 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); |
86 virtual void SetInputMute(bool muted); | 85 virtual void SetInputMute(bool muted); |
87 virtual void RegisterExternalTransport(Transport* transport); | 86 virtual void RegisterExternalTransport(Transport* transport); |
88 virtual void DeRegisterExternalTransport(); | 87 virtual void DeRegisterExternalTransport(); |
89 virtual void OnRtpPacket(const RtpPacketReceived& packet); | 88 // RtpPacketSinkInterface implementation. |
| 89 void OnRtpPacket(const RtpPacketReceived& packet) override; |
90 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); | 90 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); |
91 virtual const rtc::scoped_refptr<AudioDecoderFactory>& | 91 virtual const rtc::scoped_refptr<AudioDecoderFactory>& |
92 GetAudioDecoderFactory() const; | 92 GetAudioDecoderFactory() const; |
93 virtual void SetChannelOutputVolumeScaling(float scaling); | 93 virtual void SetChannelOutputVolumeScaling(float scaling); |
94 virtual void SetRtcEventLog(RtcEventLog* event_log); | 94 virtual void SetRtcEventLog(RtcEventLog* event_log); |
95 virtual void EnableAudioNetworkAdaptor(const std::string& config_string); | 95 virtual void EnableAudioNetworkAdaptor(const std::string& config_string); |
96 virtual void DisableAudioNetworkAdaptor(); | 96 virtual void DisableAudioNetworkAdaptor(); |
97 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, | 97 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, |
98 int max_frame_length_ms); | 98 int max_frame_length_ms); |
99 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( | 99 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 rtc::RaceChecker audio_thread_race_checker_; | 133 rtc::RaceChecker audio_thread_race_checker_; |
134 rtc::RaceChecker video_capture_thread_race_checker_; | 134 rtc::RaceChecker video_capture_thread_race_checker_; |
135 ChannelOwner channel_owner_; | 135 ChannelOwner channel_owner_; |
136 | 136 |
137 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); | 137 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); |
138 }; | 138 }; |
139 } // namespace voe | 139 } // namespace voe |
140 } // namespace webrtc | 140 } // namespace webrtc |
141 | 141 |
142 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ | 142 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
OLD | NEW |