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_G729Decoder.h
30 *
31 * This header file contains data and function prototypes for G729 DECODER OMX
32 *
33 * @path  $(OMAPSW_MPU)\linux\audio\src\openmax_il\g729_dec\inc
34 *
35 * @rev  0.3
36 */
37/* -----------------------------------------------------------------------------
38 *!
39 *! Revision History
40 *! ===================================
41 *! Date         Author(s)            Version  Description
42 *! ---------    -------------------  -------  ---------------------------------
43 *! 03-Jan-2007  A.Donjon             0.1      Code update for G729 DECODER
44 *! 16-Feb-2007  A.Donjon             0.2      Frame Lost
45 *! 08-Jun-2007  A.Donjon             0.3      Variable input buffer size
46 *!
47 *!
48 * ================================================================================= */
49/* ------compilation control switches -------------------------*/
50#ifndef OMX_G729DECODER_H
51#define OMX_G729DECODER_H
52
53#include <LCML_DspCodec.h>
54#include <OMX_Component.h>
55#include <pthread.h>
56
57#ifdef RESOURCE_MANAGER_ENABLED
58#include <ResourceManagerProxyAPI.h>
59#endif
60
61#ifdef __PERF_INSTRUMENTATION__
62#include "perf.h"
63#endif
64
65#undef G729DEC_PRINT
66#undef G729DEC_DEBUG
67#undef G729DEC_MEMCHECK
68
69/* ======================================================================= */
70/**
71 * @def    G729D_TIMEOUT   Default timeout used to come out of blocking calls
72 */
73/* ======================================================================= */
74#define G729D_TIMEOUT (1000) /* millisecs */
75
76
77/* ======================================================================= */
78/**
79 * @def    NUM_G729DEC_INPUT_BUFFERS              Number of Input Buffers
80 */
81/* ======================================================================= */
82#define NUM_G729DEC_INPUT_BUFFERS 1
83
84/* ======================================================================= */
85/**
86 * @def    NUM_G729DEC_OUTPUT_BUFFERS              Number of Output Buffers
87 */
88/* ======================================================================= */
89#define NUM_G729DEC_OUTPUT_BUFFERS 1
90
91/* ======================================================================= */
92/**
93 * @def    G729DEC_PACKETS_PER_BUFFER             Number of PACKETS PER BUFFER
94 */
95/* ======================================================================= */
96#define G729DEC_PACKETS_PER_BUFFER 1
97
98/* ======================================================================= */
99/**
100 * @def    NUM_G729DEC_OUTPUT_BUFFERS_DASF         Number of Output Buffers
101 *                                                  in DASF mode
102 */
103/* ======================================================================= */
104#define NUM_G729DEC_OUTPUT_BUFFERS_DASF 2
105
106/* ======================================================================= */
107/**
108 * @def    INPUT_G729DEC_BUFFER_SIZE             Standart Input Buffer Size
109 *                                                (1 packet)
110 */
111/* ======================================================================= */
112#define INPUT_G729DEC_BUFFER_SIZE_MIN 11
113
114/* ======================================================================= */
115/**
116 * @def    OUTPUT_G729DEC_BUFFER_SIZE           Standart Output Buffer Size
117 *                                               (1 frame)
118 */
119/* ======================================================================= */
120#define OUTPUT_G729DEC_BUFFER_SIZE_MIN 80<<1
121
122/* ======================================================================= */
123/**
124 * @def    G729DEC_SHIFT_OFFSET           Shift Amount to move low 8 bits to high 8 bits in 32 bit field
125 */
126/* ======================================================================= */
127#define G729DEC_SHIFT_OFFSET 24
128
129/* ======================================================================= */
130/**
131 * @def    STREAM_COUNT                         Stream Count value for
132 *                                              LCML init.
133 */
134/* ======================================================================= */
135#define STREAM_COUNT 2
136
137/* ======================================================================= */
138/**
139 * @def    INPUT_STREAM_ID                      Input Stream ID
140 */
141/* ======================================================================= */
142#define INPUT_STREAM_ID 0
143
144/* ======================================================================= */
145/**
146 * @def    G729DEC_SAMPLING_FREQUENCY          Sampling Frequency
147 */
148/* ======================================================================= */
149#define G729DEC_SAMPLING_FREQUENCY 8000
150
151/* ======================================================================= */
152/**
153 * @def    MAX_NUM_OF_BUFS                      Max Num of Bufs Allowed
154 */
155/* ======================================================================= */
156#define MAX_NUM_OF_BUFS 10
157
158/* ======================================================================= */
159/**
160 * @def    EXTRA_BUFFBYTES                Num of Extra Bytes to be allocated
161 */
162/* ======================================================================= */
163#define EXTRA_BUFFBYTES (256)
164
165/* ======================================================================= */
166/**
167 * @def  CACHE_ALIGNMENT                           Buffer Cache Alignment
168 */
169/* ======================================================================= */
170#define CACHE_ALIGNMENT 128
171
172/* ======================================================================= */
173/**
174 * @def    NUM_OF_PORTS                       Number of Comunication Port
175 */
176/* ======================================================================= */
177#define NUM_OF_PORTS 2
178
179/* ======================================================================= */
180#define G729DEC_CPU 50 /* TBD, 50MHz for the moment */
181/* =======================================================================
182 * @def OMX_G729MALLOC_STRUCT                          structure allocation macro
183 */
184/* ======================================================================= */
185#define OMX_G729MALLOC_STRUCT(_pStruct_, _sName_)               \
186    _pStruct_ = (_sName_*)malloc(sizeof(_sName_));              \
187    if(_pStruct_ == NULL){                                      \
188        printf("***********************************\n");        \
189        printf("%d :: Malloc Failed\n",__LINE__);               \
190        printf("***********************************\n");        \
191        eError = OMX_ErrorInsufficientResources;                \
192        goto EXIT;                                              \
193    }                                                           \
194    memset(_pStruct_, 0x0, sizeof(_sName_));                    \
195    G729DEC_MEMPRINT("%d :: [ALLOC] %p\n",__LINE__,_pStruct_);
196
197#define OMX_G729CONF_INIT_STRUCT(_s_, _name_)   \
198    memset((_s_), 0x0, sizeof(_name_));         \
199    (_s_)->nSize = sizeof(_name_);              \
200    (_s_)->nVersion.s.nVersionMajor = 0x1;      \
201    (_s_)->nVersion.s.nVersionMinor = 0x1;      \
202    (_s_)->nVersion.s.nRevision = 0x0;          \
203    (_s_)->nVersion.s.nStep = 0x0;
204
205#define OMX_G729MEMFREE_STRUCT(_pStruct_)                       \
206    if(_pStruct_ != NULL)                                       \
207    {                                                           \
208        G729DEC_MEMPRINT("%d :: [FREE] %p\n", __LINE__, _pStruct_); \
209        free(_pStruct_);                                        \
210        _pStruct_ = NULL;                                       \
211    }
212
213/****************************************************************
214 *  INCLUDE FILES
215 ****************************************************************/
216/* ----- system and platform files ----------------------------*/
217/*-------program files ----------------------------------------*/
218
219/****************************************************************
220 * EXTERNAL REFERENCES NOTE : only use if not found in header file
221 ****************************************************************/
222/*--------data declarations -----------------------------------*/
223/*--------function prototypes ---------------------------------*/
224
225/****************************************************************
226 * PUBLIC DECLARATIONS Defined here, used elsewhere
227 ****************************************************************/
228/*--------data declarations -----------------------------------*/
229
230/*--------function prototypes ---------------------------------*/
231
232/****************************************************************
233 * PRIVATE DECLARATIONS Defined here, used only here
234 ****************************************************************/
235/*--------data declarations -----------------------------------*/
236/* ======================================================================= */
237/** G729DEC_COMP_PORT_TYPE  Port Type
238 *
239 *  @param  G729DEC_INPUT_PORT                   Port Type Input
240 *
241 *  @param  G729DEC_OUTPUT_PORT                  Port Type Output
242 *
243 */
244/*  ==================================================================== */
245typedef enum G729DEC_COMP_PORT_TYPE {
246    G729DEC_INPUT_PORT = 0,
247    G729DEC_OUTPUT_PORT
248}G729DEC_COMP_PORT_TYPE;
249
250/* ======================================================================= */
251/** G729DEC_StreamType  StreamType
252 *
253 *  @param  G729DEC_DMM                  Stream Type DMM
254 *
255 *  @param  G729DEC_INSTRM               Stream Type Input
256 *
257 *  @param  G729DEC_OUTSTRM              Stream Type Output
258 */
259/*  ==================================================================== */
260enum G729DEC_StreamType
261    {
262        G729DEC_DMM,
263        G729DEC_INSTRM,
264        G729DEC_OUTSTRM
265    };
266
267
268/* ======================================================================= */
269/** G729DEC_BUFFER_Dir  Direction of the Buffer
270 *
271 *  @param  G729DEC_DIRECTION_INPUT              Direction Input
272 *
273 *  @param  G729DEC_DIRECTION_INPUT              Direction Output
274 */
275/*  ==================================================================== */
276typedef enum {
277    G729DEC_DIRECTION_INPUT,
278    G729DEC_DIRECTION_OUTPUT
279}G729DEC_BUFFER_Dir;
280
281/* =================================================================================== */
282/**
283 *  Buffer Information.
284 */
285/* ================================================================================== */
286typedef struct BUFFS
287{
288    OMX_S8 BufHeader;
289    OMX_S8 Buffer;
290}BUFFS;
291
292/* =================================================================================== */
293/**
294 * NBAMR Buffer Header Type Info.
295 */
296/* ================================================================================== */
297typedef struct BUFFERHEADERTYPE_INFO
298{
299    OMX_BUFFERHEADERTYPE* pBufHeader[MAX_NUM_OF_BUFS];
300    BUFFS bBufOwner[MAX_NUM_OF_BUFS];
301}BUFFERHEADERTYPE_INFO;
302
303/* =================================================================================== */
304/**
305 * Socket node input parameters.
306 */
307/* ================================================================================== */
308typedef struct G729DEC_AudioCodecParams
309{
310    unsigned long iSamplingRate;
311    unsigned long iStrmId;
312    unsigned short iAudioFormat;
313}G729DEC_AudioCodecParams;
314
315/* =================================================================================== */
316/**
317 * Socket node alg parameters..
318 */
319/* ================================================================================== */
320typedef struct G729DEC_UAlgBufParamStruct
321{
322    unsigned long usLastFrame;      /* Last frame to decode */
323    unsigned long usFrameLost;      /* Lost frame flag */
324}G729DEC_UAlgBufParamStruct;
325
326/* =================================================================================== */
327/**
328 * LCML_G729DEC_BUFHEADERTYPE
329 */
330/* ================================================================================== */
331typedef struct LCML_G729DEC_BUFHEADERTYPE {
332    G729DEC_BUFFER_Dir eDir;
333    OMX_BUFFERHEADERTYPE* buffer;
334    G729DEC_UAlgBufParamStruct *pIpParam;
335}LCML_G729DEC_BUFHEADERTYPE;
336
337
338typedef struct _G729DEC_BUFFERLIST G729DEC_BUFFERLIST;
339
340/* =================================================================================== */
341/**
342 * Structure for buffer list
343 */
344/* ================================================================================== */
345struct _G729DEC_BUFFERLIST{
346    OMX_BUFFERHEADERTYPE sBufHdr;
347    OMX_BUFFERHEADERTYPE *pBufHdr[MAX_NUM_OF_BUFS];  /* records buffer header send by client */
348    OMX_U32 bufferOwner[MAX_NUM_OF_BUFS];
349    OMX_U32 bBufferPending[MAX_NUM_OF_BUFS];
350    OMX_U32 numBuffers;
351    G729DEC_BUFFERLIST *pNextBuf;
352    G729DEC_BUFFERLIST *pPrevBuf;
353};
354
355/* =================================================================================== */
356/**
357 * Component private data
358 */
359/* ================================================================================== */
360typedef struct G729DEC_COMPONENT_PRIVATE
361{
362    /** Array of pointers to BUFFERHEADERTYPE structures
363        This pBufHeader[G729DEC_INPUT_PORT] will point to all the
364        BUFFERHEADERTYPE structures related to input port,
365        not just one structure. Same is for output port
366        also. */
367
368    OMX_BUFFERHEADERTYPE* pBufHeader[NUM_OF_PORTS];
369
370    BUFFERHEADERTYPE_INFO BufInfo[NUM_OF_PORTS];
371
372    /** Structure of callback pointers */
373    OMX_CALLBACKTYPE cbInfo;
374
375    /** Handle for use with async callbacks */
376    OMX_PORT_PARAM_TYPE sPortParam;
377
378    OMX_PRIORITYMGMTTYPE* sPriorityMgmt;
379
380    /** Input port parameters */
381    OMX_AUDIO_PARAM_PORTFORMATTYPE* pInPortFormat;
382
383    /** Output port parameters */
384    OMX_AUDIO_PARAM_PORTFORMATTYPE* pOutPortFormat;
385
386    /** This will contain info like how many buffers
387        are there for input/output ports, their size etc, but not
388        BUFFERHEADERTYPE POINTERS. */
389    OMX_PARAM_PORTDEFINITIONTYPE* pPortDef[NUM_OF_PORTS];
390
391    /** G729 Component Parameters */
392    OMX_AUDIO_PARAM_G729TYPE* g729Params;
393    OMX_AUDIO_PARAM_PCMMODETYPE* pcmParams;
394
395    /** This is component handle */
396    OMX_COMPONENTTYPE* pHandle;
397
398    /** Current state of this component */
399    OMX_STATETYPE curState;
400
401    /** The component thread handle */
402    pthread_t ComponentThread;
403
404    /** The pipes for sending buffers to the thread */
405    int dataPipe[2];
406
407    /** The pipes for sending buffers to the thread */
408    int cmdPipe[2];
409
410    /** The pipes for sending buffers to the thread */
411    int cmdDataPipe[2];
412
413    /** The pipes for sending buffers to the thread */
414    int lcml_Pipe[2];
415
416    /** Set to indicate component is stopping */
417    OMX_U32 bIsStopping;
418
419    /** Flag set when the EOF marker is sent */
420    OMX_U32 bIsEOFSent;
421
422    /** Count of number of buffers outstanding with bridge */
423    OMX_U32 lcml_nIpBuf;
424
425    /** Count of number of buffers outstanding with bridge */
426    OMX_U32 lcml_nOpBuf;
427
428    /** Number of Buffers In the Application*/
429    OMX_U32 app_nBuf;
430
431    /** LCML Number Input Buffer Received*/
432    OMX_U32 lcml_nCntIp;
433
434    /** LCML Number Output Buffer Received*/
435    OMX_U32 lcml_nCntOpReceived;
436
437    /** Num Reclaimed OutPut Buff    */
438    OMX_U32 num_Reclaimed_Op_Buff;
439
440    /** Num Sent Input Buff   */
441    OMX_U32 num_Sent_Ip_Buff;
442
443    /** Num Sent Output Buff Issued   */
444    OMX_U32 num_Op_Issued;
445
446    /** LCML Handle */
447    OMX_HANDLETYPE pLcmlHandle;
448
449    /** LCML Buffer Header */
450    LCML_G729DEC_BUFHEADERTYPE *pLcmlBufHeader[2];
451
452    /** Sampling Frequeny */
453    OMX_S16 iG729SamplingFrequeny;
454
455    /** Number of channels */
456    OMX_S16 iG729Channels;
457
458    /** Flag for Post Filter mode */
459    OMX_S16 iPostFilt;
460
461    /** Flag for DASF mode */
462    OMX_S16 dasfmode;
463
464    /** Flag for ACDN mode */
465    OMX_S16 acdnmode;
466
467    /** Writing pipe Used for DSP_RENDERING_ON */
468    int fdwrite;
469
470    /** Reading pipe Used for DSP_RENDERING_ON */
471    int fdread;
472
473    /* ID stream ID*/
474    OMX_U32 streamID;
475
476    /* Flag for Port Defs Allocated*/
477    OMX_U32 bPortDefsAllocated;
478
479    /* Flag for Component Thread Started*/
480    OMX_U32 bCompThreadStarted;
481
482    /* Flag for Component Thread Stopping*/
483    OMX_U32 bCompThreadStop;
484
485    /** Mark data */
486    OMX_PTR pMarkData;
487
488    /** Mark buffer */
489    OMX_MARKTYPE *pMarkBuf;
490
491    /** Mark target component */
492    OMX_HANDLETYPE hMarkTargetComponent;
493
494    /** Flag set when buffer should not be queued to the DSP */
495    OMX_U32 bBypassDSP;
496
497    /** Input buffer list */
498    G729DEC_BUFFERLIST *pInputBufferList;
499
500    /** Output buffer list */
501    G729DEC_BUFFERLIST *pOutputBufferList;
502
503    /** LCML stream attributes */
504    LCML_STRMATTR *strmAttr;
505
506    /** Component version */
507    OMX_U32 nVersion;
508
509    /** Play Complete Flag */
510    OMX_U32 bPlayCompleteFlag;
511
512    /** Number of Bytes holding to be sent*/
513    OMX_U32 nHoldLength;
514
515    /** Pointer to the data holding to be sent*/
516    OMX_U8* pHoldBuffer;
517
518    /** Flag set when LCML handle is opened */
519    OMX_S16 bLcmlHandleOpened;
520
521    /** Keeps track of the number of nFillThisBufferCount() calls */
522    OMX_U32 nFillThisBufferCount;
523
524    /** Keeps track of the number of nFillBufferDoneCount() calls */
525    OMX_U32 nFillBufferDoneCount;
526
527    /** Keeps track of the number of nEmptyThisBufferCount() calls */
528    OMX_U32 nEmptyThisBufferCount;
529
530    /** Keeps track of the number of nEmptyBufferDoneCount() calls */
531    OMX_U32 nEmptyBufferDoneCount;
532
533    /** Parameters for the Audio Codec */
534    G729DEC_AudioCodecParams *pParams;
535
536    /** Flag for Init Params Initialized */
537    OMX_U32 bInitParamsInitialized;
538
539    /** Flag for bIdleCommandPending */
540    OMX_U32 bIdleCommandPending;
541
542    /** Array of Input Buffers that are pending to sent due State = Idle */
543    OMX_BUFFERHEADERTYPE *pInputBufHdrPending[MAX_NUM_OF_BUFS];
544
545    /** Number of Input Buffers that are pending to sent due State = Idle */
546    OMX_U32 nNumInputBufPending;
547
548    /** Array of Output Buffers that are pending to sent due State = Idle */
549    OMX_BUFFERHEADERTYPE *pOutputBufHdrPending[MAX_NUM_OF_BUFS];
550
551    /** Number of Output Buffers that are pending to sent due State = Idle */
552    OMX_U32 nNumOutputBufPending;
553
554    /** Flag for Reenabling Ports*/
555    OMX_U32 bJustReenabled;
556
557    /** Flag for Invalid Frame Count*/
558    OMX_U32 nInvalidFrameCount;
559
560    /** Flag for Writes While Paused   */
561    OMX_U32 nDataWritesWhilePaused;
562
563    /** Flag for bDisableCommandPending*/
564    OMX_U32 bDisableCommandPending;
565    OMX_U32 bEnableCommandPending;
566
567    /** Flag for bDisableCommandParam*/
568    OMX_U32 bDisableCommandParam;
569    OMX_U32 bEnableCommandParam;
570
571    /** Flag to set when socket node stop callback should not transition
572        component to OMX_StateIdle */
573    OMX_U32 bNoIdleOnStop;
574
575    /** Flag set when socket node is stopped */
576    OMX_U32 bDspStoppedWhileExecuting;
577
578    /** Number of outstanding FillBufferDone() calls */
579    OMX_S32 nOutStandingFillDones;
580
581    /** Stop Codec Command Sent Flag*/
582    OMX_U8 bStopSent;
583
584    OMX_U32 nRuntimeInputBuffers;
585    OMX_U32 nRuntimeOutputBuffers;
586
587    OMX_STRING* sDeviceString;
588
589    OMX_U32 nPacketsPerBuffer;
590
591#ifndef UNDER_CE
592    pthread_mutex_t AlloBuf_mutex;
593    pthread_cond_t AlloBuf_threshold;
594    OMX_U8 AlloBuf_waitingsignal;
595
596    pthread_mutex_t InLoaded_mutex;
597    pthread_cond_t InLoaded_threshold;
598    OMX_U8 InLoaded_readytoidle;
599
600    pthread_mutex_t InIdle_mutex;
601    pthread_cond_t InIdle_threshold;
602    OMX_U8 InIdle_goingtoloaded;
603#else
604    OMX_Event AlloBuf_event;
605    OMX_U8 AlloBuf_waitingsignal;
606
607    OMX_Event InLoaded_event;
608    OMX_U8 InLoaded_readytoidle;
609
610    OMX_Event InIdle_event;
611    OMX_U8 InIdle_goingtoloaded;
612#endif
613
614    /** Holds the value of RT Mixer mode  */
615    OMX_U32 rtmx;
616
617    OMX_BOOL bLoadedCommandPending;
618    OMX_BOOL bFlushEventPending;
619
620    OMX_PARAM_COMPONENTROLETYPE componentRole;
621
622    /** Keep buffer timestamps **/
623    OMX_S64 arrTimestamp[MAX_NUM_OF_BUFS];
624
625    /** Keep buffer timestamps **/
626    OMX_S64 arrTickCount[MAX_NUM_OF_BUFS];
627
628    /** Index to arrBufIndex[], used for input buffer timestamps */
629    OMX_U8 IpBufindex;
630
631    /** Index to arrBufIndex[], used for output buffer timestamps */
632    OMX_U8 OpBufindex;
633
634    OMX_U8 nUnhandledFillThisBuffers;
635    OMX_U8 nUnhandledEmptyThisBuffers;
636    OMX_BOOL bFlushOutputPortCommandPending;
637    OMX_BOOL bFlushInputPortCommandPending;
638
639    /* array to hold buffer parameters */
640    unsigned long int* bufParamsArray;
641
642    OMX_BOOL bPreempted;
643
644    /** Pointer to RM callback **/
645#ifdef RESOURCE_MANAGER_ENABLED
646    RMPROXY_CALLBACKTYPE rmproxyCallback;
647#endif
648
649
650#ifdef __PERF_INSTRUMENTATION__
651    PERF_OBJHANDLE pPERF, pPERFcomp;
652    OMX_U32 nLcml_nCntIp;
653    OMX_U32 nLcml_nCntOpReceived;
654#endif
655
656
657} G729DEC_COMPONENT_PRIVATE;
658
659/* ===========================================================================*/
660/**
661 *   Private data that application associates with buffer
662 */
663/* ===========================================================================*/
664
665typedef struct G729DEC_BufParamStruct
666{
667    OMX_U16 frameLost;      /* Lost frame flag from GPP */
668    unsigned long int numPackets;
669    unsigned long int packetLength[6];
670    OMX_BOOL bNoUseDefaults;
671
672} G729DEC_BufParamStruct;
673
674
675typedef enum OMX_G729DEC_INDEXAUDIOTYPE {
676    OMX_IndexCustomG729DecModeAcdnConfig = 0xFF000001,
677    OMX_IndexCustomG729DecModeDasfConfig,
678    OMX_IndexCustomG729DecHeaderInfoConfig,
679    OMX_IndexCustomG729DecDataPath
680}OMX_G729DEC_INDEXAUDIOTYPE;
681
682
683/*--------function prototypes ---------------------------------*/
684#ifndef UNDER_CE
685
686OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE hComp);
687
688#else
689/* =================================================================================== */
690/**
691 *   OMX_EXPORT                                           WinCE Implicit Export Syntax
692 */
693/* ================================================================================== */
694#define OMX_EXPORT __declspec(dllexport)
695
696OMX_EXPORT OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE hComp);
697
698#endif
699
700
701OMX_ERRORTYPE G729DEC_StartComponentThread(OMX_HANDLETYPE pHandle);
702OMX_ERRORTYPE G729DEC_StopComponentThread(OMX_HANDLETYPE pHandle);
703OMX_ERRORTYPE G729DEC_FreeCompResources(OMX_HANDLETYPE pComponent);
704void SendFlushCompleteEvent(G729DEC_COMPONENT_PRIVATE *pComponentPrivate, int port);
705
706#ifdef RESOURCE_MANAGER_ENABLED
707/***********************************
708 *  Callback to the RM                                       *
709 ***********************************/
710void G729DEC_ResourceManagerCallback(RMPROXY_COMMANDDATATYPE cbData);
711#endif
712
713/*--------macros ----------------------------------------------*/
714#ifndef UNDER_CE
715#ifdef  G729DEC_DEBUG
716#define G729DEC_DPRINT(...)    fprintf(stderr,__VA_ARGS__)
717#define G729DEC_EPRINT(...)    fprintf(stderr,__VA_ARGS__)
718#else
719#define G729DEC_DPRINT(...)
720#define G729DEC_EPRINT(...)
721#endif
722
723#ifdef  G729DEC_MEMCHECK
724#define G729DEC_MEMPRINT(...)    fprintf(stderr,__VA_ARGS__)
725#else
726#define G729DEC_MEMPRINT(...)
727#endif
728
729
730#ifdef  G729DEC_DEBUG_MCP
731#define G729DEC_MCP_DPRINT(...)    fprintf(stderr,__VA_ARGS__)
732#else
733#define G729DEC_MCP_DPRINT(...)
734#endif
735
736#ifdef  G729DEC_PRINT
737#define G729DEC_PRINT_INFO(...)    fprintf(stderr,__VA_ARGS__)
738#else
739#define G729DEC_PRINT_INFO(...)
740#endif
741
742
743#else /*UNDER_CE*/
744#ifdef DEBUG
745#define G729DEC_DPRINT   printf
746#define G729DEC_EPRINT   printf
747#define G729DEC_MEMPRINT   printf
748#define G729DEC_PRINT_INFO printf
749#else
750#define G729DEC_DPRINT
751#define G729DEC_EPRINT
752#define G729DEC_MEMPRINT
753#define G729DEC_PRINT_INFO
754#endif
755
756#endif
757
758
759
760
761#endif /* OMX_G729DECODER_H */
762