summaryrefslogtreecommitdiff
path: root/msm8998
diff options
context:
space:
mode:
authorSanthosh Behara <santhoshbehara@codeaurora.org>2017-07-13 20:37:25 +0530
committerZhuoyao Zhang <zhuoyao@google.com>2017-08-04 00:49:42 +0000
commit55c628ce14006f410eb26a0de4c082d1c9eb2f3d (patch)
treeda1beda3429e3b6880f307a8c4f38d986b39a56f /msm8998
parent6d288d5fac25c31d99d15c9368443e5e9b0454c4 (diff)
downloadmedia-55c628ce14006f410eb26a0de4c082d1c9eb2f3d.tar.gz
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 vts vts-tradefed run vts -m VtsHalMediaOmxV1_0Host Bug: 63603864 Change-Id: I3c66a0b1853d598574fc19707da580bb88666b11
Diffstat (limited to 'msm8998')
-rw-r--r--msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h1
-rw-r--r--msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp56
2 files changed, 41 insertions, 16 deletions
diff --git a/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
index b3f9140..71dfc5a 100644
--- a/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
+++ b/msm8998/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
@@ -675,6 +675,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);
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 13e8e36..52905d0 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
@@ -1584,14 +1584,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)) {
@@ -1625,14 +1619,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");
@@ -3504,6 +3492,42 @@ 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