Home | History | Annotate | Download | only in inc
      1 
      2 /*
      3  * Copyright (C) Texas Instruments - http://www.ti.com/
      4  *
      5  * This library is free software; you can redistribute it and/or
      6  * modify it under the terms of the GNU Lesser General Public
      7  * License as published by the Free Software Foundation; either
      8  * version 2.1 of the License, or (at your option) any later version.
      9  *
     10  *
     11  * This library is distributed in the hope that it will be useful,
     12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     14  * Lesser General Public License for more details.
     15  *
     16  *
     17  * You should have received a copy of the GNU Lesser General Public
     18  * License along with this library; if not, write to the Free Software
     19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     20  */
     21 /* =============================================================================
     22 *             Texas Instruments OMAP(TM) Platform Software
     23 *  (c) Copyright Texas Instruments, Incorporated.  All Rights Reserved.
     24 *
     25 *  Use of this software is controlled by the terms and conditions found
     26 *  in the license agreement under which this software has been supplied.
     27 * ============================================================================ */
     28 /**
     29 * @file OMX_WbAmrDecoder.h
     30 *
     31 * This is an header file for an audio PCM decoder that is fully
     32 * compliant with the OMX Audio specification.
     33 * This the file that the application that uses OMX would include
     34 * in its code.
     35 *
     36 * @path $(CSLPATH)\
     37 *
     38 * @rev 0.1
     39 */
     40 /* --------------------------------------------------------------------------- */
     41 
     42 #ifndef OMX_WBAMR_DECODER_H
     43 #define OMX_WBAMR_DECODER_H
     44 
     45 #include "LCML_DspCodec.h"
     46 #include <OMX_Component.h>
     47 #include <pthread.h>
     48 #include <OMX_TI_Debug.h>
     49 
     50 #ifdef __PERF_INSTRUMENTATION__
     51     #include "perf.h"
     52 #endif
     53 
     54 #ifndef UNDER_CE
     55 #ifdef DSP_RENDERING_ON
     56 #include <AudioManagerAPI.h>
     57 #endif
     58 
     59 #ifdef RESOURCE_MANAGER_ENABLED
     60 #include <ResourceManagerProxyAPI.h>
     61 #endif
     62 #endif
     63 
     64 #ifndef ANDROID
     65     #define ANDROID
     66 #endif
     67 
     68 #ifdef ANDROID
     69     #undef LOG_TAG
     70     #define LOG_TAG "OMX_WBAMRDEC"
     71 
     72 /* PV opencore capability custom parameter index */
     73     #define PV_OMX_COMPONENT_CAPABILITY_TYPE_INDEX 0xFF7A347
     74 #endif
     75 
     76 /* =======================================================================
     77  *
     78  ** Default timeout used to come out of blocking calls*
     79  *
     80  *
     81  ======================================================================= */
     82 #define WBAMR_DEC_TIMEOUT (1000) /* millisecs */
     83 
     84 /* ======================================================================= */
     85 /**
     86  * @def    NUM_WMADEC_INPUT_BUFFERS   Default number of input buffers
     87  *
     88  */
     89 /* ======================================================================= */
     90 #define NUM_WBAMRDEC_INPUT_BUFFERS 1
     91 /* ======================================================================= */
     92 /**
     93  * @def    NUM_WMADEC_OUTPUT_BUFFERS   Default number of output buffers
     94  *
     95  */
     96 /* ======================================================================= */
     97 #define NUM_WBAMRDEC_OUTPUT_BUFFERS 2
     98 /* ======================================================================= */
     99 /**
    100  * @def    NUM_WMADEC_OUTPUT_BUFFERS   Default number of output buffers DASF
    101  *
    102  */
    103 /* ======================================================================= */
    104 #define NUM_WBAMRDEC_OUTPUT_BUFFERS_DASF 2
    105 /* ======================================================================= */
    106 /**
    107  * @def    INPUT_WBAMRDEC_BUFFER_SIZE   Default input buffer size
    108  *
    109  */
    110 /* ======================================================================= */
    111 #define INPUT_WBAMRDEC_BUFFER_SIZE 116
    112 /* ======================================================================= */
    113 /**
    114  * @def    OUTPUT_WBAMRDEC_BUFFER_SIZE   Default output buffer size
    115  *
    116  */
    117 /* ======================================================================= */
    118 #define OUTPUT_WBAMRDEC_BUFFER_SIZE 640
    119 /* ======================================================================= */
    120 /**
    121  * @def    INPUT_WBAMRDEC_BUFFER_SIZE_MIME   Default input buffer size MIME
    122  *
    123  */
    124 /* ======================================================================= */
    125 #define INPUT_WBAMRDEC_BUFFER_SIZE_MIME 61
    126 
    127 /* ======================================================================= */
    128 /**
    129  * @def    WBAMR_DEC_STREAM_COUNT   Number of streams
    130  */
    131 /* ======================================================================= */
    132 #define WBAMR_DEC_STREAM_COUNT 2
    133 #define WBAMR_DEC_INPUT_STREAM_ID 0
    134 /* ======================================================================= */
    135 /**
    136  * @def    WBAMR_DEC_INPUT_BUFF_SIZE_EFR   Default input buffer size EFR
    137  *
    138  */
    139 /* ======================================================================= */
    140 #define WBAMR_DEC_INPUT_BUFF_SIZE_EFR 120
    141 
    142 /* ======================================================================= */
    143 /** WBAMR_DEC_COMP_PORT_TYPE  Port types
    144 *
    145 *  @param  WBAMR_DEC_INPUT_PORT                 Input port
    146 *
    147 *  @param  WBAMR_DEC_OUTPUT_PORT                Output port
    148 */
    149 /*  ==================================================================== */
    150 /*This enum must not be changed. */
    151 typedef enum WBAMR_DEC_COMP_PORT_TYPE {
    152     WBAMR_DEC_INPUT_PORT = 0,
    153     WBAMR_DEC_OUTPUT_PORT
    154 }WBAMR_DEC_COMP_PORT_TYPE;
    155 /* ======================================================================= */
    156 /**
    157  * @def    WBAMR_DEC_SAMPLING_FREQUENCY   Sampling frequency
    158  */
    159 /* ======================================================================= */
    160 #define WBAMR_DEC_SAMPLING_FREQUENCY 16000
    161 /* ======================================================================= */
    162 /**
    163  * @def    WBAMR_DEC_CPU_LOAD                    CPU Load in MHz
    164  */
    165 /* ======================================================================= */
    166 #define WBAMR_DEC_CPU_LOAD 10
    167 /* ======================================================================= */
    168 /**
    169  * @def    WBAMR_DEC_MAX_NUM_OF_BUFS   Maximum number of buffers
    170  */
    171 /* ======================================================================= */
    172 #define WBAMR_DEC_MAX_NUM_OF_BUFS 12
    173 /* ======================================================================= */
    174 /**
    175  * @def    IP_BUFFERSIZE                      Input Port Buffer Size
    176  */
    177 /* ======================================================================= */
    178 #define IP_WBAMRDEC_BUFFERSIZE 8192
    179 /* ======================================================================= */
    180 /**
    181  * @def    NUM_MIME_BYTES_ARRAY               amrMimeBytes array size
    182  */
    183 /* ======================================================================= */
    184 #define NUM_MIME_BYTES_ARRAY 16
    185 /* ======================================================================= */
    186 /**
    187  * @def    NUM_IF2_BYTES_ARRAY                amrIF2Bytes array size
    188  */
    189 /* ======================================================================= */
    190 #define NUM_IF2_BYTES_ARRAY 16
    191 
    192 /* ======================================================================= */
    193 /**
    194  * @def    WBAMR_DEC_DEBUG   Turns debug messaging on and off
    195  */
    196 /* ======================================================================= */
    197 #undef WBAMR_DEC_DEBUG
    198 /* ======================================================================= */
    199 /**
    200  * @def    WBAMR_DEC_MEMCHECK   Turns memory messaging on and off
    201  */
    202 /* ======================================================================= */
    203 #undef WBAMR_DEC_MEMCHECK
    204 
    205 /* ======================================================================= */
    206 /**
    207  * @def    WBAMRDEC_DEBUGMEM   Turns memory leaks messaging on and off.
    208  *         APP_DEBUGMEM must be defined in Test App in order to get
    209  *         this functionality On.
    210  */
    211 /* ======================================================================= */
    212 #undef WBAMRDEC_DEBUGMEM
    213 /*#define WBAMRDEC_DEBUGMEM*/
    214 
    215 
    216 #ifdef UNDER_CE
    217 #define sleep Sleep
    218 #endif
    219 
    220 /* ======================================================================= */
    221 /**
    222  * @def    WBAMR_DEC_NUM_OF_PORTS   Number of ports
    223  */
    224 /* ======================================================================= */
    225 #define WBAMR_DEC_NUM_OF_PORTS 2
    226 
    227 /* ======================================================================= */
    228 /**
    229  * @def    _ERROR_PROPAGATION__              Allow Logic to Detec Arm Errors
    230  */
    231 /* ======================================================================= */
    232 #define _ERROR_PROPAGATION__
    233 
    234 /* ======================================================================= */
    235 /** OMX_INDEXAUDIOTYPE_WBAMRDEC  Defines the custom configuration settings
    236 *                              for the component
    237 *
    238 *  @param  OMX_IndexCustomModeDasfConfig_WBAMRDEC  Sets the DASF mode
    239 *
    240 *  @param  OMX_IndexCustomModeAcdnConfig_WBAMRDEC  Sets the ACDN mode
    241 *
    242 *  @param  OMX_IndexCustomModeMimeConfig_WBAMRDEC  Sets the MIME mode
    243 */
    244 /*  ==================================================================== */
    245 typedef enum OMX_INDEXAUDIOTYPE_WBAMRDEC {
    246     OMX_IndexCustomModeEfrConfig_WBAMRDEC = 0xFF000001,
    247     OMX_IndexCustomModeAmrConfig_WBAMRDEC,
    248     OMX_IndexCustomModeAcdnConfig_WBAMRDEC,
    249     OMX_IndexCustomModeDasfConfig_WBAMRDEC,
    250     OMX_IndexCustomModeMimeConfig_WBAMRDEC,
    251     OMX_IndexCustomWbAmrDecHeaderInfoConfig,
    252     OMX_IndexCustomWbAmrDecStreamIDConfig,
    253     OMX_IndexCustomWbAmrDecDataPath,
    254     OMX_IndexCustomWbAmrDecNextFrameLost,
    255     OMX_IndexCustomDebug
    256 }OMX_INDEXAUDIOTYPE_WBAMRDEC;
    257 
    258 /* ======================================================================= */
    259 /**
    260  * pthread variable to indicate OMX returned all buffers to app
    261  */
    262 /* ======================================================================= */
    263 pthread_mutex_t bufferReturned_mutex;
    264 pthread_cond_t bufferReturned_condition;
    265 
    266 /* ======================================================================= */
    267 /** WBAMR_DEC_StreamType  Stream types
    268 *
    269 *  @param  WBAMR_DEC_DMM                    DMM
    270 *
    271 *  @param  WBAMR_DEC_INSTRM                 Input stream
    272 *
    273 *  @param  WBAMR_DEC_OUTSTRM                Output stream
    274 */
    275 /*  ==================================================================== */
    276 enum WBAMR_DEC_StreamType
    277 {
    278     WBAMR_DEC_DMM,
    279     WBAMR_DEC_INSTRM,
    280     WBAMR_DEC_OUTSTRM
    281 };
    282 
    283 enum WBAMR_DEC_DecodeType
    284 {
    285     WBAMR,
    286     WBAMR_EFR
    287 };
    288 
    289 /* ======================================================================= */
    290 /** WBAMR_DEC_MimeMode  Stream types
    291 *
    292 *  @param  WBAMR_DEC_MIMEMODE                   MIME
    293 *
    294 *  @param  WBAMR_DEC_NONMIMEMODE                NON MIME
    295 *
    296 */
    297 /*  ====================================================================== */
    298 enum WBAMR_DEC_MimeMode {
    299     WBAMR_DEC_NONMIMEMODE,
    300     WBAMR_DEC_MIMEMODE
    301 };
    302 
    303 /* ======================================================================= */
    304 /** WBAMR_DEC_BUFFER_Dir  Buffer Direction
    305 *
    306 *  @param  WBAMR_DEC_DIRECTION_INPUT                    INPUT
    307 *
    308 *  @param  WBAMR_DEC_DIRECTION_OUTPUT                   OUTPUT
    309 *
    310 */
    311 /*  ====================================================================== */
    312 typedef enum {
    313     WBAMR_DEC_DIRECTION_INPUT,
    314     WBAMR_DEC_DIRECTION_OUTPUT
    315 }WBAMR_DEC_BUFFER_Dir;
    316 
    317 typedef struct WBAMR_DEC_BUFFS
    318 {
    319     char WBAMR_DEC_BufHeader;
    320     char WBAMR_DEC_Buffer;
    321 }WBAMR_DEC_BUFFS;
    322 
    323 /* ======================================================================= */
    324 /** WBAMR_DEC_BUFFERHEADERTYPE_INFO
    325 *
    326 *  @param  pBufHeader
    327 *
    328 *  @param  bBufOwner
    329 *
    330 */
    331 /*  ==================================================================== */
    332 typedef struct WBAMR_DEC_BUFFERHEADERTYPE_INFO
    333 {
    334     OMX_BUFFERHEADERTYPE* pBufHeader[WBAMR_DEC_MAX_NUM_OF_BUFS];
    335     WBAMR_DEC_BUFFS bBufOwner[WBAMR_DEC_MAX_NUM_OF_BUFS];
    336 }WBAMR_DEC_BUFFERHEADERTYPE_INFO;
    337 
    338 /* ======================================================================= */
    339 /** WBAMR_DEC_LCML_MimeMode  Stream types
    340 *
    341 *  @param  WBAMR_DEC_MODE_MIME                  MIME
    342 *
    343 *  @param  WBAMR_DEC_MODE_NONMIME               NON MIME
    344 *
    345 */
    346 /*  ==================================================================== */
    347 typedef enum {
    348     WBAMR_DEC_MODE_MIME,
    349     WBAMR_DEC_MODE_NONMIME
    350 }WBAMR_DEC_LCML_MimeMode;
    351 
    352 /* =================================================================================== */
    353 /**
    354 * Socket node input parameters.
    355 */
    356 /* ================================================================================== */
    357 typedef struct WBAMR_DEC_AudioCodecParams
    358 {
    359     unsigned long  iSamplingRate;
    360     unsigned long  iStrmId;
    361     unsigned short iAudioFormat;
    362 
    363 }WBAMR_DEC_AudioCodecParams;
    364 
    365 /* =================================================================================== */
    366 /**
    367 * Socket node alg parameters.
    368 */
    369 /* ================================================================================== */
    370 typedef struct {
    371         unsigned long int usLastFrame;
    372         unsigned long int usFrameLost;
    373 }WAMRDEC_FrameStruct;
    374 
    375 typedef struct{
    376          unsigned long int usNbFrames;
    377          WAMRDEC_FrameStruct *pParamElem;
    378 }WBAMRDEC_ParamStruct;
    379 
    380 /* =================================================================================== */
    381 /**
    382 * WBAMR Buffer Header Type
    383 */
    384 /* ================================================================================== */
    385 typedef struct LCML_WBAMR_DEC_BUFHEADERTYPE {
    386       WBAMR_DEC_BUFFER_Dir eDir;
    387       OMX_BUFFERHEADERTYPE* buffer;
    388       WAMRDEC_FrameStruct *pFrameParam;
    389       WBAMRDEC_ParamStruct *pBufferParam;
    390       DMM_BUFFER_OBJ* pDmmBuf;
    391 }LCML_WBAMR_DEC_BUFHEADERTYPE;
    392 
    393 #ifndef UNDER_CE
    394 
    395 OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE hComp);
    396 
    397 #else
    398 /*  WinCE Implicit Export Syntax */
    399 #define OMX_EXPORT __declspec(dllexport)
    400 /* ===========================================================  */
    401 /**
    402 *  OMX_ComponentInit()  Initializes component
    403 *
    404 *
    405 *  @param hComp         OMX Handle
    406 *
    407 *  @return OMX_ErrorNone = Successful
    408 *          Other error code = fail
    409 *
    410 */
    411 /*================================================================== */
    412 OMX_EXPORT OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE hComp);
    413 
    414 #endif
    415 
    416 /* =================================================================================== */
    417 /**
    418 * Instrumentation info
    419 */
    420 /* ================================================================================== */
    421 
    422 typedef struct WBAMRDEC_BUFFERLIST WBAMR_DEC_BUFFERLIST;
    423 
    424 /* =================================================================================== */
    425 /**
    426 * Structure for buffer list
    427 */
    428 /* ================================================================================== */
    429 struct WBAMRDEC_BUFFERLIST{
    430     OMX_BUFFERHEADERTYPE *pBufHdr[WBAMR_DEC_MAX_NUM_OF_BUFS];   /* records buffer header send by client */
    431     OMX_U32 bufferOwner[WBAMR_DEC_MAX_NUM_OF_BUFS];
    432     OMX_U32 bBufferPending[WBAMR_DEC_MAX_NUM_OF_BUFS];
    433     OMX_U16 numBuffers;
    434 };
    435 #ifdef UNDER_CE
    436     #ifndef _OMX_EVENT_
    437         #define _OMX_EVENT_
    438         typedef struct OMX_Event {
    439             HANDLE event;
    440         } OMX_Event;
    441     #endif
    442 #endif
    443 
    444 typedef struct PV_OMXComponentCapabilityFlagsType
    445 {
    446         ////////////////// OMX COMPONENT CAPABILITY RELATED MEMBERS (for opencore compatability)
    447         OMX_BOOL iIsOMXComponentMultiThreaded;
    448         OMX_BOOL iOMXComponentSupportsExternalOutputBufferAlloc;
    449         OMX_BOOL iOMXComponentSupportsExternalInputBufferAlloc;
    450         OMX_BOOL iOMXComponentSupportsMovableInputBuffers;
    451         OMX_BOOL iOMXComponentSupportsPartialFrames;
    452         OMX_BOOL iOMXComponentNeedsNALStartCode;
    453         OMX_BOOL iOMXComponentCanHandleIncompleteFrames;
    454 } PV_OMXComponentCapabilityFlagsType;
    455 
    456 
    457 /* =================================================================================== */
    458 /*
    459  * NBAMRDEC_BUFDATA
    460  */
    461 /* =================================================================================== */
    462 typedef struct WBAMRDEC_BUFDATA {
    463    OMX_U8 nFrames;
    464 }WBAMRDEC_BUFDATA;
    465 
    466 
    467 /* =================================================================================== */
    468 /**
    469 * Component private data
    470 */
    471 /* ================================================================================== */
    472 typedef struct WBAMR_DEC_COMPONENT_PRIVATE
    473 {
    474 #ifdef __PERF_INSTRUMENTATION__
    475     PERF_OBJHANDLE pPERF, pPERFcomp;
    476     OMX_U32 nLcml_nCntIp;
    477     OMX_U32 nLcml_nCntOpReceived;
    478 #endif
    479     /** Array of pointers to BUFFERHEADERTYPE structues
    480        This pBufHeader[WBAMR_DEC_INPUT_PORT] will point to all the
    481        BUFFERHEADERTYPE structures related to input port,
    482        not just one structure. Same is for output port
    483        also. */
    484 
    485     OMX_BUFFERHEADERTYPE* pBufHeader[WBAMR_DEC_NUM_OF_PORTS];
    486 
    487     /** Number of input buffers at runtime */
    488     OMX_U32 nRuntimeInputBuffers;
    489 
    490     WBAMR_DEC_BUFFERHEADERTYPE_INFO BufInfo[WBAMR_DEC_NUM_OF_PORTS];
    491 
    492     OMX_CALLBACKTYPE cbInfo;
    493     /** Handle for use with async callbacks */
    494 
    495     OMX_PORT_PARAM_TYPE sPortParam;
    496     OMX_AUDIO_PARAM_PORTFORMATTYPE sInPortFormat;
    497     OMX_AUDIO_PARAM_PORTFORMATTYPE sOutPortFormat;
    498 
    499     /** This will contain info like how many buffers
    500         are there for input/output ports, their size etc, but not
    501         BUFFERHEADERTYPE POINTERS. */
    502     OMX_PARAM_PORTDEFINITIONTYPE* pPortDef[WBAMR_DEC_NUM_OF_PORTS];
    503     OMX_AUDIO_PARAM_AMRTYPE* wbamrParams[WBAMR_DEC_NUM_OF_PORTS];
    504 
    505     /** This is component handle */
    506     OMX_COMPONENTTYPE* pHandle;
    507 
    508     /** Current state of this component */
    509     OMX_STATETYPE curState;
    510 
    511     /** The component thread handle */
    512     pthread_t WBAMR_DEC_ComponentThread;
    513 
    514     /** The pipes for sending buffers to the thread */
    515     int dataPipe[2];
    516 
    517     /** The pipes for sending buffers to the thread */
    518     int cmdPipe[2];
    519 
    520     /** The pipes for sending buffers to the thread */
    521     int cmdDataPipe[2];
    522 
    523     /** The pipes for sending buffers to the thread */
    524   /*  int lcml_Pipe[2]; */
    525 
    526     /** Set to indicate component is stopping */
    527     OMX_U32 bIsStopping;
    528 
    529     /** Count of number of buffers outstanding with bridge */
    530     OMX_U32 lcml_nIpBuf;
    531 
    532     /** Count of number of buffers outstanding with bridge */
    533     OMX_U32 lcml_nOpBuf;
    534 
    535     OMX_U32 app_nBuf;
    536     OMX_U32 wbamrIf2Bytes[NUM_IF2_BYTES_ARRAY];                        /*Array With IF2 Lenght Information*/
    537     OMX_U32 lcml_nCntIp;
    538     OMX_U32 lcml_nCntOpReceived;
    539     OMX_U32 num_Reclaimed_Op_Buff;
    540 
    541     OMX_HANDLETYPE pLcmlHandle;
    542     LCML_WBAMR_DEC_BUFHEADERTYPE *pLcmlBufHeader[2];
    543     OMX_U32 iAmrMimeFlag;
    544     OMX_U32 iAmrSamplingFrequeny;
    545     OMX_U32 iAmrChannels;
    546     OMX_U32 iAmrMode;
    547     OMX_U32 dasfmode;
    548     OMX_U32 mimemode;
    549     OMX_U32 acdnmode;
    550     OMX_U32 fdwrite;
    551     OMX_U32 fdread;
    552     OMX_U32 streamID;
    553 
    554     OMX_U32 bPortDefsAllocated;
    555     OMX_U32 bCompThreadStarted;
    556     OMX_PTR pMarkData;
    557     OMX_MARKTYPE *pMarkBuf;
    558     OMX_HANDLETYPE hMarkTargetComponent;
    559     WBAMR_DEC_BUFFERLIST *pInputBufferList;
    560     WBAMR_DEC_BUFFERLIST *pOutputBufferList;
    561     LCML_STRMATTR *strmAttr;
    562     OMX_U32 nVersion;
    563     OMX_U32 wbamrMimeBytes[NUM_MIME_BYTES_ARRAY];
    564     OMX_U32 nHoldLength;
    565     OMX_U8* pHoldBuffer;
    566     OMX_U32 bLcmlHandleOpened;
    567     OMX_U32 nFillThisBufferCount;
    568     OMX_U32 nFillBufferDoneCount;
    569     OMX_U32 nEmptyThisBufferCount;
    570     OMX_U32 nEmptyBufferDoneCount;
    571     WBAMR_DEC_AudioCodecParams *pParams;
    572     OMX_U32 bInitParamsInitialized;
    573  /*     OMX_U32 bIdleCommandPending; */
    574     OMX_BUFFERHEADERTYPE *pInputBufHdrPending[WBAMR_DEC_MAX_NUM_OF_BUFS];
    575     OMX_U32 nNumInputBufPending;
    576     OMX_BUFFERHEADERTYPE *pOutputBufHdrPending[WBAMR_DEC_MAX_NUM_OF_BUFS];
    577     OMX_U32 nNumOutputBufPending;
    578     OMX_U32 bDisableCommandPending;
    579     OMX_U32 bEnableCommandPending;
    580     OMX_U32 bDisableCommandParam;
    581     OMX_U32 bEnableCommandParam;
    582 
    583     /** Flag to set when socket node stop callback should not transition
    584         component to OMX_StateIdle */
    585     OMX_U32 bNoIdleOnStop;
    586 
    587     /** Flag set when socket node is stopped */
    588     OMX_U32 bDspStoppedWhileExecuting;
    589 
    590     /** Number of outstanding FillBufferDone() calls */
    591     OMX_S32 nOutStandingFillDones;
    592 
    593     /** Stop Codec Command Sent Flag*/
    594     OMX_U8 bStopSent;
    595 
    596 #ifndef UNDER_CE
    597     pthread_mutex_t AlloBuf_mutex;
    598     pthread_cond_t AlloBuf_threshold;
    599     OMX_U8 AlloBuf_waitingsignal;
    600 
    601     pthread_mutex_t codecStop_mutex;
    602     pthread_cond_t codecStop_threshold;
    603     OMX_U8 codecStop_waitingsignal;
    604 
    605     pthread_mutex_t InLoaded_mutex;
    606     pthread_cond_t InLoaded_threshold;
    607     OMX_U8 InLoaded_readytoidle;
    608 
    609     pthread_mutex_t InIdle_mutex;
    610     pthread_cond_t InIdle_threshold;
    611     OMX_U8 InIdle_goingtoloaded;
    612 
    613     OMX_S8 nUnhandledFillThisBuffers;
    614     OMX_S8 nUnhandledEmptyThisBuffers;
    615     OMX_BOOL bFlushOutputPortCommandPending;
    616     OMX_BOOL bFlushInputPortCommandPending;
    617 #else
    618     OMX_Event AlloBuf_event;
    619     OMX_U8 AlloBuf_waitingsignal;
    620 
    621     OMX_Event InLoaded_event;
    622     OMX_U8 InLoaded_readytoidle;
    623 
    624     OMX_Event InIdle_event;
    625     OMX_U8 InIdle_goingtoloaded;
    626 #endif
    627     OMX_U16 nRuntimeOutputBuffers;
    628 
    629     OMX_U8 PendingPausedBufs;
    630     OMX_BUFFERHEADERTYPE *pOutputBufHdrPausedPending[WBAMR_DEC_MAX_NUM_OF_BUFS];
    631 
    632     OMX_BUFFERHEADERTYPE *LastOutbuf;
    633 
    634     OMX_BOOL bIsInvalidState;
    635     OMX_STRING* sDeviceString;
    636 
    637     void* ptrLibLCML;
    638 
    639     /** Circular array to keep buffer timestamps */
    640     OMX_S64 arrBufIndex[WBAMR_DEC_MAX_NUM_OF_BUFS];
    641     /** Circular array to keep buffer nTickCounts */
    642     OMX_S64 arrTickCount[WBAMR_DEC_MAX_NUM_OF_BUFS];
    643     /** Index to arrBufIndex[], used for input buffer timestamps */
    644     OMX_U8 IpBufindex;
    645     /** Index to arrBufIndex[], used for output buffer timestamps */
    646     OMX_U8 OpBufindex;
    647 
    648     /** Flag to flush SN after EOS in order to process more buffers after EOS**/
    649     OMX_U8 SendAfterEOS;
    650 
    651     OMX_BOOL bLoadedCommandPending;
    652 
    653     OMX_PARAM_COMPONENTROLETYPE componentRole;
    654 
    655     /** Pointer to port priority management structure */
    656     OMX_PRIORITYMGMTTYPE* pPriorityMgmt;
    657 
    658 #ifdef RESOURCE_MANAGER_ENABLED
    659     RMPROXY_CALLBACKTYPE rmproxyCallback;
    660 #endif
    661 
    662     OMX_BOOL bPreempted;
    663     OMX_BOOL bFrameLost;
    664 
    665     /** Flag to mark RTSP**/
    666     OMX_U8 using_rtsp;
    667 
    668     PV_OMXComponentCapabilityFlagsType iPVCapabilityFlags;
    669 
    670     struct OMX_TI_Debug dbg;
    671 
    672 } WBAMR_DEC_COMPONENT_PRIVATE;
    673 
    674 /*=======================================================================*/
    675 /*! @fn SignalIfAllBuffersAreReturned
    676 
    677  * @brief Sends pthread signal to indicate OMX has returned all buffers to app
    678 
    679  * @param  none
    680 
    681  * @Return void
    682 
    683  */
    684 /*=======================================================================*/
    685 void SignalIfAllBuffersAreReturned(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate);
    686 
    687 #endif /* OMX_WBAMR_DECODER_H */
    688