diff options
author | qiangchen <qiangchen@chromium.org> | 2016-03-11 12:44:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-11 20:46:59 +0000 |
commit | 10127cd472aa0e25de29b9debfbe1933f39ea7cd (patch) | |
tree | 539fdc2d54a6835775cfddbee86c2774e9684dfb /media | |
parent | e8821e2f26fadc019c3b82807854d03ae203d5de (diff) | |
download | chromium_src-10127cd472aa0e25de29b9debfbe1933f39ea7cd.zip chromium_src-10127cd472aa0e25de29b9debfbe1933f39ea7cd.tar.gz chromium_src-10127cd472aa0e25de29b9debfbe1933f39ea7cd.tar.bz2 |
Revert of Use system timestamp as capture timestamp (patchset #1 id:1 of https://codereview.chromium.org/1671943003/ )
Reason for revert:
WebRTC part of the issue has been fixed.
Thus we can reland the camera timestamp CL.
Original issue's description:
> Use system timestamp as capture timestamp
>
> For rendering smoothness, we used camera timestamp as capture timestamp,
> but if the clockrate of the camera is different from the system clock,
> it will make audio-video out of sync. So we change it back so far.
>
> This CL is essentially a revert of
> https://codereview.chromium.org/1324683004/
> https://codereview.chromium.org/1421583007/
>
> P.S. An ideal solution is that we should take in camera
> timestamp, but smoothly aligned with system clock. But at
> this point, we should make a quick CL to resolve this issue.
>
> BUG=584015
>
> Committed: https://crrev.com/8e0974d2b27ab55a8df948b86804bf0f11c036e2
> Cr-Commit-Position: refs/heads/master@{#373966}
TBR=dalecurtis@chromium.org,pbos@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=584015
Review URL: https://codereview.chromium.org/1783603004
Cr-Commit-Position: refs/heads/master@{#380721}
Diffstat (limited to 'media')
-rw-r--r-- | media/capture/video/mac/video_capture_device_mac.mm | 12 | ||||
-rw-r--r-- | media/capture/video/win/video_capture_device_win.cc | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/media/capture/video/mac/video_capture_device_mac.mm b/media/capture/video/mac/video_capture_device_mac.mm index 432fbfb..ec6fcaf 100644 --- a/media/capture/video/mac/video_capture_device_mac.mm +++ b/media/capture/video/mac/video_capture_device_mac.mm @@ -545,8 +545,18 @@ void VideoCaptureDeviceMac::ReceiveFrame(const uint8_t* video_frame, return; } + base::TimeTicks aligned_timestamp; + if (timestamp == media::kNoTimestamp()) { + aligned_timestamp = base::TimeTicks::Now(); + } else { + if (first_timestamp_ == media::kNoTimestamp()) { + first_timestamp_ = timestamp; + first_aligned_timestamp_ = base::TimeTicks::Now(); + } + aligned_timestamp = first_aligned_timestamp_ + timestamp - first_timestamp_; + } client_->OnIncomingCapturedData(video_frame, video_frame_length, frame_format, - 0, base::TimeTicks::Now()); + 0, aligned_timestamp); } void VideoCaptureDeviceMac::ReceiveError( diff --git a/media/capture/video/win/video_capture_device_win.cc b/media/capture/video/win/video_capture_device_win.cc index 21cc450..53a47dd 100644 --- a/media/capture/video/win/video_capture_device_win.cc +++ b/media/capture/video/win/video_capture_device_win.cc @@ -453,7 +453,7 @@ void VideoCaptureDeviceWin::FrameReceived(const uint8_t* buffer, int length, base::TimeTicks timestamp) { client_->OnIncomingCapturedData(buffer, length, capture_format_, 0, - base::TimeTicks::Now()); + timestamp); } bool VideoCaptureDeviceWin::CreateCapabilityMap() { |