diff options
author | Arun Menon <avmenon@codeaurora.org> | 2016-03-25 18:39:13 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-04 11:16:56 -0700 |
commit | ace6a48e31dced9a2cde11d45ae9eaf3c616c84a (patch) | |
tree | 7dd5f5d6be68ed08fde22b593ee37db282308d20 | |
parent | ccce87dee6d412f25e209478b9c47d62197cbcac (diff) | |
download | android_hardware_qcom_media-ace6a48e31dced9a2cde11d45ae9eaf3c616c84a.tar.gz android_hardware_qcom_media-ace6a48e31dced9a2cde11d45ae9eaf3c616c84a.tar.bz2 android_hardware_qcom_media-ace6a48e31dced9a2cde11d45ae9eaf3c616c84a.zip |
mm-video-v4l2: vdec: Call vidioc_g_fmt to get updated buffer size
During get_parameter(OMX_IndexParamPortDefinition) call, OMX component
was not querying the updated buffer size information from driver
and relying on stale buffer size information.
Change-Id: I10abbc35d67ec33d29bb6cafa6c47ceab5a38566
-rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp index 69eaf1c4..788a89d0 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -9670,10 +9670,22 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn) fmt.fmt.pix_mp.pixelformat = output_capability; } else if (1 == portDefn->nPortIndex) { unsigned int buf_size = 0; + int ret = 0; if (!client_buffers.update_buffer_req()) { DEBUG_PRINT_ERROR("client_buffers.update_buffer_req Failed"); return OMX_ErrorHardware; } + + memset(&fmt, 0x0, sizeof(struct v4l2_format)); + fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + fmt.fmt.pix_mp.pixelformat = capture_capability; + ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_G_FMT, &fmt); + if (ret) { + DEBUG_PRINT_ERROR("Get Resolution failed"); + return OMX_ErrorHardware; + } + drv_ctx.op_buf.buffer_size = fmt.fmt.pix_mp.plane_fmt[0].sizeimage; + if (!client_buffers.get_buffer_req(buf_size)) { DEBUG_PRINT_ERROR("update buffer requirements"); return OMX_ErrorHardware; |