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

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

Issue 2487483002: Bug Fix: Logitech C930 On Linux Results In Freezing Video [M54] (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 a6f47b551ed410f3fa28c5f45b888eee6f97c0b7..956f27c1515baf7ae8159d063b32d889357f96af 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.cc
+++ b/media/capture/video/linux/v4l2_capture_delegate.cc
@@ -394,12 +394,14 @@ 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);
+ 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);
if (HANDLE_EINTR(ioctl(device_fd_.get(), VIDIOC_QBUF, &buffer)) < 0) {
SetErrorState(FROM_HERE, "Failed to enqueue capture buffer");
« 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