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

Unified Diff: media/capture/video/android/video_capture_device_android.cc

Issue 1983193002: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve Comments Created 4 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: media/capture/video/android/video_capture_device_android.cc
diff --git a/media/capture/video/android/video_capture_device_android.cc b/media/capture/video/android/video_capture_device_android.cc
index d42272fe805ed32c286d12498f6f79939b63a65b..d920a21b7c7acd39800418bc2a8c8e48ab946b3e 100644
--- a/media/capture/video/android/video_capture_device_android.cc
+++ b/media/capture/video/android/video_capture_device_android.cc
@@ -190,6 +190,7 @@ void VideoCaptureDeviceAndroid::OnFrameAvailable(
if (!got_first_frame_) {
// Set aside one frame allowance for fluctuation.
expected_next_frame_time_ = current_time - frame_interval_;
+ first_ref_time_ = current_time;
got_first_frame_ = true;
}
@@ -197,9 +198,11 @@ void VideoCaptureDeviceAndroid::OnFrameAvailable(
if (expected_next_frame_time_ <= current_time) {
expected_next_frame_time_ += frame_interval_;
+ // TODO(qiangchen): Investigate how to get raw timestamp for Android,
+ // rather than using reference time to calculate timestamp.
client_->OnIncomingCapturedData(reinterpret_cast<uint8_t*>(buffer), length,
- capture_format_, rotation,
- base::TimeTicks::Now());
+ capture_format_, rotation, current_time,
+ current_time - first_ref_time_);
}
env->ReleaseByteArrayElements(data, buffer, JNI_ABORT);
« no previous file with comments | « media/capture/video/android/video_capture_device_android.h ('k') | media/capture/video/fake_video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698