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

Unified Diff: webrtc/voice_engine/channel_proxy.cc

Issue 1482703002: Use ChannelProxy for most calls on voe::Channel in Audio[Receive|Send]Stream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added ThreadChecker to ChannelProxy Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/channel_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel_proxy.cc
diff --git a/webrtc/voice_engine/channel_proxy.cc b/webrtc/voice_engine/channel_proxy.cc
index f53db8748cbf53b3ff105c9460f519c2c428b77f..614b7b72fec1c4bde156085710acf0660de294b2 100644
--- a/webrtc/voice_engine/channel_proxy.cc
+++ b/webrtc/voice_engine/channel_proxy.cc
@@ -23,22 +23,94 @@ ChannelProxy::ChannelProxy(const ChannelOwner& channel_owner) :
}
void ChannelProxy::SetRTCPStatus(bool enable) {
- RTC_DCHECK(channel_owner_.channel());
- channel_owner_.channel()->SetRTCPStatus(enable);
+ channel()->SetRTCPStatus(enable);
}
void ChannelProxy::SetLocalSSRC(uint32_t ssrc) {
- RTC_DCHECK(channel_owner_.channel());
- int error = channel_owner_.channel()->SetLocalSSRC(ssrc);
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ int error = channel()->SetLocalSSRC(ssrc);
RTC_DCHECK_EQ(0, error);
}
void ChannelProxy::SetRTCP_CNAME(const std::string& c_name) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
// Note: VoERTP_RTCP::SetRTCP_CNAME() accepts a char[256] array.
std::string c_name_limited = c_name.substr(0, 255);
- RTC_DCHECK(channel_owner_.channel());
- int error = channel_owner_.channel()->SetRTCP_CNAME(c_name_limited.c_str());
+ int error = channel()->SetRTCP_CNAME(c_name_limited.c_str());
+ RTC_DCHECK_EQ(0, error);
+}
+
+void ChannelProxy::SetSendAbsoluteSenderTimeStatus(bool enable, int id) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ int error = channel()->SetSendAbsoluteSenderTimeStatus(enable, id);
+ RTC_DCHECK_EQ(0, error);
+}
+
+void ChannelProxy::SetSendAudioLevelIndicationStatus(bool enable, int id) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ int error = channel()->SetSendAudioLevelIndicationStatus(enable, id);
+ RTC_DCHECK_EQ(0, error);
+}
+
+void ChannelProxy::SetReceiveAbsoluteSenderTimeStatus(bool enable, int id) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ int error = channel()->SetReceiveAbsoluteSenderTimeStatus(enable, id);
+ RTC_DCHECK_EQ(0, error);
+}
+
+void ChannelProxy::SetReceiveAudioLevelIndicationStatus(bool enable, int id) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ int error = channel()->SetReceiveAudioLevelIndicationStatus(enable, id);
+ RTC_DCHECK_EQ(0, error);
+}
+
+CallStatistics ChannelProxy::GetRTCPStatistics() const {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ CallStatistics stats = {0};
+ int error = channel()->GetRTPStatistics(stats);
RTC_DCHECK_EQ(0, error);
+ return stats;
+}
+
+std::vector<ReportBlock> ChannelProxy::GetRemoteRTCPReportBlocks() const {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ std::vector<webrtc::ReportBlock> blocks;
+ int error = channel()->GetRemoteRTCPReportBlocks(&blocks);
+ RTC_DCHECK_EQ(0, error);
+ return blocks;
+}
+
+NetworkStatistics ChannelProxy::GetNetworkStatistics() const {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ NetworkStatistics stats = {0};
+ int error = channel()->GetNetworkStatistics(stats);
+ RTC_DCHECK_EQ(0, error);
+ return stats;
+}
+
+AudioDecodingCallStats ChannelProxy::GetDecodingCallStatistics() const {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ AudioDecodingCallStats stats;
+ channel()->GetDecodingCallStatistics(&stats);
+ return stats;
+}
+
+int32_t ChannelProxy::GetSpeechOutputLevelFullRange() const {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ uint32_t level = 0;
+ int error = channel()->GetSpeechOutputLevelFullRange(level);
+ RTC_DCHECK_EQ(0, error);
+ return static_cast<int32_t>(level);
+}
+
+uint32_t ChannelProxy::GetDelayEstimate() const {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ return channel()->GetDelayEstimate();
+}
+
+Channel* ChannelProxy::channel() const {
+ RTC_DCHECK(channel_owner_.channel());
+ return channel_owner_.channel();
}
} // namespace voe
} // namespace webrtc
« no previous file with comments | « webrtc/voice_engine/channel_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698