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

Unified Diff: media/gpu/v4l2_video_encode_accelerator.cc

Issue 1996453003: RTC Video Encoder: Use capturer timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: media/gpu/v4l2_video_encode_accelerator.cc
diff --git a/media/gpu/v4l2_video_encode_accelerator.cc b/media/gpu/v4l2_video_encode_accelerator.cc
index 202a502038d3bd514ca2aa5f015c927484c42e1f..6a269457d618ee8a2819ce0c91c109cc79b6eb88 100644
--- a/media/gpu/v4l2_video_encode_accelerator.cc
+++ b/media/gpu/v4l2_video_encode_accelerator.cc
@@ -664,7 +664,9 @@ void V4L2VideoEncodeAccelerator::Dequeue() {
child_task_runner_->PostTask(
FROM_HERE,
base::Bind(&Client::BitstreamBufferReady, client_,
- output_record.buffer_ref->id, output_size, key_frame));
+ output_record.buffer_ref->id, output_size, key_frame,
+ base::TimeDelta::FromMicroseconds(
+ static_cast<int64_t>(dqbuf.timestamp.tv_usec))));
Pawel Osciak 2016/05/23 07:15:53 Do we need the cast? Also, we need both tv_sec and
shenghao 2016/05/24 10:50:19 Removed the cast. I think we only need the usec to
Pawel Osciak 2016/05/26 07:39:23 We need both, usec only stores < 1s part of the va
shenghao 2016/05/26 10:38:20 Done.
output_record.at_device = false;
output_record.buffer_ref.reset();
free_output_buffers_.push_back(dqbuf.index);
@@ -689,6 +691,11 @@ bool V4L2VideoEncodeAccelerator::EnqueueInputRecord() {
qbuf.index = index;
qbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
qbuf.m.planes = qbuf_planes;
+ struct timeval timestamp;
+ timestamp.tv_sec = static_cast<time_t>(frame->timestamp().InSeconds());
+ timestamp.tv_usec =
Pawel Osciak 2016/05/23 07:15:52 I'm wondering if we need the casts?
shenghao 2016/05/24 10:50:19 Done.
+ static_cast<suseconds_t>(frame->timestamp().InMicroseconds());
+ qbuf.timestamp = timestamp;
Pawel Osciak 2016/05/23 07:15:52 Do we need the temporary timestamp, could we just
shenghao 2016/05/24 10:50:19 Done.
DCHECK_EQ(device_input_format_, frame->format());
for (size_t i = 0; i < input_planes_count_; ++i) {

Powered by Google App Engine
This is Rietveld 408576698