solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
| 12 | #define WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
| 13 | |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 14 | #include "webrtc/base/thread_checker.h" |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 15 | #include "webrtc/voice_engine/channel_manager.h" |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 16 | #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 17 | |
| 18 | #include <string> |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 19 | #include <vector> |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 22 | |
Tommi | f888bb5 | 2015-12-12 01:37:01 +0100 | [diff] [blame^] | 23 | class AudioSinkInterface; |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 24 | class PacketRouter; |
| 25 | class RtpPacketSender; |
| 26 | class TransportFeedbackObserver; |
| 27 | |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 28 | namespace voe { |
| 29 | |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 30 | class Channel; |
| 31 | |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 32 | // This class provides the "view" of a voe::Channel that we need to implement |
| 33 | // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two |
| 34 | // purposes: |
| 35 | // 1. Allow mocking just the interfaces used, instead of the entire |
| 36 | // voe::Channel class. |
| 37 | // 2. Provide a refined interface for the stream classes, including assumptions |
| 38 | // on return values and input adaptation. |
| 39 | class ChannelProxy { |
| 40 | public: |
| 41 | ChannelProxy(); |
| 42 | explicit ChannelProxy(const ChannelOwner& channel_owner); |
Tommi | f888bb5 | 2015-12-12 01:37:01 +0100 | [diff] [blame^] | 43 | virtual ~ChannelProxy(); |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 44 | |
| 45 | virtual void SetRTCPStatus(bool enable); |
| 46 | virtual void SetLocalSSRC(uint32_t ssrc); |
| 47 | virtual void SetRTCP_CNAME(const std::string& c_name); |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 48 | virtual void SetSendAbsoluteSenderTimeStatus(bool enable, int id); |
| 49 | virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 50 | virtual void EnableSendTransportSequenceNumber(int id); |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 51 | virtual void SetReceiveAbsoluteSenderTimeStatus(bool enable, int id); |
| 52 | virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id); |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 53 | virtual void SetCongestionControlObjects( |
| 54 | RtpPacketSender* rtp_packet_sender, |
| 55 | TransportFeedbackObserver* transport_feedback_observer, |
| 56 | PacketRouter* packet_router); |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 57 | |
| 58 | virtual CallStatistics GetRTCPStatistics() const; |
| 59 | virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const; |
| 60 | virtual NetworkStatistics GetNetworkStatistics() const; |
| 61 | virtual AudioDecodingCallStats GetDecodingCallStatistics() const; |
| 62 | virtual int32_t GetSpeechOutputLevelFullRange() const; |
| 63 | virtual uint32_t GetDelayEstimate() const; |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 64 | |
Fredrik Solenberg | b572768 | 2015-12-04 15:22:19 +0100 | [diff] [blame] | 65 | virtual bool SetSendTelephoneEventPayloadType(int payload_type); |
| 66 | virtual bool SendTelephoneEventOutband(uint8_t event, uint32_t duration_ms); |
| 67 | |
Tommi | f888bb5 | 2015-12-12 01:37:01 +0100 | [diff] [blame^] | 68 | virtual void SetSink(rtc::scoped_ptr<AudioSinkInterface> sink); |
| 69 | |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 70 | private: |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 71 | Channel* channel() const; |
| 72 | |
| 73 | rtc::ThreadChecker thread_checker_; |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 74 | ChannelOwner channel_owner_; |
| 75 | }; |
| 76 | } // namespace voe |
| 77 | } // namespace webrtc |
| 78 | |
| 79 | #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |