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

Unified Diff: content/common/gpu/media/vaapi_video_encode_accelerator.cc

Issue 686283002: Vaapi VEA: always generate IDR when keyframe is requested. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure - forgot to set current_encode_job_->keyframe. Created 6 years, 2 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 | « no previous file | content/common/gpu/media/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/vaapi_video_encode_accelerator.cc
diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.cc b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
index 14ffe34355012f74e4ce4e72c13f24ae8b915b7a..19e1c0820dd1b4d7c741e30935cee9de30f7de28 100644
--- a/content/common/gpu/media/vaapi_video_encode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
@@ -291,7 +291,7 @@ void VaapiVideoEncodeAccelerator::BeginFrame(bool force_keyframe) {
else
current_pic_.type = media::H264SliceHeader::kPSlice;
- if (current_pic_.frame_num % idr_period_ == 0) {
+ if (current_pic_.frame_num % idr_period_ == 0 || force_keyframe) {
current_pic_.idr = true;
last_idr_frame_num_ = current_pic_.frame_num;
ref_pic_list0_.clear();
@@ -304,8 +304,7 @@ void VaapiVideoEncodeAccelerator::BeginFrame(bool force_keyframe) {
current_pic_.top_field_order_cnt = current_pic_.pic_order_cnt;
current_pic_.pic_order_cnt_lsb = current_pic_.pic_order_cnt;
- current_encode_job_->keyframe =
- (current_pic_.type == media::H264SliceHeader::kISlice);
+ current_encode_job_->keyframe = current_pic_.idr;
DVLOGF(4) << "Starting a new frame, type: " << current_pic_.type
<< (force_keyframe ? " (forced keyframe)" : "")
« no previous file with comments | « no previous file | content/common/gpu/media/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698