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

Unified Diff: content/renderer/media/video_capture_impl.cc

Issue 101843005: Convert video capture pipline to base::TimeTicks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 9890509b Rebase, Windows compile fixes Created 6 years, 11 months 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 | « content/renderer/media/video_capture_impl.h ('k') | content/renderer/media/video_capture_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/video_capture_impl.cc
diff --git a/content/renderer/media/video_capture_impl.cc b/content/renderer/media/video_capture_impl.cc
index 30b43ddfcf4d41c46782c4b7229a354ab60218b4..066daf2a1a286bad086f0967956d9e6efc529754 100644
--- a/content/renderer/media/video_capture_impl.cc
+++ b/content/renderer/media/video_capture_impl.cc
@@ -104,7 +104,7 @@ void VideoCaptureImpl::OnBufferDestroyed(int buffer_id) {
void VideoCaptureImpl::OnBufferReceived(
int buffer_id,
- base::Time timestamp,
+ base::TimeTicks timestamp,
const media::VideoCaptureFormat& format) {
capture_message_loop_proxy_->PostTask(FROM_HERE,
base::Bind(&VideoCaptureImpl::DoBufferReceivedOnCaptureThread,
@@ -177,7 +177,7 @@ void VideoCaptureImpl::DoStartCaptureOnCaptureThread(
}
DVLOG(1) << "StartCapture: starting with first resolution "
<< params_.requested_format.frame_size.ToString();
-
+ first_frame_timestamp_ = base::TimeTicks();
StartCaptureInternal();
}
}
@@ -242,7 +242,7 @@ void VideoCaptureImpl::DoBufferDestroyedOnCaptureThread(int buffer_id) {
void VideoCaptureImpl::DoBufferReceivedOnCaptureThread(
int buffer_id,
- base::Time timestamp,
+ base::TimeTicks timestamp,
const media::VideoCaptureFormat& format) {
DCHECK(capture_message_loop_proxy_->BelongsToCurrentThread());
@@ -252,6 +252,8 @@ void VideoCaptureImpl::DoBufferReceivedOnCaptureThread(
}
last_frame_format_ = format;
+ if (first_frame_timestamp_.is_null())
+ first_frame_timestamp_ = timestamp;
ClientBufferMap::iterator iter = client_buffers_.find(buffer_id);
DCHECK(iter != client_buffers_.end());
@@ -265,9 +267,7 @@ void VideoCaptureImpl::DoBufferReceivedOnCaptureThread(
reinterpret_cast<uint8*>(buffer->buffer->memory()),
buffer->buffer_size,
buffer->buffer->handle(),
- // TODO(sheu): convert VideoCaptureMessageFilter::Delegate to use
- // base::TimeTicks instead of base::Time. http://crbug.com/249215
- timestamp - base::Time::UnixEpoch(),
+ timestamp - first_frame_timestamp_,
media::BindToLoop(
capture_message_loop_proxy_,
base::Bind(
« no previous file with comments | « content/renderer/media/video_capture_impl.h ('k') | content/renderer/media/video_capture_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698