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

Side by Side Diff: webrtc/video_engine/vie_channel_group.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
« no previous file with comments | « webrtc/video_engine/vie_channel_group.h ('k') | webrtc/video_engine/vie_receiver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 process_thread_->DeRegisterModule(bitrate_controller_.get()); 179 process_thread_->DeRegisterModule(bitrate_controller_.get());
180 process_thread_->DeRegisterModule(call_stats_.get()); 180 process_thread_->DeRegisterModule(call_stats_.get());
181 process_thread_->DeRegisterModule(remote_bitrate_estimator_.get()); 181 process_thread_->DeRegisterModule(remote_bitrate_estimator_.get());
182 call_stats_->DeregisterStatsObserver(remote_bitrate_estimator_.get()); 182 call_stats_->DeregisterStatsObserver(remote_bitrate_estimator_.get());
183 RTC_DCHECK(channel_map_.empty()); 183 RTC_DCHECK(channel_map_.empty());
184 RTC_DCHECK(!remb_->InUse()); 184 RTC_DCHECK(!remb_->InUse());
185 RTC_DCHECK(vie_encoder_map_.empty()); 185 RTC_DCHECK(vie_encoder_map_.empty());
186 } 186 }
187 187
188 bool ChannelGroup::CreateSendChannel(int channel_id, 188 bool ChannelGroup::CreateSendChannel(int channel_id,
189 int engine_id,
190 Transport* transport, 189 Transport* transport,
191 int number_of_cores, 190 int number_of_cores,
192 const std::vector<uint32_t>& ssrcs) { 191 const std::vector<uint32_t>& ssrcs) {
193 RTC_DCHECK(!ssrcs.empty()); 192 RTC_DCHECK(!ssrcs.empty());
194 rtc::scoped_ptr<ViEEncoder> vie_encoder( 193 rtc::scoped_ptr<ViEEncoder> vie_encoder(
195 new ViEEncoder(channel_id, number_of_cores, *process_thread_, 194 new ViEEncoder(channel_id, number_of_cores, *process_thread_,
196 pacer_.get(), bitrate_allocator_.get())); 195 pacer_.get(), bitrate_allocator_.get()));
197 if (!vie_encoder->Init()) { 196 if (!vie_encoder->Init()) {
198 return false; 197 return false;
199 } 198 }
200 ViEEncoder* encoder = vie_encoder.get(); 199 ViEEncoder* encoder = vie_encoder.get();
201 if (!CreateChannel(channel_id, engine_id, transport, number_of_cores, 200 if (!CreateChannel(channel_id, transport, number_of_cores,
202 vie_encoder.release(), ssrcs.size(), true)) { 201 vie_encoder.release(), ssrcs.size(), true)) {
203 return false; 202 return false;
204 } 203 }
205 ViEChannel* channel = channel_map_[channel_id]; 204 ViEChannel* channel = channel_map_[channel_id];
206 // Connect the encoder with the send packet router, to enable sending. 205 // Connect the encoder with the send packet router, to enable sending.
207 encoder->StartThreadsAndSetSharedMembers(channel->send_payload_router(), 206 encoder->StartThreadsAndSetSharedMembers(channel->send_payload_router(),
208 channel->vcm_protection_callback()); 207 channel->vcm_protection_callback());
209 208
210 encoder_state_feedback_->AddEncoder(ssrcs, encoder); 209 encoder_state_feedback_->AddEncoder(ssrcs, encoder);
211 std::vector<uint32_t> first_ssrc(1, ssrcs[0]); 210 std::vector<uint32_t> first_ssrc(1, ssrcs[0]);
212 encoder->SetSsrcs(first_ssrc); 211 encoder->SetSsrcs(first_ssrc);
213 return true; 212 return true;
214 } 213 }
215 214
216 bool ChannelGroup::CreateReceiveChannel(int channel_id, 215 bool ChannelGroup::CreateReceiveChannel(int channel_id,
217 int engine_id,
218 Transport* transport, 216 Transport* transport,
219 int number_of_cores) { 217 int number_of_cores) {
220 return CreateChannel(channel_id, engine_id, transport, number_of_cores, 218 return CreateChannel(channel_id, transport, number_of_cores,
221 nullptr, 1, false); 219 nullptr, 1, false);
222 } 220 }
223 221
224 bool ChannelGroup::CreateChannel(int channel_id, 222 bool ChannelGroup::CreateChannel(int channel_id,
225 int engine_id,
226 Transport* transport, 223 Transport* transport,
227 int number_of_cores, 224 int number_of_cores,
228 ViEEncoder* vie_encoder, 225 ViEEncoder* vie_encoder,
229 size_t max_rtp_streams, 226 size_t max_rtp_streams,
230 bool sender) { 227 bool sender) {
231 rtc::scoped_ptr<ViEChannel> channel(new ViEChannel( 228 rtc::scoped_ptr<ViEChannel> channel(new ViEChannel(
232 channel_id, engine_id, number_of_cores, transport, process_thread_, 229 number_of_cores, transport, process_thread_,
233 encoder_state_feedback_->GetRtcpIntraFrameObserver(), 230 encoder_state_feedback_->GetRtcpIntraFrameObserver(),
234 bitrate_controller_->CreateRtcpBandwidthObserver(), nullptr, 231 bitrate_controller_->CreateRtcpBandwidthObserver(), nullptr,
235 remote_bitrate_estimator_.get(), call_stats_->rtcp_rtt_stats(), 232 remote_bitrate_estimator_.get(), call_stats_->rtcp_rtt_stats(),
236 pacer_.get(), packet_router_.get(), max_rtp_streams, sender)); 233 pacer_.get(), packet_router_.get(), max_rtp_streams, sender));
237 if (channel->Init() != 0) { 234 if (channel->Init() != 0) {
238 return false; 235 return false;
239 } 236 }
240 237
241 // Register the channel to receive stats updates. 238 // Register the channel to receive stats updates.
242 call_stats_->RegisterStatsObserver(channel->GetStatsObserver()); 239 call_stats_->RegisterStatsObserver(channel->GetStatsObserver());
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 rtc::CritScope lock(&encoder_map_crit_); 360 rtc::CritScope lock(&encoder_map_crit_);
364 for (const auto& encoder : vie_encoder_map_) 361 for (const auto& encoder : vie_encoder_map_)
365 pad_up_to_bitrate_bps += encoder.second->GetPaddingNeededBps(); 362 pad_up_to_bitrate_bps += encoder.second->GetPaddingNeededBps();
366 } 363 }
367 pacer_->UpdateBitrate( 364 pacer_->UpdateBitrate(
368 target_bitrate_bps / 1000, 365 target_bitrate_bps / 1000,
369 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, 366 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000,
370 pad_up_to_bitrate_bps / 1000); 367 pad_up_to_bitrate_bps / 1000);
371 } 368 }
372 } // namespace webrtc 369 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video_engine/vie_channel_group.h ('k') | webrtc/video_engine/vie_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698