diff options
author | Aniket Kumar Lata <alata@codeaurora.org> | 2017-07-14 16:19:43 -0700 |
---|---|---|
committer | Shiv Maliyappanahalli <smaliyap@codeaurora.org> | 2017-07-27 12:21:48 -0700 |
commit | 010009d1c1ffaebddef733e41f97739a2df77de5 (patch) | |
tree | 448e8701fc3da2aecf39db64fa15dd1578aae036 /mm-audio | |
parent | 31b530e05331742168f0c5e1d3c93dcdc19789d9 (diff) | |
download | hardware_qcom_audio-010009d1c1ffaebddef733e41f97739a2df77de5.tar.gz hardware_qcom_audio-010009d1c1ffaebddef733e41f97739a2df77de5.tar.bz2 hardware_qcom_audio-010009d1c1ffaebddef733e41f97739a2df77de5.zip |
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
Diffstat (limited to 'mm-audio')
-rw-r--r-- | mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h | 6 | ||||
-rw-r--r-- | mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp | 14 | ||||
-rw-r--r-- | mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h | 6 | ||||
-rw-r--r-- | mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp | 14 | ||||
-rw-r--r-- | mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h | 6 | ||||
-rw-r--r-- | mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp | 14 | ||||
-rw-r--r-- | mm-audio/aenc-g711/qdsp6/inc/omx_g711_aenc.h | 6 | ||||
-rw-r--r-- | mm-audio/aenc-g711/qdsp6/src/omx_g711_aenc.cpp | 14 | ||||
-rw-r--r-- | mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h | 6 | ||||
-rw-r--r-- | mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp | 14 |
10 files changed, 55 insertions, 45 deletions
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 7f0a2cb2..374611a9 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 @@ private: 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 95e51682..ca6bb6e3 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 @@ OMX_ERRORTYPE omx_aac_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, { 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 @@ OMX_ERRORTYPE omx_aac_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ OMX_ERRORTYPE omx_aac_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ void omx_aac_aenc::deinit_encoder() 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 64d997bc..8236c031 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 @@ private: 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 f9ce126a..5532515f 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 @@ OMX_ERRORTYPE omx_amr_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, { 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 @@ OMX_ERRORTYPE omx_amr_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ OMX_ERRORTYPE omx_amr_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ void omx_amr_aenc::deinit_encoder() 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 f1077899..6b2f1f93 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 @@ private: 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 fc9d1fa4..e8fb733f 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 @@ OMX_ERRORTYPE omx_evrc_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, { 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 @@ OMX_ERRORTYPE omx_evrc_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ OMX_ERRORTYPE omx_evrc_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ void omx_evrc_aenc::deinit_encoder() 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 9f912995..4c8be66a 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 @@ private: 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 69ab0a44..6f94e585 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_ERRORTYPE omx_g711_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, { 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 @@ OMX_ERRORTYPE omx_g711_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ OMX_ERRORTYPE omx_g711_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ void omx_g711_aenc::deinit_encoder() 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 83e129ce..4416e007 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 @@ private: 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 6e6a360a..6cdf8e6b 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 @@ OMX_ERRORTYPE omx_qcelp13_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, { 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 @@ OMX_ERRORTYPE omx_qcelp13_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ OMX_ERRORTYPE omx_qcelp13_aenc::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, 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 @@ void omx_qcelp13_aenc::deinit_encoder() 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; |