diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-11-28 02:54:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-11-28 02:54:34 +0000 |
commit | 697914fdb7f177ca2d7b831595bda47f084e6d6a (patch) | |
tree | 45404165ef1f525d66a185044da27b89d6da2107 /msm8998 | |
parent | d60f73ef816b2994b4dd44a8198311656bc2ce10 (diff) | |
parent | ce3afcce09d642dd4428e221e0e1249ef3854aee (diff) | |
download | media-697914fdb7f177ca2d7b831595bda47f084e6d6a.tar.gz |
Merge "mm-video-v4l2: Set input buffer requirement on allocation"
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); |