diff options
author | Govindaraj Rajagopal <grajagop@codeaurora.org> | 2019-02-13 18:01:27 +0530 |
---|---|---|
committer | Sanjay Singh <sisanj@codeaurora.org> | 2020-10-30 16:15:30 +0530 |
commit | 9845bc81180fe4ccb0449465465cb5cd52dceab1 (patch) | |
tree | e128a35a03a9b27c539f29fb752c099d2a6416fd | |
parent | 094a1c8ea5458c9190082d5d5c0342ff18f76925 (diff) |
mm-video-v4l2: vdec: do not update buffer requirements during getparameter
Updating buffer requirements in getparameter replaces all the values set by client.
For only secure usecase, input buffer size is halved in kernel, so query only
buffer size instead of overriding complete buffer requirements set by client.
Change-Id: I45d43a10b698fad36cd083f878ab4be80b004cfb
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
-rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 20 |
1 files changed, 7 insertions, 13 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 a7c636ea..201f6e09 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -10372,16 +10372,14 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn) memset(&fmt, 0x0, sizeof(struct v4l2_format)); if (0 == portDefn->nPortIndex) { int ret = 0; - if (secure_mode) { - fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - fmt.fmt.pix_mp.pixelformat = output_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.ip_buf.buffer_size = fmt.fmt.pix_mp.plane_fmt[0].sizeimage; + fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; + fmt.fmt.pix_mp.pixelformat = output_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.ip_buf.buffer_size = fmt.fmt.pix_mp.plane_fmt[0].sizeimage; portDefn->eDir = OMX_DirInput; portDefn->nBufferCountActual = drv_ctx.ip_buf.actualcount; portDefn->nBufferCountMin = drv_ctx.ip_buf.mincount; @@ -10393,10 +10391,6 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn) portDefn->format.video.xFramerate = m_fps_received; portDefn->bEnabled = m_inp_bEnabled; portDefn->bPopulated = m_inp_bPopulated; - - fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - fmt.fmt.pix_mp.pixelformat = output_capability; - ioctl(drv_ctx.video_driver_fd, VIDIOC_G_FMT, &fmt); } else if (1 == portDefn->nPortIndex) { unsigned int buf_size = 0; int ret = 0; |