| 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 // Merges two fec configs and logs an error if a conflict arises | 266 // Merges two fec configs and logs an error if a conflict arises |
| 267 // such that merging in different order would trigger a different output. | 267 // such that merging in different order would trigger a different output. |
| 268 static void MergeFecConfig(const webrtc::FecConfig& other, | 268 static void MergeFecConfig(const webrtc::FecConfig& other, |
| 269 webrtc::FecConfig* output) { | 269 webrtc::FecConfig* output) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 external_decoder_factory_); | 577 external_decoder_factory_); |
| 578 } | 578 } |
| 579 | 579 |
| 580 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { | 580 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { |
| 581 return video_codecs_; | 581 return video_codecs_; |
| 582 } | 582 } |
| 583 | 583 |
| 584 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { | 584 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { |
| 585 RtpCapabilities capabilities; | 585 RtpCapabilities capabilities; |
| 586 capabilities.header_extensions.push_back( | 586 capabilities.header_extensions.push_back( |
| 587 RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, | 587 webrtc::RtpExtension(webrtc::RtpExtension::kTimestampOffsetUri, |
| 588 kRtpTimestampOffsetHeaderExtensionDefaultId)); | 588 webrtc::RtpExtension::kTimestampOffsetDefaultId)); |
| 589 capabilities.header_extensions.push_back( | 589 capabilities.header_extensions.push_back( |
| 590 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, | 590 webrtc::RtpExtension(webrtc::RtpExtension::kAbsSendTimeUri, |
| 591 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId)); | 591 webrtc::RtpExtension::kAbsSendTimeDefaultId)); |
| 592 capabilities.header_extensions.push_back( | 592 capabilities.header_extensions.push_back( |
| 593 RtpHeaderExtension(kRtpVideoRotationHeaderExtension, | 593 webrtc::RtpExtension(webrtc::RtpExtension::kVideoRotationUri, |
| 594 kRtpVideoRotationHeaderExtensionDefaultId)); | 594 webrtc::RtpExtension::kVideoRotationDefaultId)); |
| 595 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { | 595 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { |
| 596 capabilities.header_extensions.push_back(RtpHeaderExtension( | 596 capabilities.header_extensions.push_back(webrtc::RtpExtension( |
| 597 kRtpTransportSequenceNumberHeaderExtension, | 597 webrtc::RtpExtension::kTransportSequenceNumberUri, |
| 598 kRtpTransportSequenceNumberHeaderExtensionDefaultId)); | 598 webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); |
| 599 } | 599 } |
| 600 return capabilities; | 600 return capabilities; |
| 601 } | 601 } |
| 602 | 602 |
| 603 void WebRtcVideoEngine2::SetExternalDecoderFactory( | 603 void WebRtcVideoEngine2::SetExternalDecoderFactory( |
| 604 WebRtcVideoDecoderFactory* decoder_factory) { | 604 WebRtcVideoDecoderFactory* decoder_factory) { |
| 605 RTC_DCHECK(!initialized_); | 605 RTC_DCHECK(!initialized_); |
| 606 external_decoder_factory_ = decoder_factory; | 606 external_decoder_factory_ = decoder_factory; |
| 607 } | 607 } |
| 608 | 608 |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 ¶meters_.config.rtp.rtx.ssrcs); | 1540 ¶meters_.config.rtp.rtx.ssrcs); |
| 1541 parameters_.config.rtp.c_name = sp.cname; | 1541 parameters_.config.rtp.c_name = sp.cname; |
| 1542 parameters_.config.rtp.extensions = rtp_extensions; | 1542 parameters_.config.rtp.extensions = rtp_extensions; |
| 1543 parameters_.config.rtp.rtcp_mode = send_params.rtcp.reduced_size | 1543 parameters_.config.rtp.rtcp_mode = send_params.rtcp.reduced_size |
| 1544 ? webrtc::RtcpMode::kReducedSize | 1544 ? webrtc::RtcpMode::kReducedSize |
| 1545 : webrtc::RtcpMode::kCompound; | 1545 : webrtc::RtcpMode::kCompound; |
| 1546 parameters_.config.overuse_callback = | 1546 parameters_.config.overuse_callback = |
| 1547 enable_cpu_overuse_detection ? this : nullptr; | 1547 enable_cpu_overuse_detection ? this : nullptr; |
| 1548 | 1548 |
| 1549 sink_wants_.rotation_applied = !ContainsHeaderExtension( | 1549 sink_wants_.rotation_applied = !ContainsHeaderExtension( |
| 1550 rtp_extensions, kRtpVideoRotationHeaderExtension); | 1550 rtp_extensions, webrtc::RtpExtension::kVideoRotationUri); |
| 1551 | 1551 |
| 1552 if (codec_settings) { | 1552 if (codec_settings) { |
| 1553 SetCodec(*codec_settings); | 1553 SetCodec(*codec_settings); |
| 1554 } | 1554 } |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() { | 1557 WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() { |
| 1558 DisconnectSource(); | 1558 DisconnectSource(); |
| 1559 if (stream_ != NULL) { | 1559 if (stream_ != NULL) { |
| 1560 call_->DestroyVideoSendStream(stream_); | 1560 call_->DestroyVideoSendStream(stream_); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 LOG(LS_INFO) | 1824 LOG(LS_INFO) |
| 1825 << "RecreateWebRtcStream (send) because of SetSendParameters"; | 1825 << "RecreateWebRtcStream (send) because of SetSendParameters"; |
| 1826 RecreateWebRtcStream(); | 1826 RecreateWebRtcStream(); |
| 1827 } | 1827 } |
| 1828 } // release |lock_| | 1828 } // release |lock_| |
| 1829 | 1829 |
| 1830 // |capturer_->AddOrUpdateSink| may not be called while holding |lock_| since | 1830 // |capturer_->AddOrUpdateSink| may not be called while holding |lock_| since |
| 1831 // that might cause a lock order inversion. | 1831 // that might cause a lock order inversion. |
| 1832 if (params.rtp_header_extensions) { | 1832 if (params.rtp_header_extensions) { |
| 1833 sink_wants_.rotation_applied = !ContainsHeaderExtension( | 1833 sink_wants_.rotation_applied = !ContainsHeaderExtension( |
| 1834 *params.rtp_header_extensions, kRtpVideoRotationHeaderExtension); | 1834 *params.rtp_header_extensions, webrtc::RtpExtension::kVideoRotationUri); |
| 1835 if (source_) { | 1835 if (source_) { |
| 1836 source_->AddOrUpdateSink(this, sink_wants_); | 1836 source_->AddOrUpdateSink(this, sink_wants_); |
| 1837 } | 1837 } |
| 1838 } | 1838 } |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpParameters( | 1841 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpParameters( |
| 1842 const webrtc::RtpParameters& new_parameters) { | 1842 const webrtc::RtpParameters& new_parameters) { |
| 1843 if (!ValidateRtpParameters(new_parameters)) { | 1843 if (!ValidateRtpParameters(new_parameters)) { |
| 1844 return false; | 1844 return false; |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2589 rtx_mapping[video_codecs[i].codec.id] != | 2589 rtx_mapping[video_codecs[i].codec.id] != |
| 2590 fec_settings.red_payload_type) { | 2590 fec_settings.red_payload_type) { |
| 2591 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2591 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
| 2592 } | 2592 } |
| 2593 } | 2593 } |
| 2594 | 2594 |
| 2595 return video_codecs; | 2595 return video_codecs; |
| 2596 } | 2596 } |
| 2597 | 2597 |
| 2598 } // namespace cricket | 2598 } // namespace cricket |
| OLD | NEW |