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

Unified Diff: webrtc/pc/channelmanager.cc

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: Rebase. Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/channel.cc ('k') | webrtc/pc/createpeerconnectionfactory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channelmanager.cc
diff --git a/webrtc/pc/channelmanager.cc b/webrtc/pc/channelmanager.cc
index af6e3c7e99e16f9780c4872ee8384a2d006e71df..1817f6923334a896649dd5848ee628a05b3e9c3f 100644
--- a/webrtc/pc/channelmanager.cc
+++ b/webrtc/pc/channelmanager.cc
@@ -89,21 +89,33 @@ bool ChannelManager::SetVideoRtxEnabled(bool enable) {
void ChannelManager::GetSupportedAudioSendCodecs(
std::vector<AudioCodec>* codecs) const {
+ if (!media_engine_) {
+ return;
+ }
*codecs = media_engine_->audio_send_codecs();
}
void ChannelManager::GetSupportedAudioReceiveCodecs(
std::vector<AudioCodec>* codecs) const {
+ if (!media_engine_) {
+ return;
+ }
*codecs = media_engine_->audio_recv_codecs();
}
void ChannelManager::GetSupportedAudioRtpHeaderExtensions(
RtpHeaderExtensions* ext) const {
+ if (!media_engine_) {
+ return;
+ }
*ext = media_engine_->GetAudioCapabilities().header_extensions;
}
void ChannelManager::GetSupportedVideoCodecs(
std::vector<VideoCodec>* codecs) const {
+ if (!media_engine_) {
+ return;
+ }
codecs->clear();
std::vector<VideoCodec> video_codecs = media_engine_->video_codecs();
@@ -118,11 +130,17 @@ void ChannelManager::GetSupportedVideoCodecs(
void ChannelManager::GetSupportedVideoRtpHeaderExtensions(
RtpHeaderExtensions* ext) const {
+ if (!media_engine_) {
+ return;
+ }
*ext = media_engine_->GetVideoCapabilities().header_extensions;
}
void ChannelManager::GetSupportedDataCodecs(
std::vector<DataCodec>* codecs) const {
+ if (!data_media_engine_) {
+ return;
+ }
*codecs = data_media_engine_->data_codecs();
}
@@ -148,7 +166,10 @@ bool ChannelManager::Init() {
bool ChannelManager::InitMediaEngine_w() {
RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
- return media_engine_->Init();
+ if (media_engine_) {
+ return media_engine_->Init();
+ }
+ return true;
}
void ChannelManager::Terminate() {
@@ -223,6 +244,9 @@ VoiceChannel* ChannelManager::CreateVoiceChannel_w(
RTC_DCHECK(initialized_);
RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
RTC_DCHECK(nullptr != call);
+ if (!media_engine_) {
+ return nullptr;
+ }
VoiceMediaChannel* media_channel = media_engine_->CreateChannel(
call, media_config, options);
« no previous file with comments | « webrtc/pc/channel.cc ('k') | webrtc/pc/createpeerconnectionfactory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698