Updates RtpVideoSender to populate RtpRtcp::Config.field_trials
This caused at least one trial in RTPSender not to be properly parsed.
This CL also updates RtpVideoSender and RtpPayloadParams to use
WebRtcKeyValueConfig instead of the static field_trial methods, in
order to facilitate injectable behavior in the future.
Bug: webrtc:11508
Change-Id: I995939bd3e7c2f81e5050383c3e4daf933498520
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173705
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31108}
diff --git a/call/rtp_payload_params.cc b/call/rtp_payload_params.cc
index 31cb743..bce3c13 100644
--- a/call/rtp_payload_params.cc
+++ b/call/rtp_payload_params.cc
@@ -16,6 +16,7 @@
#include "absl/algorithm/container.h"
#include "absl/container/inlined_vector.h"
+#include "absl/strings/match.h"
#include "absl/types/variant.h"
#include "api/video/video_timing.h"
#include "modules/video_coding/codecs/h264/include/h264_globals.h"
@@ -28,7 +29,6 @@
#include "rtc_base/logging.h"
#include "rtc_base/random.h"
#include "rtc_base/time_utils.h"
-#include "system_wrappers/include/field_trial.h"
namespace webrtc {
@@ -135,12 +135,15 @@
} // namespace
RtpPayloadParams::RtpPayloadParams(const uint32_t ssrc,
- const RtpPayloadState* state)
+ const RtpPayloadState* state,
+ const WebRtcKeyValueConfig& trials)
: ssrc_(ssrc),
generic_picture_id_experiment_(
- field_trial::IsEnabled("WebRTC-GenericPictureId")),
+ absl::StartsWith(trials.Lookup("WebRTC-GenericPictureId"),
+ "Enabled")),
generic_descriptor_experiment_(
- !field_trial::IsDisabled("WebRTC-GenericDescriptor")) {
+ !absl::StartsWith(trials.Lookup("WebRTC-GenericDescriptor"),
+ "Disabled")) {
for (auto& spatial_layer : last_shared_frame_id_)
spatial_layer.fill(-1);