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

Side by Side Diff: webrtc/pc/channelmanager.cc

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: Address the comments. Created 3 years, 7 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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 RTC_DCHECK(network_thread_); 135 RTC_DCHECK(network_thread_);
136 RTC_DCHECK(worker_thread_); 136 RTC_DCHECK(worker_thread_);
137 if (!network_thread_->IsCurrent()) { 137 if (!network_thread_->IsCurrent()) {
138 // Do not allow invoking calls to other threads on the network thread. 138 // Do not allow invoking calls to other threads on the network thread.
139 network_thread_->Invoke<bool>( 139 network_thread_->Invoke<bool>(
140 RTC_FROM_HERE, 140 RTC_FROM_HERE,
141 rtc::Bind(&rtc::Thread::SetAllowBlockingCalls, network_thread_, false)); 141 rtc::Bind(&rtc::Thread::SetAllowBlockingCalls, network_thread_, false));
142 } 142 }
143 143
144 #ifdef HAVE_MEDIA
144 initialized_ = worker_thread_->Invoke<bool>( 145 initialized_ = worker_thread_->Invoke<bool>(
145 RTC_FROM_HERE, Bind(&ChannelManager::InitMediaEngine_w, this)); 146 RTC_FROM_HERE, Bind(&ChannelManager::InitMediaEngine_w, this));
147 #else
148 initialized_ = true;
149 #endif
146 RTC_DCHECK(initialized_); 150 RTC_DCHECK(initialized_);
147 return initialized_; 151 return initialized_;
148 } 152 }
149 153
150 bool ChannelManager::InitMediaEngine_w() { 154 bool ChannelManager::InitMediaEngine_w() {
151 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); 155 RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
156 RTC_DCHECK(media_engine_);
152 return media_engine_->Init(); 157 return media_engine_->Init();
153 } 158 }
154 159
155 void ChannelManager::Terminate() { 160 void ChannelManager::Terminate() {
156 RTC_DCHECK(initialized_); 161 RTC_DCHECK(initialized_);
157 if (!initialized_) { 162 if (!initialized_) {
158 return; 163 return;
159 } 164 }
160 worker_thread_->Invoke<void>(RTC_FROM_HERE, 165 worker_thread_->Invoke<void>(RTC_FROM_HERE,
161 Bind(&ChannelManager::Terminate_w, this)); 166 Bind(&ChannelManager::Terminate_w, this));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 rtc::PacketTransportInternal* rtp_packet_transport, 220 rtc::PacketTransportInternal* rtp_packet_transport,
216 rtc::PacketTransportInternal* rtcp_packet_transport, 221 rtc::PacketTransportInternal* rtcp_packet_transport,
217 rtc::Thread* signaling_thread, 222 rtc::Thread* signaling_thread,
218 const std::string& content_name, 223 const std::string& content_name,
219 bool srtp_required, 224 bool srtp_required,
220 const AudioOptions& options) { 225 const AudioOptions& options) {
221 RTC_DCHECK(initialized_); 226 RTC_DCHECK(initialized_);
222 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); 227 RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
223 RTC_DCHECK(nullptr != media_controller); 228 RTC_DCHECK(nullptr != media_controller);
224 229
230 #ifndef HAVE_MEDIA
231 return nullptr;
232 #endif
225 VoiceMediaChannel* media_channel = media_engine_->CreateChannel( 233 VoiceMediaChannel* media_channel = media_engine_->CreateChannel(
226 media_controller->call_w(), media_controller->config(), options); 234 media_controller->call_w(), media_controller->config(), options);
227 if (!media_channel) 235 if (!media_channel)
228 return nullptr; 236 return nullptr;
229 237
230 VoiceChannel* voice_channel = 238 VoiceChannel* voice_channel =
231 new VoiceChannel(worker_thread_, network_thread_, signaling_thread, 239 new VoiceChannel(worker_thread_, network_thread_, signaling_thread,
232 media_engine_.get(), media_channel, content_name, 240 media_engine_.get(), media_channel, content_name,
233 rtcp_packet_transport == nullptr, srtp_required); 241 rtcp_packet_transport == nullptr, srtp_required);
234 242
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 media_engine_.get(), file, max_size_bytes)); 432 media_engine_.get(), file, max_size_bytes));
425 } 433 }
426 434
427 void ChannelManager::StopAecDump() { 435 void ChannelManager::StopAecDump() {
428 worker_thread_->Invoke<void>( 436 worker_thread_->Invoke<void>(
429 RTC_FROM_HERE, 437 RTC_FROM_HERE,
430 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); 438 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get()));
431 } 439 }
432 440
433 } // namespace cricket 441 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/channel.cc ('k') | webrtc/pc/mediacontroller.cc » ('j') | webrtc/pc/mediasession.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698