diff options
author | Hangyu Kuang <hkuang@google.com> | 2018-05-31 09:56:25 -0700 |
---|---|---|
committer | Hangyu Kuang <hkuang@google.com> | 2018-05-31 09:56:25 -0700 |
commit | 6872194db0855c0cd4a224b961c6f1f2fc88bffc (patch) | |
tree | 5d5142c5a21bed7b6192d7bfb5a5cfe30200dd82 /mm-video-v4l2/vidc/venc | |
parent | 524c9287a1cd510dc134384024238ff7d2a3b267 (diff) | |
download | media-6872194db0855c0cd4a224b961c6f1f2fc88bffc.tar.gz |
media: Fix Qualcomm's key frame interval bug.
Bug: 80321721
Test: Video recording and look at the output video.
Change-Id: I501de4899c94af8e8ef341b7f9546016d7b8b3e7
Diffstat (limited to 'mm-video-v4l2/vidc/venc')
-rw-r--r-- | mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h | 2 | ||||
-rw-r--r-- | mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h b/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h index e7d56eff..6db4993e 100644 --- a/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h +++ b/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h @@ -404,7 +404,7 @@ class venc_dev struct ion_fd_data ion_alloc_fd; #endif }; - + int nPframes_cache; int stopped; int resume_in_stopped; bool m_max_allowed_bitrate_check; diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp index bd1e9ef4..bedeaba8 100644 --- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp +++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp @@ -4157,6 +4157,7 @@ bool venc_dev::venc_empty_buf(void *buffer, void *pmem_data_buf, unsigned index, m_sVenc_cfg.inputformat != V4L2_PIX_FMT_NV12_UBWC)) { if (bframe_implicitly_enabled) { DEBUG_PRINT_HIGH("Disabling implicitly enabled B-frames"); + intra_period.num_pframes = nPframes_cache; if (!_venc_set_intra_period(intra_period.num_pframes, 0)) { DEBUG_PRINT_ERROR("Failed to set nPframes/nBframes"); return OMX_ErrorUndefined; @@ -5073,6 +5074,7 @@ bool venc_dev::venc_reconfigure_intra_period() if (enableBframes && intra_period.num_bframes == 0) { intra_period.num_bframes = VENC_BFRAME_MAX_COUNT; + nPframes_cache = intra_period.num_pframes; intra_period.num_pframes = intra_period.num_pframes / (1 + intra_period.num_bframes); bframe_implicitly_enabled = true; } else if (!enableBframes && intra_period.num_bframes > 0) { |