Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93ec5ef4 authored by Aniket Kumar Lata's avatar Aniket Kumar Lata Committed by Arne Coucheron
Browse files

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
parent 72547b93
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/*--------------------------------------------------------------------------
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);

+7 −7
Original line number Diff line number Diff line
@@ -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;
+4 −2
Original line number Diff line number Diff line
/*--------------------------------------------------------------------------

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);

+7 −7
Original line number Diff line number Diff line
@@ -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;
+4 −2
Original line number Diff line number Diff line
/*--------------------------------------------------------------------------
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);

Loading