mm-audio: aenc: Fix VTS failures for encoders
VTS does not expect Input/Output omx port to send OMX_EventCmdComplete.
The fix is to avoid sending OMX_EventCmdComplete. VTS will timeout and
handle the error properly.
Change-Id: I998cf2e4b9e4ecba9e9837e56683bf44cc57207b
CRs-Fixed: 2077073
diff --git a/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h b/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h
index 7f0a2cb..374611a 100644
--- a/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h
+++ b/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2014, 2017, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -579,7 +579,9 @@
bool release_done(OMX_U32 param1);
- bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=true);
+ // cmd_cmpl=false by default.OMX_EventCmdComplete not sent back to handler
+ // cmd_cmpl=true only when flush executed by OMX_CommandFlush
+ bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=false);
bool execute_input_omx_flush(void);
diff --git a/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp b/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp
index 95e5168..ca6bb6e 100644
--- a/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp
+++ b/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp
@@ -1628,9 +1628,9 @@
{
DEBUG_PRINT("SCP-->Executing to Idle \n");
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if (OMX_StatePause == eState)
@@ -1704,9 +1704,9 @@
m_flush_cnt = 2;
pthread_mutex_unlock(&m_flush_lock);
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if ( eState == OMX_StateLoaded )
{
@@ -1826,7 +1826,7 @@
param1 == OMX_CORE_OUTPUT_PORT_INDEX ||
(signed)param1 == -1 )
{
- execute_omx_flush(param1);
+ execute_omx_flush(param1,true);
} else
{
eRet = OMX_ErrorBadPortIndex;
@@ -4466,9 +4466,9 @@
m_state);
// Get back any buffers from driver
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
// force state change to loaded so that all threads can be exited
pthread_mutex_lock(&m_state_lock);
m_state = OMX_StateLoaded;
diff --git a/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h b/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h
index 64d997b..8236c03 100644
--- a/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h
+++ b/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010,2014 The Linux Foundation. All rights reserved.
+Copyright (c) 2010,2014,2017 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -503,7 +503,9 @@
bool release_done(OMX_U32 param1);
- bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=true);
+ // cmd_cmpl=false by default.OMX_EventCmdComplete not sent back to handler
+ // cmd_cmpl=true only when flush executed by OMX_CommandFlush
+ bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=false);
bool execute_input_omx_flush(void);
diff --git a/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp b/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp
index f9ce126..5532515 100644
--- a/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp
+++ b/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp
@@ -1615,9 +1615,9 @@
{
DEBUG_PRINT("SCP-->Executing to Idle \n");
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if (OMX_StatePause == eState)
@@ -1691,9 +1691,9 @@
m_flush_cnt = 2;
pthread_mutex_unlock(&m_flush_lock);
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if ( eState == OMX_StateLoaded )
{
@@ -1813,7 +1813,7 @@
param1 == OMX_CORE_OUTPUT_PORT_INDEX ||
(signed)param1 == -1 )
{
- execute_omx_flush(param1);
+ execute_omx_flush(param1,true);
} else
{
eRet = OMX_ErrorBadPortIndex;
@@ -4343,9 +4343,9 @@
m_state);
// Get back any buffers from driver
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
// force state change to loaded so that all threads can be exited
pthread_mutex_lock(&m_state_lock);
m_state = OMX_StateLoaded;
diff --git a/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h b/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
index f107789..6b2f1f9 100644
--- a/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
+++ b/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010,2014 The Linux Foundation. All rights reserved.
+Copyright (c) 2010,2014,2017 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -498,7 +498,9 @@
bool release_done(OMX_U32 param1);
- bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=true);
+ // cmd_cmpl=false by default.OMX_EventCmdComplete not sent back to handler
+ // cmd_cmpl=true only when flush executed by OMX_CommandFlush
+ bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=false);
bool execute_input_omx_flush(void);
diff --git a/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp b/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
index fc9d1fa..e8fb733 100644
--- a/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
+++ b/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
@@ -1543,9 +1543,9 @@
{
DEBUG_PRINT("SCP-->Executing to Idle \n");
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if (OMX_StatePause == eState)
@@ -1619,9 +1619,9 @@
m_flush_cnt = 2;
pthread_mutex_unlock(&m_flush_lock);
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if ( eState == OMX_StateLoaded )
{
@@ -1741,7 +1741,7 @@
param1 == OMX_CORE_OUTPUT_PORT_INDEX ||
(signed)param1 == -1 )
{
- execute_omx_flush(param1);
+ execute_omx_flush(param1,true);
} else
{
eRet = OMX_ErrorBadPortIndex;
@@ -4296,9 +4296,9 @@
m_state);
// Get back any buffers from driver
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
// force state change to loaded so that all threads can be exited
pthread_mutex_lock(&m_state_lock);
m_state = OMX_StateLoaded;
diff --git a/mm-audio/aenc-g711/qdsp6/inc/omx_g711_aenc.h b/mm-audio/aenc-g711/qdsp6/inc/omx_g711_aenc.h
index 9f91299..4c8be66 100644
--- a/mm-audio/aenc-g711/qdsp6/inc/omx_g711_aenc.h
+++ b/mm-audio/aenc-g711/qdsp6/inc/omx_g711_aenc.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, 2014, 2016 The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2014, 2016-2017 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -498,7 +498,9 @@
bool release_done(OMX_U32 param1);
- bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=true);
+ // cmd_cmpl=false by default.OMX_EventCmdComplete not sent back to handler
+ // cmd_cmpl=true only when flush executed by OMX_CommandFlush
+ bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=false);
bool execute_input_omx_flush(void);
diff --git a/mm-audio/aenc-g711/qdsp6/src/omx_g711_aenc.cpp b/mm-audio/aenc-g711/qdsp6/src/omx_g711_aenc.cpp
index 69ab0a4..6f94e58 100644
--- a/mm-audio/aenc-g711/qdsp6/src/omx_g711_aenc.cpp
+++ b/mm-audio/aenc-g711/qdsp6/src/omx_g711_aenc.cpp
@@ -1574,9 +1574,9 @@
{
OMX_LOGV("SCP-->Executing to Idle \n");
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if (OMX_StatePause == eState)
@@ -1650,9 +1650,9 @@
m_flush_cnt = 2;
pthread_mutex_unlock(&m_flush_lock);
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if ( eState == OMX_StateLoaded )
{
@@ -1771,7 +1771,7 @@
param1 == OMX_CORE_OUTPUT_PORT_INDEX ||
(signed)param1 == -1 )
{
- execute_omx_flush(param1);
+ execute_omx_flush(param1,true);
} else
{
eRet = OMX_ErrorBadPortIndex;
@@ -4303,9 +4303,9 @@
m_state);
// Get back any buffers from driver
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
// force state change to loaded so that all threads can be exited
pthread_mutex_lock(&m_state_lock);
m_state = OMX_StateLoaded;
diff --git a/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h b/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h
index 83e129c..4416e00 100644
--- a/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h
+++ b/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2014, 2017 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -498,7 +498,9 @@
bool release_done(OMX_U32 param1);
- bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=true);
+ // cmd_cmpl=false by default.OMX_EventCmdComplete not sent back to handler
+ // cmd_cmpl=true only when flush executed by OMX_CommandFlush
+ bool execute_omx_flush(OMX_IN OMX_U32 param1, bool cmd_cmpl=false);
bool execute_input_omx_flush(void);
diff --git a/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp b/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp
index 6e6a360..6cdf8e6 100644
--- a/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp
+++ b/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp
@@ -1539,9 +1539,9 @@
{
DEBUG_PRINT("SCP-->Executing to Idle \n");
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if (OMX_StatePause == eState)
@@ -1615,9 +1615,9 @@
m_flush_cnt = 2;
pthread_mutex_unlock(&m_flush_lock);
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
} else if ( eState == OMX_StateLoaded )
{
@@ -1737,7 +1737,7 @@
param1 == OMX_CORE_OUTPUT_PORT_INDEX ||
(signed)param1 == -1 )
{
- execute_omx_flush(param1);
+ execute_omx_flush(param1,true);
} else
{
eRet = OMX_ErrorBadPortIndex;
@@ -4296,9 +4296,9 @@
m_state);
// Get back any buffers from driver
if(pcm_input)
- execute_omx_flush(-1,false);
+ execute_omx_flush(-1);
else
- execute_omx_flush(1,false);
+ execute_omx_flush(1);
// force state change to loaded so that all threads can be exited
pthread_mutex_lock(&m_state_lock);
m_state = OMX_StateLoaded;