| Index: content/browser/media/capture/desktop_capture_device.cc
|
| diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc
|
| index a76bc8d4fd9bad4cba6f3c32cd2f6c0a423ab122..2524fd1396d7e20ee2da3d5f9cf68ee830e31123 100644
|
| --- a/content/browser/media/capture/desktop_capture_device.cc
|
| +++ b/content/browser/media/capture/desktop_capture_device.cc
|
| @@ -126,6 +126,9 @@ class DesktopCaptureDevice::Core : public webrtc::DesktopCapturer::Callback {
|
| // The type of the capturer.
|
| DesktopMediaID::Type capturer_type_;
|
|
|
| + // The system time when we receive the first frame.
|
| + base::TimeTicks first_ref_time_;
|
| +
|
| std::unique_ptr<webrtc::BasicDesktopFrame> black_frame_;
|
|
|
| // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the
|
| @@ -308,12 +311,15 @@ void DesktopCaptureDevice::Core::OnCaptureCompleted(
|
| output_data = frame->data();
|
| }
|
|
|
| + base::TimeTicks now = base::TimeTicks::Now();
|
| + if (first_ref_time_.is_null())
|
| + first_ref_time_ = now;
|
| client_->OnIncomingCapturedData(
|
| output_data, output_bytes,
|
| media::VideoCaptureFormat(
|
| gfx::Size(output_size.width(), output_size.height()),
|
| requested_frame_rate_, media::PIXEL_FORMAT_ARGB),
|
| - 0, base::TimeTicks::Now());
|
| + 0, now, now - first_ref_time_);
|
| }
|
|
|
| void DesktopCaptureDevice::Core::OnCaptureTimer() {
|
|
|