mm-video-v4l2: vdec: change notify flush done to client

Component doesn't support flush on single port, Internally
it calls flush on both ports though client request on single
port. Hence notify flush done to client after flush on all
the ports has been completed.

author : Manikanta Kanamarlapudi <kmanikan@codeaurora.org>

CRs-Fixed: 2076660

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 63603864

Merged-In: I319f42a02361a74d7c0c51215f6bdaa7a1c2a2d6
Change-Id: I319f42a02361a74d7c0c51215f6bdaa7a1c2a2d6
This commit is contained in:
Mahesh Lanka 2017-07-19 15:54:01 +05:30 committed by Pawin Vongmasa
parent 30d04e5dd3
commit 1cd54c508a
2 changed files with 36 additions and 16 deletions

View file

@ -638,6 +638,7 @@ class omx_vdec: public qc_omx_component
bool execute_omx_flush(OMX_U32);
bool execute_output_flush();
bool execute_input_flush();
void notify_flush_done(void *ctxt);
OMX_ERRORTYPE empty_buffer_done(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE * buffer);

View file

@ -1395,14 +1395,8 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
pThis->omx_report_error ();
} else {
/*Check if we need generate event for Flush done*/
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_INPUT_FLUSH_PENDING)) {
BITMASK_CLEAR (&pThis->m_flags,OMX_COMPONENT_INPUT_FLUSH_PENDING);
DEBUG_PRINT_LOW("Input Flush completed - Notify Client");
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
OMX_EventCmdComplete,OMX_CommandFlush,
OMX_CORE_INPUT_PORT_INDEX,NULL );
}
pThis->notify_flush_done(ctxt);
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_IDLE_PENDING)) {
if (pThis->stream_off(OMX_CORE_INPUT_PORT_INDEX)) {
@ -1436,14 +1430,8 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
pThis->omx_report_error ();
} else {
/*Check if we need generate event for Flush done*/
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_OUTPUT_FLUSH_PENDING)) {
DEBUG_PRINT_LOW("Notify Output Flush done");
BITMASK_CLEAR (&pThis->m_flags,OMX_COMPONENT_OUTPUT_FLUSH_PENDING);
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
OMX_EventCmdComplete,OMX_CommandFlush,
OMX_CORE_OUTPUT_PORT_INDEX,NULL );
}
pThis->notify_flush_done(ctxt);
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_OUTPUT_FLUSH_IN_DISABLE_PENDING)) {
DEBUG_PRINT_LOW("Internal flush complete");
@ -3281,6 +3269,37 @@ bool omx_vdec::execute_input_flush()
return bRet;
}
/*=========================================================================
FUNCTION : notify_flush_done
DESCRIPTION
Notifies flush done to the OMX Client.
PARAMETERS
ctxt -- Context information related to the self..
RETURN VALUE
NONE
==========================================================================*/
void omx_vdec::notify_flush_done(void *ctxt) {
omx_vdec *pThis = (omx_vdec *) ctxt;
if (!pThis->input_flush_progress && !pThis->output_flush_progress) {
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_OUTPUT_FLUSH_PENDING)) {
DEBUG_PRINT_LOW("Notify Output Flush done");
BITMASK_CLEAR (&pThis->m_flags,OMX_COMPONENT_OUTPUT_FLUSH_PENDING);
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
OMX_EventCmdComplete,OMX_CommandFlush,
OMX_CORE_OUTPUT_PORT_INDEX,NULL );
}
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_INPUT_FLUSH_PENDING)) {
BITMASK_CLEAR (&pThis->m_flags,OMX_COMPONENT_INPUT_FLUSH_PENDING);
DEBUG_PRINT_LOW("Input Flush completed - Notify Client");
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
OMX_EventCmdComplete,OMX_CommandFlush,
OMX_CORE_INPUT_PORT_INDEX,NULL );
}
}
}
/* ======================================================================
FUNCTION