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

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
« no previous file with comments | « media/gpu/ipc/service/gpu_video_encode_accelerator.cc ('k') | media/gpu/vaapi_video_encode_accelerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c6bcc29cba5ddfb01b433fa5320b2f2320dd8a0f..9afa64538a3471af4e9e0b81b86a52a1e7c1a355 100644
--- a/media/gpu/v4l2_video_encode_accelerator.cc
+++ b/media/gpu/v4l2_video_encode_accelerator.cc
@@ -665,8 +665,12 @@ void V4L2VideoEncodeAccelerator::Dequeue() {
<< ", key_frame=" << key_frame;
child_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&Client::BitstreamBufferReady, client_,
- output_record.buffer_ref->id, output_size, key_frame));
+ base::Bind(
+ &Client::BitstreamBufferReady, client_,
+ output_record.buffer_ref->id, output_size, key_frame,
+ base::TimeDelta::FromMicroseconds(
+ dqbuf.timestamp.tv_usec +
+ dqbuf.timestamp.tv_sec * base::Time::kMicrosecondsPerSecond)));
output_record.at_device = false;
output_record.buffer_ref.reset();
free_output_buffers_.push_back(dqbuf.index);
@@ -691,6 +695,10 @@ bool V4L2VideoEncodeAccelerator::EnqueueInputRecord() {
qbuf.index = index;
qbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
qbuf.m.planes = qbuf_planes;
+ qbuf.timestamp.tv_sec = static_cast<time_t>(frame->timestamp().InSeconds());
+ qbuf.timestamp.tv_usec =
+ frame->timestamp().InMicroseconds() -
+ frame->timestamp().InSeconds() * base::Time::kMicrosecondsPerSecond;
DCHECK_EQ(device_input_format_, frame->format());
for (size_t i = 0; i < input_planes_count_; ++i) {
« no previous file with comments | « media/gpu/ipc/service/gpu_video_encode_accelerator.cc ('k') | media/gpu/vaapi_video_encode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698