Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Side by Side Diff: webrtc/voice_engine/channel_proxy.h

Issue 2709723003: Initial implementation of RtpTransportControllerReceive and related interfaces.
Patch Set: Fix audio. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/modules/audio_coding/codecs/audio_encoder.h" 19 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
19 #include "webrtc/voice_engine/channel_manager.h" 20 #include "webrtc/voice_engine/channel_manager.h"
20 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" 21 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
21 22
22 #include <memory> 23 #include <memory>
23 #include <string> 24 #include <string>
24 #include <vector> 25 #include <vector>
25 26
26 namespace webrtc { 27 namespace webrtc {
27 28
(...skipping 14 matching lines...) Expand all
42 43
43 class Channel; 44 class Channel;
44 45
45 // This class provides the "view" of a voe::Channel that we need to implement 46 // This class provides the "view" of a voe::Channel that we need to implement
46 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two 47 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two
47 // purposes: 48 // purposes:
48 // 1. Allow mocking just the interfaces used, instead of the entire 49 // 1. Allow mocking just the interfaces used, instead of the entire
49 // voe::Channel class. 50 // voe::Channel class.
50 // 2. Provide a refined interface for the stream classes, including assumptions 51 // 2. Provide a refined interface for the stream classes, including assumptions
51 // on return values and input adaptation. 52 // on return values and input adaptation.
52 class ChannelProxy { 53 class ChannelProxy : public RtpPacketSinkInterface {
the sun 2017/04/18 09:59:00 No, I don't think you should register the ChannelP
nisse-webrtc 2017/04/19 08:35:43 I'll give it a try.
53 public: 54 public:
54 ChannelProxy(); 55 ChannelProxy();
55 explicit ChannelProxy(const ChannelOwner& channel_owner); 56 explicit ChannelProxy(const ChannelOwner& channel_owner);
56 virtual ~ChannelProxy(); 57 virtual ~ChannelProxy();
57 58
58 virtual bool SetEncoder(int payload_type, 59 virtual bool SetEncoder(int payload_type,
59 std::unique_ptr<AudioEncoder> encoder); 60 std::unique_ptr<AudioEncoder> encoder);
60 61
61 virtual void SetRTCPStatus(bool enable); 62 virtual void SetRTCPStatus(bool enable);
62 virtual void SetLocalSSRC(uint32_t ssrc); 63 virtual void SetLocalSSRC(uint32_t ssrc);
63 virtual void SetRTCP_CNAME(const std::string& c_name); 64 virtual void SetRTCP_CNAME(const std::string& c_name);
64 virtual void SetNACKStatus(bool enable, int max_packets); 65 virtual void SetNACKStatus(bool enable, int max_packets);
65 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); 66 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id);
66 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id);
67 virtual void EnableSendTransportSequenceNumber(int id); 67 virtual void EnableSendTransportSequenceNumber(int id);
68 virtual void EnableReceiveTransportSequenceNumber(int id);
69 virtual void RegisterSenderCongestionControlObjects( 68 virtual void RegisterSenderCongestionControlObjects(
70 RtpTransportControllerSendInterface* transport, 69 RtpTransportControllerSendInterface* transport,
71 RtcpBandwidthObserver* bandwidth_observer); 70 RtcpBandwidthObserver* bandwidth_observer);
72 virtual void RegisterReceiverCongestionControlObjects( 71 virtual void RegisterReceiverCongestionControlObjects(
73 PacketRouter* packet_router); 72 PacketRouter* packet_router);
74 virtual void ResetSenderCongestionControlObjects(); 73 virtual void ResetSenderCongestionControlObjects();
75 virtual void ResetReceiverCongestionControlObjects(); 74 virtual void ResetReceiverCongestionControlObjects();
76 virtual CallStatistics GetRTCPStatistics() const; 75 virtual CallStatistics GetRTCPStatistics() const;
77 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const; 76 virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const;
78 virtual NetworkStatistics GetNetworkStatistics() const; 77 virtual NetworkStatistics GetNetworkStatistics() const;
79 virtual AudioDecodingCallStats GetDecodingCallStatistics() const; 78 virtual AudioDecodingCallStats GetDecodingCallStatistics() const;
80 virtual int GetSpeechOutputLevel() const; 79 virtual int GetSpeechOutputLevel() const;
81 virtual int GetSpeechOutputLevelFullRange() const; 80 virtual int GetSpeechOutputLevelFullRange() const;
82 virtual uint32_t GetDelayEstimate() const; 81 virtual uint32_t GetDelayEstimate() const;
83 virtual bool SetSendTelephoneEventPayloadType(int payload_type, 82 virtual bool SetSendTelephoneEventPayloadType(int payload_type,
84 int payload_frequency); 83 int payload_frequency);
85 virtual bool SendTelephoneEventOutband(int event, int duration_ms); 84 virtual bool SendTelephoneEventOutband(int event, int duration_ms);
86 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms); 85 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms);
87 virtual void SetRecPayloadType(int payload_type, 86 virtual void SetRecPayloadType(int payload_type,
88 const SdpAudioFormat& format); 87 const SdpAudioFormat& format);
89 virtual void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); 88 virtual void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs);
90 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); 89 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink);
91 virtual void SetInputMute(bool muted); 90 virtual void SetInputMute(bool muted);
92 virtual void RegisterExternalTransport(Transport* transport); 91 virtual void RegisterExternalTransport(Transport* transport);
93 virtual void DeRegisterExternalTransport(); 92 virtual void DeRegisterExternalTransport();
94 virtual void OnRtpPacket(const RtpPacketReceived& packet); 93 // RtpPacketSinkInterface implementation.
94 void OnRtpPacket(const RtpPacketReceived& packet) override;
95 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); 95 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length);
96 virtual const rtc::scoped_refptr<AudioDecoderFactory>& 96 virtual const rtc::scoped_refptr<AudioDecoderFactory>&
97 GetAudioDecoderFactory() const; 97 GetAudioDecoderFactory() const;
98 virtual void SetChannelOutputVolumeScaling(float scaling); 98 virtual void SetChannelOutputVolumeScaling(float scaling);
99 virtual void SetRtcEventLog(RtcEventLog* event_log); 99 virtual void SetRtcEventLog(RtcEventLog* event_log);
100 virtual void EnableAudioNetworkAdaptor(const std::string& config_string); 100 virtual void EnableAudioNetworkAdaptor(const std::string& config_string);
101 virtual void DisableAudioNetworkAdaptor(); 101 virtual void DisableAudioNetworkAdaptor();
102 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, 102 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms,
103 int max_frame_length_ms); 103 int max_frame_length_ms);
104 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( 104 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 rtc::RaceChecker audio_thread_race_checker_; 142 rtc::RaceChecker audio_thread_race_checker_;
143 rtc::RaceChecker video_capture_thread_race_checker_; 143 rtc::RaceChecker video_capture_thread_race_checker_;
144 ChannelOwner channel_owner_; 144 ChannelOwner channel_owner_;
145 145
146 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); 146 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy);
147 }; 147 };
148 } // namespace voe 148 } // namespace voe
149 } // namespace webrtc 149 } // namespace webrtc
150 150
151 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ 151 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698