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

Unified Diff: media/gpu/vaapi_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/vaapi_video_encode_accelerator.h ('k') | media/gpu/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/vaapi_video_encode_accelerator.cc
diff --git a/media/gpu/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi_video_encode_accelerator.cc
index 5eea88e5335b78e457ff784a2789c0e7f850b3cd..01efaadcf8cfc49d7e1a6312cb8e01d703e91d77 100644
--- a/media/gpu/vaapi_video_encode_accelerator.cc
+++ b/media/gpu/vaapi_video_encode_accelerator.cc
@@ -555,8 +555,9 @@ void VaapiVideoEncodeAccelerator::TryToReturnBitstreamBuffer() {
<< " id: " << buffer->id << " size: " << data_size;
child_task_runner_->PostTask(
- FROM_HERE, base::Bind(&Client::BitstreamBufferReady, client_, buffer->id,
- data_size, encode_job->keyframe));
+ FROM_HERE,
+ base::Bind(&Client::BitstreamBufferReady, client_, buffer->id, data_size,
+ encode_job->keyframe, encode_job->timestamp));
}
void VaapiVideoEncodeAccelerator::Encode(
@@ -571,7 +572,7 @@ void VaapiVideoEncodeAccelerator::Encode(
base::Unretained(this), frame, force_keyframe));
}
-bool VaapiVideoEncodeAccelerator::PrepareNextJob() {
+bool VaapiVideoEncodeAccelerator::PrepareNextJob(base::TimeDelta timestamp) {
if (available_va_surface_ids_.size() < kMinSurfacesToEncode)
return false;
@@ -584,6 +585,8 @@ bool VaapiVideoEncodeAccelerator::PrepareNextJob() {
return false;
}
+ current_encode_job_->timestamp = timestamp;
+
current_encode_job_->input_surface = new VASurface(
available_va_surface_ids_.back(), coded_size_,
vaapi_wrapper_->va_surface_format(), va_surface_release_cb_);
@@ -619,7 +622,7 @@ void VaapiVideoEncodeAccelerator::EncodeFrameTask() {
if (state_ != kEncoding || encoder_input_queue_.empty())
return;
- if (!PrepareNextJob()) {
+ if (!PrepareNextJob(encoder_input_queue_.front()->frame->timestamp())) {
DVLOGF(4) << "Not ready for next frame yet";
return;
}
« no previous file with comments | « media/gpu/vaapi_video_encode_accelerator.h ('k') | media/gpu/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698