Chromium Code Reviews| Index: media/capture/video/mac/video_capture_device_decklink_mac.mm |
| diff --git a/media/capture/video/mac/video_capture_device_decklink_mac.mm b/media/capture/video/mac/video_capture_device_decklink_mac.mm |
| index b075c4b234a28f790f63820a589398d4cb4619f4..cdb720b09d03ad969bdcdeeaf879ece3b9918f9c 100644 |
| --- a/media/capture/video/mac/video_capture_device_decklink_mac.mm |
| +++ b/media/capture/video/mac/video_capture_device_decklink_mac.mm |
| @@ -92,6 +92,8 @@ class DeckLinkCaptureDelegate |
| // |decklink_| represents a physical device attached to the host. |
| ScopedDeckLinkPtr<IDeckLink> decklink_; |
| + base::TimeTicks first_ref_time_; |
| + |
| // Checks for Device (a.k.a. Audio) thread. |
| base::ThreadChecker thread_checker_; |
| @@ -258,11 +260,14 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived( |
| pixel_format); |
| base::AutoLock lock(lock_); |
| if (frame_receiver_) { |
| + base::TimeTicks now = base::TimeTicks::Now(); |
|
miu
2016/05/18 22:35:40
The call to TimeTicks::Now() should be moved to th
qiangchen
2016/05/20 17:55:14
Done.
|
| + if (first_ref_time_.is_null()) |
| + first_ref_time_ = now; |
|
miu
2016/05/18 22:35:40
BTW--You can get the timestamp from the |video_fra
qiangchen
2016/05/20 17:55:14
Done.
|
| frame_receiver_->OnIncomingCapturedData( |
| video_data, video_frame->GetRowBytes() * video_frame->GetHeight(), |
| capture_format, |
| 0, // Rotation. |
| - base::TimeTicks::Now()); |
| + now, now - first_ref_time_); |
| } |
| return S_OK; |
| } |
| @@ -451,11 +456,12 @@ void VideoCaptureDeviceDeckLinkMac::OnIncomingCapturedData( |
| size_t length, |
| const VideoCaptureFormat& frame_format, |
| int rotation, // Clockwise. |
| - base::TimeTicks timestamp) { |
| + base::TimeTicks reference_time, |
| + base::TimeDelta timestamp) { |
| base::AutoLock lock(lock_); |
| if (client_) { |
| client_->OnIncomingCapturedData(data, length, frame_format, rotation, |
| - timestamp); |
| + reference_time, timestamp); |
| } |
| } |