Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 11 matching lines...) Expand all Loading... | |
| 22 #include "webrtc/media/base/device.h" | 22 #include "webrtc/media/base/device.h" |
| 23 #include "webrtc/media/base/hybriddataengine.h" | 23 #include "webrtc/media/base/hybriddataengine.h" |
| 24 #include "webrtc/media/base/rtpdataengine.h" | 24 #include "webrtc/media/base/rtpdataengine.h" |
| 25 #ifdef HAVE_SCTP | 25 #ifdef HAVE_SCTP |
| 26 #include "webrtc/media/sctp/sctpdataengine.h" | 26 #include "webrtc/media/sctp/sctpdataengine.h" |
| 27 #endif | 27 #endif |
| 28 #include "webrtc/pc/srtpfilter.h" | 28 #include "webrtc/pc/srtpfilter.h" |
| 29 | 29 |
| 30 namespace cricket { | 30 namespace cricket { |
| 31 | 31 |
| 32 static bool IsRtxCodec(const VideoCodec& codec) { | |
| 33 return _stricmp(kRtxCodecName, codec.name.c_str()) == 0; | |
|
tommi
2016/11/09 16:24:30
in tests, we have case sensitive comparisons for t
magjed_webrtc
2016/11/09 20:37:53
Ok, I will ask hta@ for advice. The code here is j
tommi
2016/11/09 20:59:50
There's a version of compare() that takes a const
magjed_webrtc
2016/11/09 21:15:10
Ah cool, I missed that.
| |
| 34 } | |
| 32 | 35 |
| 33 using rtc::Bind; | 36 using rtc::Bind; |
| 34 | 37 |
| 35 static DataEngineInterface* ConstructDataEngine() { | 38 static DataEngineInterface* ConstructDataEngine() { |
| 36 #ifdef HAVE_SCTP | 39 #ifdef HAVE_SCTP |
| 37 return new HybridDataEngine(new RtpDataEngine(), new SctpDataEngine()); | 40 return new HybridDataEngine(new RtpDataEngine(), new SctpDataEngine()); |
| 38 #else | 41 #else |
| 39 return new RtpDataEngine(); | 42 return new RtpDataEngine(); |
| 40 #endif | 43 #endif |
| 41 } | 44 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 void ChannelManager::GetSupportedAudioReceiveCodecs( | 133 void ChannelManager::GetSupportedAudioReceiveCodecs( |
| 131 std::vector<AudioCodec>* codecs) const { | 134 std::vector<AudioCodec>* codecs) const { |
| 132 *codecs = media_engine_->audio_recv_codecs(); | 135 *codecs = media_engine_->audio_recv_codecs(); |
| 133 } | 136 } |
| 134 | 137 |
| 135 void ChannelManager::GetSupportedAudioRtpHeaderExtensions( | 138 void ChannelManager::GetSupportedAudioRtpHeaderExtensions( |
| 136 RtpHeaderExtensions* ext) const { | 139 RtpHeaderExtensions* ext) const { |
| 137 *ext = media_engine_->GetAudioCapabilities().header_extensions; | 140 *ext = media_engine_->GetAudioCapabilities().header_extensions; |
| 138 } | 141 } |
| 139 | 142 |
| 140 void ChannelManager::GetSupportedVideoCodecs( | 143 std::vector<VideoCodec> ChannelManager::GetSupportedVideoCodecs() const { |
| 141 std::vector<VideoCodec>* codecs) const { | 144 std::vector<VideoCodec> codecs = media_engine_->video_codecs(); |
| 142 codecs->clear(); | 145 if (!enable_rtx_) { |
| 143 | 146 codecs.erase(std::remove_if(codecs.begin(), codecs.end(), &IsRtxCodec), |
| 144 std::vector<VideoCodec>::const_iterator it; | 147 codecs.end()); |
| 145 for (it = media_engine_->video_codecs().begin(); | |
| 146 it != media_engine_->video_codecs().end(); ++it) { | |
| 147 if (!enable_rtx_ && _stricmp(kRtxCodecName, it->name.c_str()) == 0) { | |
| 148 continue; | |
| 149 } | |
| 150 codecs->push_back(*it); | |
| 151 } | 148 } |
| 149 return codecs; | |
| 152 } | 150 } |
| 153 | 151 |
| 154 void ChannelManager::GetSupportedVideoRtpHeaderExtensions( | 152 void ChannelManager::GetSupportedVideoRtpHeaderExtensions( |
| 155 RtpHeaderExtensions* ext) const { | 153 RtpHeaderExtensions* ext) const { |
| 156 *ext = media_engine_->GetVideoCapabilities().header_extensions; | 154 *ext = media_engine_->GetVideoCapabilities().header_extensions; |
| 157 } | 155 } |
| 158 | 156 |
| 159 void ChannelManager::GetSupportedDataCodecs( | 157 void ChannelManager::GetSupportedDataCodecs( |
| 160 std::vector<DataCodec>* codecs) const { | 158 std::vector<DataCodec>* codecs) const { |
| 161 *codecs = data_media_engine_->data_codecs(); | 159 *codecs = data_media_engine_->data_codecs(); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 media_engine_.get(), file, max_size_bytes)); | 409 media_engine_.get(), file, max_size_bytes)); |
| 412 } | 410 } |
| 413 | 411 |
| 414 void ChannelManager::StopAecDump() { | 412 void ChannelManager::StopAecDump() { |
| 415 worker_thread_->Invoke<void>( | 413 worker_thread_->Invoke<void>( |
| 416 RTC_FROM_HERE, | 414 RTC_FROM_HERE, |
| 417 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); | 415 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); |
| 418 } | 416 } |
| 419 | 417 |
| 420 } // namespace cricket | 418 } // namespace cricket |
| OLD | NEW |