blob: 9d6839c8def04efe8de84cbaaab9a42713b1c940 [file] [log] [blame]
solenberg13725082015-11-25 08:16:52 -08001/*
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
solenberg358057b2015-11-27 10:46:42 -080014#include "webrtc/base/thread_checker.h"
solenberg13725082015-11-25 08:16:52 -080015#include "webrtc/voice_engine/channel_manager.h"
solenberg358057b2015-11-27 10:46:42 -080016#include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
solenberg13725082015-11-25 08:16:52 -080017
18#include <string>
solenberg358057b2015-11-27 10:46:42 -080019#include <vector>
solenberg13725082015-11-25 08:16:52 -080020
21namespace webrtc {
Stefan Holmerb86d4e42015-12-07 10:26:18 +010022
Tommif888bb52015-12-12 01:37:01 +010023class AudioSinkInterface;
Stefan Holmerb86d4e42015-12-07 10:26:18 +010024class PacketRouter;
25class RtpPacketSender;
26class TransportFeedbackObserver;
27
solenberg13725082015-11-25 08:16:52 -080028namespace voe {
29
solenberg358057b2015-11-27 10:46:42 -080030class Channel;
31
solenberg13725082015-11-25 08:16:52 -080032// 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.
39class ChannelProxy {
40 public:
41 ChannelProxy();
42 explicit ChannelProxy(const ChannelOwner& channel_owner);
Tommif888bb52015-12-12 01:37:01 +010043 virtual ~ChannelProxy();
solenberg13725082015-11-25 08:16:52 -080044
45 virtual void SetRTCPStatus(bool enable);
46 virtual void SetLocalSSRC(uint32_t ssrc);
47 virtual void SetRTCP_CNAME(const std::string& c_name);
solenberg358057b2015-11-27 10:46:42 -080048 virtual void SetSendAbsoluteSenderTimeStatus(bool enable, int id);
49 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id);
50 virtual void SetReceiveAbsoluteSenderTimeStatus(bool enable, int id);
51 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id);
stefan3313ec92016-01-21 06:32:43 -080052 virtual void EnableSendTransportSequenceNumber(int id);
53 virtual void EnableReceiveTransportSequenceNumber(int id);
stefanbba9dec2016-02-01 04:39:55 -080054 virtual void RegisterSenderCongestionControlObjects(
Stefan Holmerb86d4e42015-12-07 10:26:18 +010055 RtpPacketSender* rtp_packet_sender,
56 TransportFeedbackObserver* transport_feedback_observer,
57 PacketRouter* packet_router);
stefanbba9dec2016-02-01 04:39:55 -080058 virtual void RegisterReceiverCongestionControlObjects(
59 PacketRouter* packet_router);
60 virtual void ResetCongestionControlObjects();
solenberg358057b2015-11-27 10:46:42 -080061
62 virtual CallStatistics GetRTCPStatistics() const;
63 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const;
64 virtual NetworkStatistics GetNetworkStatistics() const;
65 virtual AudioDecodingCallStats GetDecodingCallStatistics() const;
66 virtual int32_t GetSpeechOutputLevelFullRange() const;
67 virtual uint32_t GetDelayEstimate() const;
solenberg13725082015-11-25 08:16:52 -080068
Fredrik Solenbergb5727682015-12-04 15:22:19 +010069 virtual bool SetSendTelephoneEventPayloadType(int payload_type);
70 virtual bool SendTelephoneEventOutband(uint8_t event, uint32_t duration_ms);
71
deadbeef2d110be2016-01-13 12:00:26 -080072 virtual void SetSink(rtc::scoped_ptr<AudioSinkInterface> sink);
Tommif888bb52015-12-12 01:37:01 +010073
solenberg13725082015-11-25 08:16:52 -080074 private:
solenberg358057b2015-11-27 10:46:42 -080075 Channel* channel() const;
76
77 rtc::ThreadChecker thread_checker_;
solenberg13725082015-11-25 08:16:52 -080078 ChannelOwner channel_owner_;
79};
80} // namespace voe
81} // namespace webrtc
82
83#endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_