summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-08-04 10:49:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-08-04 10:49:57 +0000
commitf317b501353b02968a8c38c79649a9eaa2e9d667 (patch)
tree9551b53c57aebc99248cb16418d70befc15cdf54
parent79d5f68936b36fd9537912850c7694a4aa331f57 (diff)
parent55c628ce14006f410eb26a0de4c082d1c9eb2f3d (diff)
downloadmedia-oreo-dr1-dev.tar.gz
Merge "mm-video-v4l2: vdec: change notify flush done to client" into oc-dr1-devoreo-dr1-dev
-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