blob: 3668de43398395fc65732956d926b52140bdd2d0 [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 {
22namespace voe {
23
solenberg358057b2015-11-27 10:46:42 -080024class Channel;
25
solenberg13725082015-11-25 08:16:52 -080026// This class provides the "view" of a voe::Channel that we need to implement
27// webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two
28// purposes:
29// 1. Allow mocking just the interfaces used, instead of the entire
30// voe::Channel class.
31// 2. Provide a refined interface for the stream classes, including assumptions
32// on return values and input adaptation.
33class ChannelProxy {
34 public:
35 ChannelProxy();
36 explicit ChannelProxy(const ChannelOwner& channel_owner);
37 virtual ~ChannelProxy() {}
38
39 virtual void SetRTCPStatus(bool enable);
40 virtual void SetLocalSSRC(uint32_t ssrc);
41 virtual void SetRTCP_CNAME(const std::string& c_name);
solenberg358057b2015-11-27 10:46:42 -080042 virtual void SetSendAbsoluteSenderTimeStatus(bool enable, int id);
43 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id);
44 virtual void SetReceiveAbsoluteSenderTimeStatus(bool enable, int id);
45 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id);
46
47 virtual CallStatistics GetRTCPStatistics() const;
48 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const;
49 virtual NetworkStatistics GetNetworkStatistics() const;
50 virtual AudioDecodingCallStats GetDecodingCallStatistics() const;
51 virtual int32_t GetSpeechOutputLevelFullRange() const;
52 virtual uint32_t GetDelayEstimate() const;
solenberg13725082015-11-25 08:16:52 -080053
Fredrik Solenbergb5727682015-12-04 15:22:19 +010054 virtual bool SetSendTelephoneEventPayloadType(int payload_type);
55 virtual bool SendTelephoneEventOutband(uint8_t event, uint32_t duration_ms);
56
solenberg13725082015-11-25 08:16:52 -080057 private:
solenberg358057b2015-11-27 10:46:42 -080058 Channel* channel() const;
59
60 rtc::ThreadChecker thread_checker_;
solenberg13725082015-11-25 08:16:52 -080061 ChannelOwner channel_owner_;
62};
63} // namespace voe
64} // namespace webrtc
65
66#endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_