diff options
author | Santhosh Behara <santhoshbehara@codeaurora.org> | 2017-10-18 16:40:13 +0530 |
---|---|---|
committer | Pawin Vongmasa <pawin@google.com> | 2017-10-30 20:27:30 -0700 |
commit | ce3afcce09d642dd4428e221e0e1249ef3854aee (patch) | |
tree | c2b016c166e2b7c57ef0e0aadc2e0376a9adf45c /msm8998 | |
parent | 64b05f1905eb7c5f992cde3c3dcc9e7996d57a0b (diff) | |
download | media-ce3afcce09d642dd4428e221e0e1249ef3854aee.tar.gz |
mm-video-v4l2: Set input buffer requirement on allocation
Set input buffer requirement on driver, as input buffers may
be allocated without set param, due to which driver may have
0 buffers allocated
Test: make vts -j123 && vts-tradefed run commandAndExit vts \
--skip-all-system-status-check \
--skip-preconditions -m VtsHalMediaOmxV1_0Host \
-l INFO
Bug: 66804380
Author: Surajit Podder<spodder@codeaurora.org>
Change-Id: I52d35ebeeaa9c32d5e85f63ab6394ea7dabda020
Diffstat (limited to 'msm8998')
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp index a973998..9fb68e0 100644 --- a/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -6729,7 +6729,7 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer( OMX_BUFFERHEADERTYPE *input = NULL; unsigned i = 0; unsigned char *buf_addr = NULL; - int pmem_fd = -1; + int pmem_fd = -1, ret = 0; (void) hComp; (void) port; @@ -6742,6 +6742,21 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer( } if (!m_inp_mem_ptr) { + struct v4l2_requestbuffers bufreq; + bufreq.memory = V4L2_MEMORY_USERPTR; + bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; + bufreq.count = drv_ctx.ip_buf.actualcount; + ret = ioctl(drv_ctx.video_driver_fd,VIDIOC_REQBUFS, &bufreq); + if (ret) { + DEBUG_PRINT_ERROR("Setting buffer requirements (reqbufs) failed %s", strerror(errno)); + /*TODO: How to handle this case */ + eRet = OMX_ErrorInsufficientResources; + } else if (bufreq.count != drv_ctx.ip_buf.actualcount) { + DEBUG_PRINT_ERROR("%s Count(%d) is not expected to change to %d", + __FUNCTION__, drv_ctx.ip_buf.actualcount, bufreq.count); + eRet = OMX_ErrorInsufficientResources; + } + DEBUG_PRINT_HIGH("Allocate i/p buffer Header: Cnt(%d) Sz(%u)", drv_ctx.ip_buf.actualcount, (unsigned int)drv_ctx.ip_buf.buffer_size); |