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

Unified Diff: media/capture/video/linux/v4l2_capture_delegate.cc

Issue 2478273002: Bug Fix: Logitech C930 On Linux Results In Freezing Video [M55] (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « media/capture/video/linux/v4l2_capture_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/linux/v4l2_capture_delegate.cc
diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/media/capture/video/linux/v4l2_capture_delegate.cc
index aecebccdde8abefdf15175505500ff8d3247e8a0..9adeed35926aff42f4fdcfba19c5ba1ad035b00c 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.cc
+++ b/media/capture/video/linux/v4l2_capture_delegate.cc
@@ -563,12 +563,18 @@ void V4L2CaptureDelegate::DoCapture() {
const scoped_refptr<BufferTracker>& buffer_tracker =
buffer_tracker_pool_[buffer.index];
- base::TimeDelta timestamp =
- base::TimeDelta::FromSeconds(buffer.timestamp.tv_sec) +
- base::TimeDelta::FromMicroseconds(buffer.timestamp.tv_usec);
- client_->OnIncomingCapturedData(
- buffer_tracker->start(), buffer_tracker->payload_size(),
- capture_format_, rotation_, base::TimeTicks::Now(), timestamp);
+ // There's a wide-spread issue where the kernel does not report accurate,
+ // monotonically-increasing timestamps in the v4l2_buffer::timestamp
+ // field (goo.gl/Nlfamz).
+ // Until this issue is fixed, just use the reference clock as a source of
+ // media timestamps.
+ const base::TimeTicks now = base::TimeTicks::Now();
+ if (first_ref_time_.is_null())
+ first_ref_time_ = now;
+ const base::TimeDelta timestamp = now - first_ref_time_;
+ client_->OnIncomingCapturedData(buffer_tracker->start(),
+ buffer_tracker->payload_size(),
+ capture_format_, rotation_, now, timestamp);
while (!take_photo_callbacks_.empty()) {
VideoCaptureDevice::TakePhotoCallback cb =
« no previous file with comments | « media/capture/video/linux/v4l2_capture_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698