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

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

Issue 2817553004: Add content type extension to capabilities (Closed)
Patch Set: Implement Magjed 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
53 // in capabilities (thus, it will end up in the default SDP and extension will
54 // be sent for all key-frames).
55 bool IsVideoContentTypeExtensionFieldTrialEnabled() {
56 return webrtc::field_trial::IsEnabled("WebRTC-VideoContentTypeExtension");
57 }
58
52 // Wrap cricket::WebRtcVideoEncoderFactory as a webrtc::VideoEncoderFactory. 59 // Wrap cricket::WebRtcVideoEncoderFactory as a webrtc::VideoEncoderFactory.
53 class EncoderFactoryAdapter : public webrtc::VideoEncoderFactory { 60 class EncoderFactoryAdapter : public webrtc::VideoEncoderFactory {
54 public: 61 public:
55 // EncoderFactoryAdapter doesn't take ownership of |factory|, which is owned 62 // EncoderFactoryAdapter doesn't take ownership of |factory|, which is owned
56 // by e.g. PeerConnectionFactory. 63 // by e.g. PeerConnectionFactory.
57 explicit EncoderFactoryAdapter(cricket::WebRtcVideoEncoderFactory* factory) 64 explicit EncoderFactoryAdapter(cricket::WebRtcVideoEncoderFactory* factory)
58 : factory_(factory) {} 65 : factory_(factory) {}
59 virtual ~EncoderFactoryAdapter() {} 66 virtual ~EncoderFactoryAdapter() {}
60 67
61 // Implement webrtc::VideoEncoderFactory. 68 // Implement webrtc::VideoEncoderFactory.
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 webrtc::RtpExtension::kAbsSendTimeDefaultId)); 503 webrtc::RtpExtension::kAbsSendTimeDefaultId));
497 capabilities.header_extensions.push_back( 504 capabilities.header_extensions.push_back(
498 webrtc::RtpExtension(webrtc::RtpExtension::kVideoRotationUri, 505 webrtc::RtpExtension(webrtc::RtpExtension::kVideoRotationUri,
499 webrtc::RtpExtension::kVideoRotationDefaultId)); 506 webrtc::RtpExtension::kVideoRotationDefaultId));
500 capabilities.header_extensions.push_back(webrtc::RtpExtension( 507 capabilities.header_extensions.push_back(webrtc::RtpExtension(
501 webrtc::RtpExtension::kTransportSequenceNumberUri, 508 webrtc::RtpExtension::kTransportSequenceNumberUri,
502 webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); 509 webrtc::RtpExtension::kTransportSequenceNumberDefaultId));
503 capabilities.header_extensions.push_back( 510 capabilities.header_extensions.push_back(
504 webrtc::RtpExtension(webrtc::RtpExtension::kPlayoutDelayUri, 511 webrtc::RtpExtension(webrtc::RtpExtension::kPlayoutDelayUri,
505 webrtc::RtpExtension::kPlayoutDelayDefaultId)); 512 webrtc::RtpExtension::kPlayoutDelayDefaultId));
513 if (IsVideoContentTypeExtensionFieldTrialEnabled()) {
514 capabilities.header_extensions.push_back(
515 webrtc::RtpExtension(webrtc::RtpExtension::kVideoContentTypeUri,
516 webrtc::RtpExtension::kVideoContentTypeDefaultId));
517 }
506 return capabilities; 518 return capabilities;
507 } 519 }
508 520
509 void WebRtcVideoEngine2::SetExternalDecoderFactory( 521 void WebRtcVideoEngine2::SetExternalDecoderFactory(
510 WebRtcVideoDecoderFactory* decoder_factory) { 522 WebRtcVideoDecoderFactory* decoder_factory) {
511 RTC_DCHECK(!initialized_); 523 RTC_DCHECK(!initialized_);
512 external_decoder_factory_ = decoder_factory; 524 external_decoder_factory_ = decoder_factory;
513 } 525 }
514 526
515 void WebRtcVideoEngine2::SetExternalEncoderFactory( 527 void WebRtcVideoEngine2::SetExternalEncoderFactory(
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 rtx_mapping[video_codecs[i].codec.id] != 2573 rtx_mapping[video_codecs[i].codec.id] !=
2562 ulpfec_config.red_payload_type) { 2574 ulpfec_config.red_payload_type) {
2563 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2575 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2564 } 2576 }
2565 } 2577 }
2566 2578
2567 return video_codecs; 2579 return video_codecs;
2568 } 2580 }
2569 2581
2570 } // namespace cricket 2582 } // 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