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

Side by Side Diff: webrtc/video_engine/vie_channel_group.cc

Issue 1354143004: Remove callback_cs_ in ViEEncoder. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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_encoder.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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 Transport* transport, 189 Transport* transport,
190 SendStatisticsProxy* stats_proxy,
191 I420FrameCallback* pre_encode_callback,
190 int number_of_cores, 192 int number_of_cores,
191 const std::vector<uint32_t>& ssrcs) { 193 const std::vector<uint32_t>& ssrcs) {
192 RTC_DCHECK(!ssrcs.empty()); 194 RTC_DCHECK(!ssrcs.empty());
193 rtc::scoped_ptr<ViEEncoder> vie_encoder( 195 rtc::scoped_ptr<ViEEncoder> vie_encoder(new ViEEncoder(
194 new ViEEncoder(channel_id, number_of_cores, *process_thread_, 196 channel_id, number_of_cores, process_thread_, stats_proxy,
195 pacer_.get(), bitrate_allocator_.get())); 197 pre_encode_callback, pacer_.get(), bitrate_allocator_.get()));
196 if (!vie_encoder->Init()) { 198 if (!vie_encoder->Init()) {
197 return false; 199 return false;
198 } 200 }
199 ViEEncoder* encoder = vie_encoder.get(); 201 ViEEncoder* encoder = vie_encoder.get();
200 if (!CreateChannel(channel_id, transport, number_of_cores, 202 if (!CreateChannel(channel_id, transport, number_of_cores,
201 vie_encoder.release(), ssrcs.size(), true)) { 203 vie_encoder.release(), ssrcs.size(), true)) {
202 return false; 204 return false;
203 } 205 }
204 ViEChannel* channel = channel_map_[channel_id]; 206 ViEChannel* channel = channel_map_[channel_id];
205 // Connect the encoder with the send packet router, to enable sending. 207 // Connect the encoder with the send packet router, to enable sending.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 rtc::CritScope lock(&encoder_map_crit_); 362 rtc::CritScope lock(&encoder_map_crit_);
361 for (const auto& encoder : vie_encoder_map_) 363 for (const auto& encoder : vie_encoder_map_)
362 pad_up_to_bitrate_bps += encoder.second->GetPaddingNeededBps(); 364 pad_up_to_bitrate_bps += encoder.second->GetPaddingNeededBps();
363 } 365 }
364 pacer_->UpdateBitrate( 366 pacer_->UpdateBitrate(
365 target_bitrate_bps / 1000, 367 target_bitrate_bps / 1000,
366 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, 368 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000,
367 pad_up_to_bitrate_bps / 1000); 369 pad_up_to_bitrate_bps / 1000);
368 } 370 }
369 } // namespace webrtc 371 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video_engine/vie_channel_group.h ('k') | webrtc/video_engine/vie_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698