| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 << "RTX SSRCs exist, but don't cover all SSRCs (unsupported): " | 247 << "RTX SSRCs exist, but don't cover all SSRCs (unsupported): " |
| 248 << sp.ToString(); | 248 << sp.ToString(); |
| 249 return false; | 249 return false; |
| 250 } | 250 } |
| 251 | 251 |
| 252 return true; | 252 return true; |
| 253 } | 253 } |
| 254 | 254 |
| 255 inline bool ContainsHeaderExtension( | 255 inline bool ContainsHeaderExtension( |
| 256 const std::vector<webrtc::RtpExtension>& extensions, | 256 const std::vector<webrtc::RtpExtension>& extensions, |
| 257 const std::string& name) { | 257 const std::string& uri) { |
| 258 for (const auto& kv : extensions) { | 258 for (const auto& kv : extensions) { |
| 259 if (kv.name == name) { | 259 if (kv.uri == uri) { |
| 260 return true; | 260 return true; |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 return false; | 263 return false; |
| 264 } | 264 } |
| 265 | 265 |
| 266 // Returns true if the given codec is disallowed from doing simulcast. | 266 // Returns true if the given codec is disallowed from doing simulcast. |
| 267 bool IsCodecBlacklistedForSimulcast(const std::string& codec_name) { | 267 bool IsCodecBlacklistedForSimulcast(const std::string& codec_name) { |
| 268 return CodecNamesEq(codec_name, kH264CodecName) || | 268 return CodecNamesEq(codec_name, kH264CodecName) || |
| 269 CodecNamesEq(codec_name, kVp9CodecName); | 269 CodecNamesEq(codec_name, kVp9CodecName); |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 external_decoder_factory_); | 544 external_decoder_factory_); |
| 545 } | 545 } |
| 546 | 546 |
| 547 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { | 547 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { |
| 548 return video_codecs_; | 548 return video_codecs_; |
| 549 } | 549 } |
| 550 | 550 |
| 551 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { | 551 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { |
| 552 RtpCapabilities capabilities; | 552 RtpCapabilities capabilities; |
| 553 capabilities.header_extensions.push_back( | 553 capabilities.header_extensions.push_back( |
| 554 RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, | 554 webrtc::RtpExtension(webrtc::RtpExtension::kTimestampOffsetUri, |
| 555 kRtpTimestampOffsetHeaderExtensionDefaultId)); | 555 webrtc::RtpExtension::kTimestampOffsetDefaultId)); |
| 556 capabilities.header_extensions.push_back( | 556 capabilities.header_extensions.push_back( |
| 557 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, | 557 webrtc::RtpExtension(webrtc::RtpExtension::kAbsSendTimeUri, |
| 558 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId)); | 558 webrtc::RtpExtension::kAbsSendTimeDefaultId)); |
| 559 capabilities.header_extensions.push_back( | 559 capabilities.header_extensions.push_back( |
| 560 RtpHeaderExtension(kRtpVideoRotationHeaderExtension, | 560 webrtc::RtpExtension(webrtc::RtpExtension::kVideoRotationUri, |
| 561 kRtpVideoRotationHeaderExtensionDefaultId)); | 561 webrtc::RtpExtension::kVideoRotationDefaultId)); |
| 562 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { | 562 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { |
| 563 capabilities.header_extensions.push_back(RtpHeaderExtension( | 563 capabilities.header_extensions.push_back(webrtc::RtpExtension( |
| 564 kRtpTransportSequenceNumberHeaderExtension, | 564 webrtc::RtpExtension::kTransportSequenceNumberUri, |
| 565 kRtpTransportSequenceNumberHeaderExtensionDefaultId)); | 565 webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); |
| 566 } | 566 } |
| 567 return capabilities; | 567 return capabilities; |
| 568 } | 568 } |
| 569 | 569 |
| 570 void WebRtcVideoEngine2::SetExternalDecoderFactory( | 570 void WebRtcVideoEngine2::SetExternalDecoderFactory( |
| 571 WebRtcVideoDecoderFactory* decoder_factory) { | 571 WebRtcVideoDecoderFactory* decoder_factory) { |
| 572 RTC_DCHECK(!initialized_); | 572 RTC_DCHECK(!initialized_); |
| 573 external_decoder_factory_ = decoder_factory; | 573 external_decoder_factory_ = decoder_factory; |
| 574 } | 574 } |
| 575 | 575 |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 ¶meters_.config.rtp.rtx.ssrcs); | 1563 ¶meters_.config.rtp.rtx.ssrcs); |
| 1564 parameters_.config.rtp.c_name = sp.cname; | 1564 parameters_.config.rtp.c_name = sp.cname; |
| 1565 parameters_.config.rtp.extensions = rtp_extensions; | 1565 parameters_.config.rtp.extensions = rtp_extensions; |
| 1566 parameters_.config.rtp.rtcp_mode = send_params.rtcp.reduced_size | 1566 parameters_.config.rtp.rtcp_mode = send_params.rtcp.reduced_size |
| 1567 ? webrtc::RtcpMode::kReducedSize | 1567 ? webrtc::RtcpMode::kReducedSize |
| 1568 : webrtc::RtcpMode::kCompound; | 1568 : webrtc::RtcpMode::kCompound; |
| 1569 parameters_.config.overuse_callback = | 1569 parameters_.config.overuse_callback = |
| 1570 enable_cpu_overuse_detection ? this : nullptr; | 1570 enable_cpu_overuse_detection ? this : nullptr; |
| 1571 | 1571 |
| 1572 sink_wants_.rotation_applied = !ContainsHeaderExtension( | 1572 sink_wants_.rotation_applied = !ContainsHeaderExtension( |
| 1573 rtp_extensions, kRtpVideoRotationHeaderExtension); | 1573 rtp_extensions, webrtc::RtpExtension::kVideoRotationUri); |
| 1574 | 1574 |
| 1575 if (codec_settings) { | 1575 if (codec_settings) { |
| 1576 SetCodec(*codec_settings); | 1576 SetCodec(*codec_settings); |
| 1577 } | 1577 } |
| 1578 } | 1578 } |
| 1579 | 1579 |
| 1580 WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() { | 1580 WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() { |
| 1581 DisconnectSource(); | 1581 DisconnectSource(); |
| 1582 if (stream_ != NULL) { | 1582 if (stream_ != NULL) { |
| 1583 call_->DestroyVideoSendStream(stream_); | 1583 call_->DestroyVideoSendStream(stream_); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1847 LOG(LS_INFO) | 1847 LOG(LS_INFO) |
| 1848 << "RecreateWebRtcStream (send) because of SetSendParameters"; | 1848 << "RecreateWebRtcStream (send) because of SetSendParameters"; |
| 1849 RecreateWebRtcStream(); | 1849 RecreateWebRtcStream(); |
| 1850 } | 1850 } |
| 1851 } // release |lock_| | 1851 } // release |lock_| |
| 1852 | 1852 |
| 1853 // |capturer_->AddOrUpdateSink| may not be called while holding |lock_| since | 1853 // |capturer_->AddOrUpdateSink| may not be called while holding |lock_| since |
| 1854 // that might cause a lock order inversion. | 1854 // that might cause a lock order inversion. |
| 1855 if (params.rtp_header_extensions) { | 1855 if (params.rtp_header_extensions) { |
| 1856 sink_wants_.rotation_applied = !ContainsHeaderExtension( | 1856 sink_wants_.rotation_applied = !ContainsHeaderExtension( |
| 1857 *params.rtp_header_extensions, kRtpVideoRotationHeaderExtension); | 1857 *params.rtp_header_extensions, webrtc::RtpExtension::kVideoRotationUri); |
| 1858 if (source_) { | 1858 if (source_) { |
| 1859 source_->AddOrUpdateSink(this, sink_wants_); | 1859 source_->AddOrUpdateSink(this, sink_wants_); |
| 1860 } | 1860 } |
| 1861 } | 1861 } |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpParameters( | 1864 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpParameters( |
| 1865 const webrtc::RtpParameters& new_parameters) { | 1865 const webrtc::RtpParameters& new_parameters) { |
| 1866 if (!ValidateRtpParameters(new_parameters)) { | 1866 if (!ValidateRtpParameters(new_parameters)) { |
| 1867 return false; | 1867 return false; |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 rtx_mapping[video_codecs[i].codec.id] != | 2626 rtx_mapping[video_codecs[i].codec.id] != |
| 2627 fec_settings.red_payload_type) { | 2627 fec_settings.red_payload_type) { |
| 2628 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2628 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
| 2629 } | 2629 } |
| 2630 } | 2630 } |
| 2631 | 2631 |
| 2632 return video_codecs; | 2632 return video_codecs; |
| 2633 } | 2633 } |
| 2634 | 2634 |
| 2635 } // namespace cricket | 2635 } // namespace cricket |
| OLD | NEW |