summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshray Kulkarni <ashrayk@codeaurora.org>2015-04-10 16:02:34 -0700
committerChien-Yu Chen <cychen@google.com>2015-09-09 12:29:57 -0700
commit85f0f4569ef49f7acf4263ab6eb21b89a55d46c8 (patch)
tree1c602e9d1e3e3a73494807407730245ec29703df
parentfc756c82140c35ec1a9e8b3167e3caa43f5bf3dd (diff)
downloadandroid_hardware_qcom_media-85f0f4569ef49f7acf4263ab6eb21b89a55d46c8.tar.gz
android_hardware_qcom_media-85f0f4569ef49f7acf4263ab6eb21b89a55d46c8.tar.bz2
android_hardware_qcom_media-85f0f4569ef49f7acf4263ab6eb21b89a55d46c8.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.cpp11
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;