Commit 8413c2fc authored by Chih-Yu Huang's avatar Chih-Yu Huang Committed by Commit Bot

v4l2_vea: Fix timestamp of BitstreamMetadata.

Time::FromTimeVal() method will add the offset of UNIX epoch,
and breaks the timestamp check at video_encode_accelerator_unittest.
This CL change it to Time::FromMicroseconds().

BUG=chromium:853185
TEST=pass video_encode_accelerator_unittest at Kevin device

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ia13027141062015f904be74b9323a988697fea3a
Reviewed-on: https://chromium-review.googlesource.com/1133612
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarPawel Osciak <posciak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575537}
parent 4030d08e
......@@ -738,11 +738,13 @@ void V4L2VideoEncodeAccelerator::Dequeue() {
child_task_runner_->PostTask(
FROM_HERE,
base::Bind(
&Client::BitstreamBufferReady, client_, bitstream_buffer_id,
BitstreamBufferMetadata(
output_data_size, key_frame,
base::Time::FromTimeVal(dqbuf.timestamp).since_origin())));
base::Bind(&Client::BitstreamBufferReady, client_, bitstream_buffer_id,
BitstreamBufferMetadata(
output_data_size, key_frame,
base::TimeDelta::FromMicroseconds(
dqbuf.timestamp.tv_usec +
dqbuf.timestamp.tv_sec *
base::Time::kMicrosecondsPerSecond))));
if ((encoder_state_ == kFlushing) && (dqbuf.flags & V4L2_BUF_FLAG_LAST)) {
// Notify client that flush has finished successfully. The flush callback
// should be called after notifying the last buffer is ready.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment