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

Side by Side Diff: webrtc/voice_engine/test/auto_test/fakes/conference_transport.cc

Issue 1335353005: Remove channel ids from various interfaces. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 3 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 remote_base_->Release(); 101 remote_base_->Release();
102 102
103 local_rtp_rtcp_->Release(); 103 local_rtp_rtcp_->Release();
104 local_network_->Release(); 104 local_network_->Release();
105 local_base_->Release(); 105 local_base_->Release();
106 106
107 EXPECT_TRUE(webrtc::VoiceEngine::Delete(remote_voe_)); 107 EXPECT_TRUE(webrtc::VoiceEngine::Delete(remote_voe_));
108 EXPECT_TRUE(webrtc::VoiceEngine::Delete(local_voe_)); 108 EXPECT_TRUE(webrtc::VoiceEngine::Delete(local_voe_));
109 } 109 }
110 110
111 int ConferenceTransport::SendPacket(int channel, const void* data, size_t len) { 111 int ConferenceTransport::SendPacket(const void* data, size_t len) {
112 StorePacket(Packet::Rtp, channel, data, len); 112 StorePacket(Packet::Rtp, data, len);
113 return static_cast<int>(len); 113 return static_cast<int>(len);
114 } 114 }
115 115
116 int ConferenceTransport::SendRTCPPacket(int channel, const void* data, 116 int ConferenceTransport::SendRTCPPacket(const void* data, size_t len) {
117 size_t len) { 117 StorePacket(Packet::Rtcp, data, len);
118 StorePacket(Packet::Rtcp, channel, data, len);
119 return static_cast<int>(len); 118 return static_cast<int>(len);
120 } 119 }
121 120
122 int ConferenceTransport::GetReceiverChannelForSsrc(unsigned int sender_ssrc) 121 int ConferenceTransport::GetReceiverChannelForSsrc(unsigned int sender_ssrc)
123 const { 122 const {
124 webrtc::CriticalSectionScoped lock(stream_crit_.get()); 123 webrtc::CriticalSectionScoped lock(stream_crit_.get());
125 auto it = streams_.find(sender_ssrc); 124 auto it = streams_.find(sender_ssrc);
126 if (it != streams_.end()) { 125 if (it != streams_.end()) {
127 return it->second.second; 126 return it->second.second;
128 } 127 }
129 return -1; 128 return -1;
130 } 129 }
131 130
132 void ConferenceTransport::StorePacket(Packet::Type type, int channel, 131 void ConferenceTransport::StorePacket(Packet::Type type,
133 const void* data, size_t len) { 132 const void* data,
133 size_t len) {
134 { 134 {
135 webrtc::CriticalSectionScoped lock(pq_crit_.get()); 135 webrtc::CriticalSectionScoped lock(pq_crit_.get());
136 packet_queue_.push_back(Packet(type, channel, data, len, rtc::Time())); 136 packet_queue_.push_back(Packet(type, data, len, rtc::Time()));
137 } 137 }
138 packet_event_->Set(); 138 packet_event_->Set();
139 } 139 }
140 140
141 // This simulates the flow of RTP and RTCP packets. Complications like that 141 // This simulates the flow of RTP and RTCP packets. Complications like that
142 // a packet is first sent to the reflector, and then forwarded to the receiver 142 // a packet is first sent to the reflector, and then forwarded to the receiver
143 // are simplified, in this particular case, to a direct link between the sender 143 // are simplified, in this particular case, to a direct link between the sender
144 // and the receiver. 144 // and the receiver.
145 void ConferenceTransport::SendPacket(const Packet& packet) { 145 void ConferenceTransport::SendPacket(const Packet& packet) {
146 int destination = -1; 146 int destination = -1;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 bool ConferenceTransport::GetReceiverStatistics(unsigned int id, 279 bool ConferenceTransport::GetReceiverStatistics(unsigned int id,
280 webrtc::CallStatistics* stats) { 280 webrtc::CallStatistics* stats) {
281 int dst = GetReceiverChannelForSsrc(id); 281 int dst = GetReceiverChannelForSsrc(id);
282 if (dst == -1) { 282 if (dst == -1) {
283 return false; 283 return false;
284 } 284 }
285 EXPECT_EQ(0, local_rtp_rtcp_->GetRTCPStatistics(dst, *stats)); 285 EXPECT_EQ(0, local_rtp_rtcp_->GetRTCPStatistics(dst, *stats));
286 return true; 286 return true;
287 } 287 }
288 } // namespace voetest 288 } // namespace voetest
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698