From 28d22aa08181b769727676e60e3c4c912b42b679 Mon Sep 17 00:00:00 2001 From: Deepak Kushwah Date: Mon, 17 Oct 2016 14:53:20 +0530 Subject: [PATCH] mm-video-v4l2: Reset drv_ctx o/p buffer requirements in loaded state When component is moved from executing to idle to loaded and then again from loaded to idle to executing without change in resolution, set buffer requirements is not called as resolution is not changed. This is leading to stream on failure on resuming the session (loaded to executing). This change will reset the output buffer requirements for drv_ctx when component is moved to loaded state to ensure set buffer requirements will get called on resuming the session. Change-Id: I6b1788fd7c5359dc3e36e9bba8c7282ea02419ad CRs-Fixed: 1080064 --- mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 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 02340f77..118a8277 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -2871,9 +2871,13 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, if (eState == OMX_StateLoaded) { if (release_done()) { /* - Since error is None , we will post an event at the end - of this function definition + * Since error is None , we will post an event at the end + * of this function definition + * Reset buffer requirements here to ensure setting buffer requirement + * when component move to executing state from loaded state via Idle. */ + drv_ctx.op_buf.buffer_size = 0; + drv_ctx.op_buf.actualcount = 0; DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Loaded"); } else { DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Loaded-Pending"); @@ -7199,6 +7203,13 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp, if ((eRet == OMX_ErrorNone) && (BITMASK_PRESENT(&m_flags ,OMX_COMPONENT_LOADING_PENDING))) { if (release_done()) { + /* + * Reset buffer requirements here to ensure setting buffer requirement + * when component move to executing state from loaded state via idle. + */ + drv_ctx.op_buf.buffer_size = 0; + drv_ctx.op_buf.actualcount = 0; + // Send the callback now BITMASK_CLEAR((&m_flags),OMX_COMPONENT_LOADING_PENDING); post_event(OMX_CommandStateSet, OMX_StateLoaded,