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 /** LCML_codecinterface.h
30  *  The LCML header file contains the interface used by
31  *  and the component to access common items.
32  */
33 
34 #ifndef __LCML_CODECINTERFACE_H__
35 #define __LCML_CODECINTERFACE_H__
36 
37 #include <OMX_Core.h>
38 #include <OMX_TI_Debug.h>
39 /**
40  * Commands to send messages to codec
41  */
42 typedef enum
43 {
44     EMMCodecControlSendDspMessage,
45     EMMCodecControlPause,
46     EMMCodecControlStart,
47     MMCodecControlStop,
48     EMMCodecControlDestroy,
49     EMMCodecControlAlgCtrl,
50     EMMCodecControlStrmCtrl,
51     EMMCodecControlUsnEos
52 }TControlCmd;
53 
54 
55 /**
56  * Type fo buffer ENUM
57  */
58 typedef enum
59 {
60     /*EMMCodecInputBuffer,
61     EMMCodecOuputBuffer,
62     EMMCodecScratchBuffer*/
63     EMMCodecInputBufferMapBufLen  = 1000,
64     EMMCodecOutputBufferMapBufLen  = 1001,
65     EMMCodecInputBufferMapReuse  = 1002,
66     EMMCodecOutputBufferMapReuse  = 1003,
67     EMMCodecInputBuffer  = 2000,
68     EMMCodecStream0      = 2000,
69     EMMCodecOuputBuffer  = 2001,
70     EMMCodecStream1      = 2001,
71     EMMCodecStream2,
72     EMMCodecStream3,
73     EMMCodecStream4,
74     EMMCodecStream5,
75     EMMCodecStream6,
76     EMMCodecStream7,
77     EMMCodecStream8,
78     EMMCodecStream9,
79     EMMCodecStream10,
80     EMMCodecStream11,
81     EMMCodecStream12,
82     EMMCodecStream13,
83     EMMCodecStream14,
84     EMMCodecStream15,
85     EMMCodecStream16,
86     EMMCodecStream17,
87     EMMCodecStream18,
88     EMMCodecStream19,
89     EMMCodecStream20
90 }TMMCodecBufferType;
91 
92 
93 /**
94  * Generic interface provided to write and codec needs to implement all
95  * function present to use this structure
96  */
97 typedef struct LCML_CODEC_INTERFACE
98 {
99     OMX_ERRORTYPE (*InitMMCodec)(OMX_HANDLETYPE hComponent,
100                                  OMX_STRING codecName,
101                                  void *toCodecInitParams,
102                                  void *fromCodecInfoStruct,
103                                  LCML_CALLBACKTYPE *pCallbacks);
104 
105     OMX_ERRORTYPE (*InitMMCodecEx)(OMX_HANDLETYPE hComponent,
106                                    OMX_STRING  codecName,
107                                    void *toCodecInitParams,
108                                    void *fromCodecInfoStruct,
109                                    LCML_CALLBACKTYPE *pCallbacks,
110                                    OMX_STRING  Args);
111 
112     OMX_ERRORTYPE (*WaitForEvent)(OMX_HANDLETYPE hComponent,
113                                   TUsnCodecEvent event,
114                                   void *args[10] );
115 
116     OMX_ERRORTYPE (*QueueBuffer)(OMX_HANDLETYPE hComponent,
117                                  TMMCodecBufferType bufType,
118                                  OMX_U8 *buffer,
119                                  OMX_S32 bufferLen,
120                                  OMX_S32 bufferSizeUsed,
121                                  OMX_U8 *auxInfo,
122                                  OMX_S32 auxInfoLen,
123                                  OMX_U8 *usrArg);
124 
125     OMX_ERRORTYPE (*ControlCodec)(OMX_HANDLETYPE hComponent,
126                                   TControlCmd iCodecCmd,
127                                   void *args [10]);
128 
129     OMX_PTR pCodecPrivate;
130     OMX_HANDLETYPE pCodec;
131     struct OMX_TI_Debug dbg;
132 
133 }LCML_CODEC_INTERFACE;
134 
135 #endif /* __MMCODECINTERFACE_H__ */
136 
137