From b26cf2f130d304d8ec5a8ef2a9298f9e471ce73b Mon Sep 17 00:00:00 2001 From: Bjorn Terelius Date: Fri, 26 Oct 2018 20:39:33 +0200 Subject: [PATCH] Add field trial to enable the new RTC event log format. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8111 Change-Id: Iffcd294a8ee9342a5f1e5ad07cb320d19323e37e Reviewed-on: https://webrtc-review.googlesource.com/c/108161 Reviewed-by: Elad Alon Reviewed-by: Stefan Holmer Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/master@{#25429} --- logging/rtc_event_log/rtc_event_log_impl.cc | 2 ++ pc/peerconnectionfactory.cc | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index 2f46e3ede1..c2e46a2fda 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -65,8 +65,10 @@ std::unique_ptr CreateEncoder( RtcEventLog::EncodingType type) { switch (type) { case RtcEventLog::EncodingType::Legacy: + RTC_LOG(LS_INFO) << "Creating legacy encoder for RTC event log."; return absl::make_unique(); case RtcEventLog::EncodingType::NewFormat: + RTC_LOG(LS_INFO) << "Creating new format encoder for RTC event log."; return absl::make_unique(); default: RTC_LOG(LS_ERROR) << "Unknown RtcEventLog encoder type (" << int(type) diff --git a/pc/peerconnectionfactory.cc b/pc/peerconnectionfactory.cc index edc13034a3..32b3980e0e 100644 --- a/pc/peerconnectionfactory.cc +++ b/pc/peerconnectionfactory.cc @@ -47,6 +47,7 @@ #include "pc/videocapturertracksource.h" #include "pc/videotrack.h" #include "rtc_base/experiments/congestion_controller_experiment.h" +#include "system_wrappers/include/field_trial.h" namespace webrtc { @@ -445,7 +446,10 @@ rtc::Thread* PeerConnectionFactory::network_thread() { std::unique_ptr PeerConnectionFactory::CreateRtcEventLog_w() { RTC_DCHECK_RUN_ON(worker_thread_); - const auto encoding_type = RtcEventLog::EncodingType::Legacy; + + auto encoding_type = RtcEventLog::EncodingType::Legacy; + if (field_trial::IsEnabled("WebRTC-RtcEventLogNewFormat")) + encoding_type = RtcEventLog::EncodingType::NewFormat; return event_log_factory_ ? event_log_factory_->CreateRtcEventLog(encoding_type) : absl::make_unique();