Protect new header extension by field trial experiment to allow hardcoding it in SDP

BUG=chrome:718738

Review-Url: https://codereview.webrtc.org/2922683002
Cr-Commit-Position: refs/heads/master@{#18409}
This commit is contained in:
ilnik 2017-06-02 05:49:39 -07:00 committed by Commit Bot
parent 58c742ce7d
commit cafa1d6bbe
3 changed files with 9 additions and 2 deletions

View File

@ -28,7 +28,7 @@
#include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "webrtc/system_wrappers/include/field_trial.h"
namespace webrtc {
namespace {
@ -328,7 +328,8 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
last_rotation_ = current_rotation;
// Report content type only for key frames.
if (frame_type == kVideoFrameKey &&
video_header->content_type != VideoContentType::UNSPECIFIED) {
video_header->content_type != VideoContentType::UNSPECIFIED &&
webrtc::field_trial::IsEnabled("WebRTC-VideoContentTypeExtension")) {
last_packet->SetExtension<VideoContentTypeExtension>(
video_header->content_type);
}

View File

@ -2791,6 +2791,8 @@ TEST_F(EndToEndTest, MAYBE_ContentTypeSwitches) {
int num_frames_received_ GUARDED_BY(&crit_);
} test;
test::ScopedFieldTrials override_field_trials(
"WebRTC-VideoContentTypeExtension/Enabled/");
metrics::Reset();
Call::Config send_config(test.GetSenderCallConfig());
@ -2875,6 +2877,8 @@ TEST_F(EndToEndTest, VerifyHistogramStatsWithScreenshare) {
const bool kEnabledRtx = false;
const bool kEnabledRed = false;
const bool kScreenshare = true;
test::ScopedFieldTrials override_field_trials(
"WebRTC-VideoContentTypeExtension/Enabled/");
VerifyHistogramStats(kEnabledRtx, kEnabledRed, kScreenshare);
}

View File

@ -332,6 +332,8 @@ TEST_F(VideoSendStreamTest, SupportsVideoContentType) {
}
} test;
test::ScopedFieldTrials override_field_trials(
"WebRTC-VideoContentTypeExtension/Enabled/");
RunBaseTest(&test);
}