| 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; | |
| 34 } | |
| 35 | 32 |
| 36 using rtc::Bind; | 33 using rtc::Bind; |
| 37 | 34 |
| 38 static DataEngineInterface* ConstructDataEngine() { | 35 static DataEngineInterface* ConstructDataEngine() { |
| 39 #ifdef HAVE_SCTP | 36 #ifdef HAVE_SCTP |
| 40 return new HybridDataEngine(new RtpDataEngine(), new SctpDataEngine()); | 37 return new HybridDataEngine(new RtpDataEngine(), new SctpDataEngine()); |
| 41 #else | 38 #else |
| 42 return new RtpDataEngine(); | 39 return new RtpDataEngine(); |
| 43 #endif | 40 #endif |
| 44 } | 41 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 void ChannelManager::GetSupportedAudioReceiveCodecs( | 130 void ChannelManager::GetSupportedAudioReceiveCodecs( |
| 134 std::vector<AudioCodec>* codecs) const { | 131 std::vector<AudioCodec>* codecs) const { |
| 135 *codecs = media_engine_->audio_recv_codecs(); | 132 *codecs = media_engine_->audio_recv_codecs(); |
| 136 } | 133 } |
| 137 | 134 |
| 138 void ChannelManager::GetSupportedAudioRtpHeaderExtensions( | 135 void ChannelManager::GetSupportedAudioRtpHeaderExtensions( |
| 139 RtpHeaderExtensions* ext) const { | 136 RtpHeaderExtensions* ext) const { |
| 140 *ext = media_engine_->GetAudioCapabilities().header_extensions; | 137 *ext = media_engine_->GetAudioCapabilities().header_extensions; |
| 141 } | 138 } |
| 142 | 139 |
| 143 std::vector<VideoCodec> ChannelManager::GetSupportedVideoCodecs() const { | 140 void ChannelManager::GetSupportedVideoCodecs( |
| 144 std::vector<VideoCodec> codecs = media_engine_->video_codecs(); | 141 std::vector<VideoCodec>* codecs) const { |
| 145 if (!enable_rtx_) { | 142 codecs->clear(); |
| 146 codecs.erase(std::remove_if(codecs.begin(), codecs.end(), &IsRtxCodec), | 143 |
| 147 codecs.end()); | 144 std::vector<VideoCodec>::const_iterator it; |
| 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); |
| 148 } | 151 } |
| 149 return codecs; | |
| 150 } | 152 } |
| 151 | 153 |
| 152 void ChannelManager::GetSupportedVideoRtpHeaderExtensions( | 154 void ChannelManager::GetSupportedVideoRtpHeaderExtensions( |
| 153 RtpHeaderExtensions* ext) const { | 155 RtpHeaderExtensions* ext) const { |
| 154 *ext = media_engine_->GetVideoCapabilities().header_extensions; | 156 *ext = media_engine_->GetVideoCapabilities().header_extensions; |
| 155 } | 157 } |
| 156 | 158 |
| 157 void ChannelManager::GetSupportedDataCodecs( | 159 void ChannelManager::GetSupportedDataCodecs( |
| 158 std::vector<DataCodec>* codecs) const { | 160 std::vector<DataCodec>* codecs) const { |
| 159 *codecs = data_media_engine_->data_codecs(); | 161 *codecs = data_media_engine_->data_codecs(); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 media_engine_.get(), file, max_size_bytes)); | 411 media_engine_.get(), file, max_size_bytes)); |
| 410 } | 412 } |
| 411 | 413 |
| 412 void ChannelManager::StopAecDump() { | 414 void ChannelManager::StopAecDump() { |
| 413 worker_thread_->Invoke<void>( | 415 worker_thread_->Invoke<void>( |
| 414 RTC_FROM_HERE, | 416 RTC_FROM_HERE, |
| 415 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); | 417 Bind(&MediaEngineInterface::StopAecDump, media_engine_.get())); |
| 416 } | 418 } |
| 417 | 419 |
| 418 } // namespace cricket | 420 } // namespace cricket |
| OLD | NEW |