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

Unified Diff: webrtc/modules/video_coding/generic_encoder.cc

Issue 2986893002: Piggybacking simulcast id and ALR experiment id into video content type extension. (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/generic_encoder.cc
diff --git a/webrtc/modules/video_coding/generic_encoder.cc b/webrtc/modules/video_coding/generic_encoder.cc
index 78eeef288a2e7046c00adc934d438769ab9177a3..a134b774f01ef6cd745cadcc4ee569b280462819 100644
--- a/webrtc/modules/video_coding/generic_encoder.cc
+++ b/webrtc/modules/video_coding/generic_encoder.cc
@@ -13,6 +13,7 @@
#include <vector>
#include "webrtc/api/video/i420_buffer.h"
+#include "webrtc/modules/pacing/alr_detector.h"
sprang_webrtc 2017/07/26 14:13:43 Don't add dependency between modules. If we need t
ilnik 2017/07/26 14:49:48 We also need |AlrDetector::ParseAlrSettingsFromFie
#include "webrtc/modules/video_coding/encoded_frame.h"
#include "webrtc/modules/video_coding/media_optimization.h"
#include "webrtc/rtc_base/checks.h"
@@ -20,6 +21,7 @@
#include "webrtc/rtc_base/optional.h"
#include "webrtc/rtc_base/timeutils.h"
#include "webrtc/rtc_base/trace_event.h"
+#include "webrtc/system_wrappers/include/field_trial.h"
namespace webrtc {
@@ -294,6 +296,24 @@ EncodedImageCallback::Result VCMEncodedFrameCallback::OnEncodedImage(
encoded_image.SetEncodeTime(*encode_start_ms, rtc::TimeMillis());
}
+ // Piggyback ALR experiment group id and simulcast id into the content type.
+ uint8_t experiment_id = 0;
+ rtc::Optional<AlrDetector::AlrExperimentSettings> experiment_settings =
+ AlrDetector::ParseAlrSettingsFromFieldTrial();
+ if (experiment_settings) {
+ // 0 would mean no experiment, therefore adding 1. It will be subtracted at
+ // the receive side before reporting fake field trial.
+ experiment_id = experiment_settings->group_id + 1;
+ }
+
+ // TODO(ilnik): This will force content type extension to be present even
+ // for realtime video. At the expense of miniscule overhead we will get
+ // sliced receive statistics.
+ encoded_image.content_type_.SetExperimentId(experiment_id);
+ // We number simulcast streams from 1 on the network.
+ encoded_image.content_type_.SetSimulcastId(
+ static_cast<uint8_t>(simulcast_svc_idx + 1));
+
Result result = post_encode_callback_->OnEncodedImage(
encoded_image, codec_specific, fragmentation_header);
if (result.error != Result::OK)

Powered by Google App Engine
This is Rietveld 408576698