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

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

Issue 2996153002: Reland of Add a flags field to video timing extension. (Closed)
Patch Set: Added test Created 3 years, 4 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..cdb244da96a3f26f4d5370d88c1425b35f83aed7 100644
--- a/webrtc/modules/video_coding/generic_encoder.cc
+++ b/webrtc/modules/video_coding/generic_encoder.cc
@@ -231,7 +231,7 @@ EncodedImageCallback::Result VCMEncodedFrameCallback::OnEncodedImage(
rtc::Optional<size_t> outlier_frame_size;
rtc::Optional<int64_t> encode_start_ms;
- bool is_timing_frame = false;
+ uint8_t timing_flags = TimingFrameFlags::kInvalid;
{
rtc::CritScope crit(&timing_params_lock_);
@@ -274,14 +274,16 @@ EncodedImageCallback::Result VCMEncodedFrameCallback::OnEncodedImage(
if (last_timing_frame_time_ms_ == -1 ||
timing_frame_delay_ms >= timing_frames_thresholds_.delay_ms ||
timing_frame_delay_ms == 0) {
- is_timing_frame = true;
+ timing_flags = TimingFrameFlags::kTriggeredByTimer;
last_timing_frame_time_ms_ = encoded_image.capture_time_ms_;
}
// Outliers trigger timing frames, but do not affect scheduled timing
// frames.
if (outlier_frame_size && encoded_image._length >= *outlier_frame_size) {
- is_timing_frame = true;
+ if (timing_flags == TimingFrameFlags::kInvalid)
+ timing_flags = 0;
+ timing_flags |= TimingFrameFlags::kTriggeredBySize;
}
}
@@ -290,8 +292,11 @@ EncodedImageCallback::Result VCMEncodedFrameCallback::OnEncodedImage(
// drift relative to rtc::TimeMillis(). We can't use it for Timing frames,
// because to being sent in the network capture time required to be less than
// all the other timestamps.
- if (is_timing_frame && encode_start_ms) {
+ if (timing_flags != TimingFrameFlags::kInvalid && encode_start_ms) {
encoded_image.SetEncodeTime(*encode_start_ms, rtc::TimeMillis());
+ encoded_image.timing_.flags = timing_flags;
+ } else {
+ encoded_image.timing_.flags = TimingFrameFlags::kInvalid;
}
Result result = post_encode_callback_->OnEncodedImage(
« no previous file with comments | « webrtc/modules/video_coding/generic_decoder.cc ('k') | webrtc/modules/video_coding/generic_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698