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

Unified Diff: content/browser/media/capture/content_video_capture_device_core.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/content_video_capture_device_core.cc
diff --git a/content/browser/media/capture/content_video_capture_device_core.cc b/content/browser/media/capture/content_video_capture_device_core.cc
index da0862ccb8ee4d1f2c07980a818c54d0c5c91d81..403e8a67b391bc9d9e8e0a7eaa736a6d681bda35 100644
--- a/content/browser/media/capture/content_video_capture_device_core.cc
+++ b/content/browser/media/capture/content_video_capture_device_core.cc
@@ -135,7 +135,8 @@ bool ThreadSafeCaptureOracle::ObserveEventAndDecideCapture(
this,
frame_number,
base::Passed(&output_buffer),
- capture_begin_time);
+ capture_begin_time,
+ oracle_.estimated_frame_duration());
return true;
}
@@ -167,6 +168,7 @@ void ThreadSafeCaptureOracle::DidCaptureFrame(
int frame_number,
scoped_ptr<media::VideoCaptureDevice::Client::Buffer> buffer,
base::TimeTicks capture_begin_time,
+ base::TimeDelta estimated_frame_duration,
const scoped_refptr<media::VideoFrame>& frame,
base::TimeTicks timestamp,
bool success) {
@@ -180,13 +182,14 @@ void ThreadSafeCaptureOracle::DidCaptureFrame(
if (success) {
if (oracle_.CompleteCapture(frame_number, &timestamp)) {
- // TODO(miu): Use the locked-in frame rate from AnimatedContentSampler.
frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE,
params_.requested_format.frame_rate);
frame->metadata()->SetTimeTicks(
media::VideoFrameMetadata::CAPTURE_BEGIN_TIME, capture_begin_time);
frame->metadata()->SetTimeTicks(
media::VideoFrameMetadata::CAPTURE_END_TIME, base::TimeTicks::Now());
+ frame->metadata()->SetTimeDelta(media::VideoFrameMetadata::FRAME_DURATION,
+ estimated_frame_duration);
client_->OnIncomingCapturedVideoFrame(buffer.Pass(), frame, timestamp);
}
}

Powered by Google App Engine
This is Rietveld 408576698