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

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

Issue 2770233003: Implemented the GetSources() in native code. (Closed)
Patch Set: Renaming. Add a unit test. Resolve the comments. 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
(...skipping 18 matching lines...) Expand all
29 class RtcEventLog; 29 class RtcEventLog;
30 class RtcpBandwidthObserver; 30 class RtcpBandwidthObserver;
31 class RtcpRttStats; 31 class RtcpRttStats;
32 class RtpPacketSender; 32 class RtpPacketSender;
33 class RtpPacketReceived; 33 class RtpPacketReceived;
34 class RtpReceiver; 34 class RtpReceiver;
35 class RtpRtcp; 35 class RtpRtcp;
36 class RtpTransportControllerSendInterface; 36 class RtpTransportControllerSendInterface;
37 class Transport; 37 class Transport;
38 class TransportFeedbackObserver; 38 class TransportFeedbackObserver;
39 struct RtpSource;
the sun 2017/04/05 14:58:30 Can't forward declare since propagating by-value.
Zhi Huang 2017/04/06 03:09:50 Done.
39 40
40 namespace voe { 41 namespace voe {
41 42
42 class Channel; 43 class Channel;
43 44
44 // This class provides the "view" of a voe::Channel that we need to implement 45 // This class provides the "view" of a voe::Channel that we need to implement
45 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two 46 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two
46 // purposes: 47 // purposes:
47 // 1. Allow mocking just the interfaces used, instead of the entire 48 // 1. Allow mocking just the interfaces used, instead of the entire
48 // voe::Channel class. 49 // voe::Channel class.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 virtual bool SetVADStatus(bool enable); 115 virtual bool SetVADStatus(bool enable);
115 virtual bool SetCodecFECStatus(bool enable); 116 virtual bool SetCodecFECStatus(bool enable);
116 virtual bool SetOpusDtx(bool enable); 117 virtual bool SetOpusDtx(bool enable);
117 virtual bool SetOpusMaxPlaybackRate(int frequency_hz); 118 virtual bool SetOpusMaxPlaybackRate(int frequency_hz);
118 virtual bool SetSendCodec(const CodecInst& codec_inst); 119 virtual bool SetSendCodec(const CodecInst& codec_inst);
119 virtual bool SetSendCNPayloadType(int type, PayloadFrequencies frequency); 120 virtual bool SetSendCNPayloadType(int type, PayloadFrequencies frequency);
120 virtual void OnTwccBasedUplinkPacketLossRate(float packet_loss_rate); 121 virtual void OnTwccBasedUplinkPacketLossRate(float packet_loss_rate);
121 virtual void OnRecoverableUplinkPacketLossRate( 122 virtual void OnRecoverableUplinkPacketLossRate(
122 float recoverable_packet_loss_rate); 123 float recoverable_packet_loss_rate);
123 virtual void RegisterLegacyReceiveCodecs(); 124 virtual void RegisterLegacyReceiveCodecs();
125 virtual const std::vector<webrtc::RtpSource> GetSources();
hbos 2017/04/05 11:15:42 Make the return value non-const since it's returne
Zhi Huang 2017/04/06 03:09:50 Done.
124 126
125 private: 127 private:
126 Channel* channel() const; 128 Channel* channel() const;
127 129
128 // Thread checkers document and lock usage of some methods on voe::Channel to 130 // Thread checkers document and lock usage of some methods on voe::Channel to
129 // specific threads we know about. The goal is to eventually split up 131 // specific threads we know about. The goal is to eventually split up
130 // voe::Channel into parts with single-threaded semantics, and thereby reduce 132 // voe::Channel into parts with single-threaded semantics, and thereby reduce
131 // the need for locks. 133 // the need for locks.
132 rtc::ThreadChecker worker_thread_checker_; 134 rtc::ThreadChecker worker_thread_checker_;
133 rtc::ThreadChecker module_process_thread_checker_; 135 rtc::ThreadChecker module_process_thread_checker_;
134 // Methods accessed from audio and video threads are checked for sequential- 136 // Methods accessed from audio and video threads are checked for sequential-
135 // only access. We don't necessarily own and control these threads, so thread 137 // only access. We don't necessarily own and control these threads, so thread
136 // checkers cannot be used. E.g. Chromium may transfer "ownership" from one 138 // checkers cannot be used. E.g. Chromium may transfer "ownership" from one
137 // audio thread to another, but access is still sequential. 139 // audio thread to another, but access is still sequential.
138 rtc::RaceChecker audio_thread_race_checker_; 140 rtc::RaceChecker audio_thread_race_checker_;
139 rtc::RaceChecker video_capture_thread_race_checker_; 141 rtc::RaceChecker video_capture_thread_race_checker_;
140 ChannelOwner channel_owner_; 142 ChannelOwner channel_owner_;
141 143
142 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); 144 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy);
143 }; 145 };
144 } // namespace voe 146 } // namespace voe
145 } // namespace webrtc 147 } // namespace webrtc
146 148
147 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ 149 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698