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
This commit is contained in:
Deepak Kushwah 2016-10-17 14:53:20 +05:30 committed by Gerrit - the friendly Code Review server
parent 6d69567372
commit 28d22aa081

View file

@ -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,