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

Unified Diff: content/browser/media/capture/video_capture_oracle.cc

Issue 1146723002: New FRAME_DURATION VideoFrameMetadata, with Cast Streaming use case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expanded comments for VideoFrameMetadata::FRAME_DURATION. Created 5 years, 7 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: content/browser/media/capture/video_capture_oracle.cc
diff --git a/content/browser/media/capture/video_capture_oracle.cc b/content/browser/media/capture/video_capture_oracle.cc
index 0b675075429c273bf141c475c5e7ece0e7a0822e..3d5039ca90663cf924d4a537128738aa8f7ab2a2 100644
--- a/content/browser/media/capture/video_capture_oracle.cc
+++ b/content/browser/media/capture/video_capture_oracle.cc
@@ -60,20 +60,27 @@ bool VideoCaptureOracle::ObserveEventAndDecideCapture(
last_event_time_[event] = event_time;
bool should_sample;
+ duration_of_next_frame_ = base::TimeDelta();
switch (event) {
case kCompositorUpdate:
smoothing_sampler_.ConsiderPresentationEvent(event_time);
content_sampler_.ConsiderPresentationEvent(damage_rect, event_time);
if (content_sampler_.HasProposal()) {
should_sample = content_sampler_.ShouldSample();
- if (should_sample)
+ if (should_sample) {
event_time = content_sampler_.frame_timestamp();
+ duration_of_next_frame_ = content_sampler_.sampling_period();
+ }
} else {
should_sample = smoothing_sampler_.ShouldSample();
+ if (should_sample)
+ duration_of_next_frame_ = smoothing_sampler_.min_capture_period();
}
break;
default:
should_sample = smoothing_sampler_.IsOverdueForSamplingAt(event_time);
+ if (should_sample)
+ duration_of_next_frame_ = smoothing_sampler_.min_capture_period();
break;
}
« no previous file with comments | « content/browser/media/capture/video_capture_oracle.h ('k') | content/browser/media/capture/video_capture_oracle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698