diff options
author | Ashray Kulkarni <ashrayk@codeaurora.org> | 2015-04-10 16:02:34 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-09-09 14:58:20 -0700 |
commit | 9d8954113625360e2a05ca0cad93b987ce516818 (patch) | |
tree | 1c602e9d1e3e3a73494807407730245ec29703df | |
parent | b76a02988c5d8dbebe00787176d6a792ecba0caa (diff) | |
download | android_hardware_qcom_media-9d8954113625360e2a05ca0cad93b987ce516818.tar.gz android_hardware_qcom_media-9d8954113625360e2a05ca0cad93b987ce516818.tar.bz2 android_hardware_qcom_media-9d8954113625360e2a05ca0cad93b987ce516818.zip |
mm-video-v4l2: venc: Update low power mode for 4K recording
- Enable low power mode for 4K recording
- Increasing min buff count for 4K session to 11 for power save mode.
Bug: 23505291
Change-Id: I6e35d373d7dc57f95f35d9a6acc45246552d21b2
-rw-r--r-- | mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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 96fbbe67..7ad8ca2a 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 @@ -1195,10 +1195,14 @@ bool venc_dev::venc_get_buf_req(OMX_U32 *min_buff_count, // Increase buffer-header count for metadata-mode on input port // to improve buffering and reduce bottlenecks in clients if (metadatamode && (bufreq.count < 9)) { - DEBUG_PRINT_LOW("FW returned buffer count = %d , overwriting with 16", + DEBUG_PRINT_LOW("FW returned buffer count = %d , overwriting with 9", bufreq.count); bufreq.count = 9; } + if (m_sVenc_cfg.input_height * m_sVenc_cfg.input_width >= 3840*2160) { + DEBUG_PRINT_LOW("Increasing buffer count = %d to 11", bufreq.count); + bufreq.count = 11; + } bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq); @@ -1335,6 +1339,11 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index ) DEBUG_PRINT_LOW("input: actual: %u, min: %u, count_req: %u", (unsigned int)portDefn->nBufferCountActual, (unsigned int)m_sInput_buff_property.mincount, bufreq.count); + if (m_sVenc_cfg.input_width * m_sVenc_cfg.input_height >= 3840 * 2160) { + if (venc_set_perf_mode(V4L2_MPEG_VIDC_VIDEO_PERF_POWER_SAVE) == false) { + DEBUG_PRINT_ERROR("ERROR: Failed to set Power save mode"); + } + } } else if (portDefn->nPortIndex == PORT_INDEX_OUT) { m_sVenc_cfg.dvs_height = portDefn->format.video.nFrameHeight; m_sVenc_cfg.dvs_width = portDefn->format.video.nFrameWidth; |