Add field trial to enable the new RTC event log format.

Bug: webrtc:8111
Change-Id: Iffcd294a8ee9342a5f1e5ad07cb320d19323e37e
Reviewed-on: https://webrtc-review.googlesource.com/c/108161
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25429}
This commit is contained in:
Bjorn Terelius 2018-10-26 20:39:33 +02:00 committed by Commit Bot
parent 97e35ce05d
commit b26cf2f130
2 changed files with 7 additions and 1 deletions

View File

@ -65,8 +65,10 @@ std::unique_ptr<RtcEventLogEncoder> 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<RtcEventLogEncoderLegacy>();
case RtcEventLog::EncodingType::NewFormat:
RTC_LOG(LS_INFO) << "Creating new format encoder for RTC event log.";
return absl::make_unique<RtcEventLogEncoderNewFormat>();
default:
RTC_LOG(LS_ERROR) << "Unknown RtcEventLog encoder type (" << int(type)

View File

@ -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<RtcEventLog> 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<RtcEventLogNullImpl>();