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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2817553004: Add content type extension to capabilities (Closed)
Patch Set: Implement Brandtr@ comments Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace cricket { 43 namespace cricket {
44 namespace { 44 namespace {
45 // If this field trial is enabled, we will enable sending FlexFEC and disable 45 // If this field trial is enabled, we will enable sending FlexFEC and disable
46 // sending ULPFEC whenever the former has been negotiated. Receiving FlexFEC 46 // sending ULPFEC whenever the former has been negotiated. Receiving FlexFEC
47 // is enabled whenever FlexFEC has been negotiated. 47 // is enabled whenever FlexFEC has been negotiated.
48 bool IsFlexfecFieldTrialEnabled() { 48 bool IsFlexfecFieldTrialEnabled() {
49 return webrtc::field_trial::FindFullName("WebRTC-FlexFEC-03") == "Enabled"; 49 return webrtc::field_trial::FindFullName("WebRTC-FlexFEC-03") == "Enabled";
50 } 50 }
51 51
52 // If this field trial is enabled, we will report VideoContentType RTP extension
brandtr 2017/04/13 10:00:25 But the effect of adding this extension to the cap
ilnik 2017/04/13 10:12:28 Yes. I have updated the comment to be more detaile
53 // in capabilities.
54 bool IsVideoContentTypeExtensionFieldTrialEnabled() {
55 return webrtc::field_trial::IsEnabled("WebRTC-VideoContentTypeExtension");
56 }
57
52 // Wrap cricket::WebRtcVideoEncoderFactory as a webrtc::VideoEncoderFactory. 58 // Wrap cricket::WebRtcVideoEncoderFactory as a webrtc::VideoEncoderFactory.
53 class EncoderFactoryAdapter : public webrtc::VideoEncoderFactory { 59 class EncoderFactoryAdapter : public webrtc::VideoEncoderFactory {
54 public: 60 public:
55 // EncoderFactoryAdapter doesn't take ownership of |factory|, which is owned 61 // EncoderFactoryAdapter doesn't take ownership of |factory|, which is owned
56 // by e.g. PeerConnectionFactory. 62 // by e.g. PeerConnectionFactory.
57 explicit EncoderFactoryAdapter(cricket::WebRtcVideoEncoderFactory* factory) 63 explicit EncoderFactoryAdapter(cricket::WebRtcVideoEncoderFactory* factory)
58 : factory_(factory) {} 64 : factory_(factory) {}
59 virtual ~EncoderFactoryAdapter() {} 65 virtual ~EncoderFactoryAdapter() {}
60 66
61 // Implement webrtc::VideoEncoderFactory. 67 // Implement webrtc::VideoEncoderFactory.
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 webrtc::RtpExtension::kAbsSendTimeDefaultId)); 502 webrtc::RtpExtension::kAbsSendTimeDefaultId));
497 capabilities.header_extensions.push_back( 503 capabilities.header_extensions.push_back(
498 webrtc::RtpExtension(webrtc::RtpExtension::kVideoRotationUri, 504 webrtc::RtpExtension(webrtc::RtpExtension::kVideoRotationUri,
499 webrtc::RtpExtension::kVideoRotationDefaultId)); 505 webrtc::RtpExtension::kVideoRotationDefaultId));
500 capabilities.header_extensions.push_back(webrtc::RtpExtension( 506 capabilities.header_extensions.push_back(webrtc::RtpExtension(
501 webrtc::RtpExtension::kTransportSequenceNumberUri, 507 webrtc::RtpExtension::kTransportSequenceNumberUri,
502 webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); 508 webrtc::RtpExtension::kTransportSequenceNumberDefaultId));
503 capabilities.header_extensions.push_back( 509 capabilities.header_extensions.push_back(
504 webrtc::RtpExtension(webrtc::RtpExtension::kPlayoutDelayUri, 510 webrtc::RtpExtension(webrtc::RtpExtension::kPlayoutDelayUri,
505 webrtc::RtpExtension::kPlayoutDelayDefaultId)); 511 webrtc::RtpExtension::kPlayoutDelayDefaultId));
512 if (IsVideoContentTypeExtensionFieldTrialEnabled()) {
513 capabilities.header_extensions.push_back(
514 webrtc::RtpExtension(webrtc::RtpExtension::kVideoContentTypeUri,
515 webrtc::RtpExtension::kVideoContentTypeDefaultId));
516 }
506 return capabilities; 517 return capabilities;
507 } 518 }
508 519
509 void WebRtcVideoEngine2::SetExternalDecoderFactory( 520 void WebRtcVideoEngine2::SetExternalDecoderFactory(
510 WebRtcVideoDecoderFactory* decoder_factory) { 521 WebRtcVideoDecoderFactory* decoder_factory) {
511 RTC_DCHECK(!initialized_); 522 RTC_DCHECK(!initialized_);
512 external_decoder_factory_ = decoder_factory; 523 external_decoder_factory_ = decoder_factory;
513 } 524 }
514 525
515 void WebRtcVideoEngine2::SetExternalEncoderFactory( 526 void WebRtcVideoEngine2::SetExternalEncoderFactory(
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 rtx_mapping[video_codecs[i].codec.id] != 2572 rtx_mapping[video_codecs[i].codec.id] !=
2562 ulpfec_config.red_payload_type) { 2573 ulpfec_config.red_payload_type) {
2563 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2574 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2564 } 2575 }
2565 } 2576 }
2566 2577
2567 return video_codecs; 2578 return video_codecs;
2568 } 2579 }
2569 2580
2570 } // namespace cricket 2581 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698