OMX_ContentPipe.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007 The Khronos Group Inc. 
00003  * 
00004  * Permission is hereby granted, free of charge, to any person obtaining
00005  * a copy of this software and associated documentation files (the
00006  * "Software"), to deal in the Software without restriction, including
00007  * without limitation the rights to use, copy, modify, merge, publish,
00008  * distribute, sublicense, and/or sell copies of the Software, and to
00009  * permit persons to whom the Software is furnished to do so, subject
00010  * to the following conditions: 
00011  * The above copyright notice and this permission notice shall be included
00012  * in all copies or substantial portions of the Software. 
00013  * 
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00018  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00019  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00020  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
00021  *
00022  */
00023 
00030 #ifndef OMX_CONTENTPIPE_H
00031 #define OMX_CONTENTPIPE_H
00032 
00033 #ifndef KD_EACCES
00034 /* OpenKODE error codes. CPResult values may be zero (indicating success
00035    or one of the following values) */
00036 #define KD_EACCES (13)
00037 #define KD_EADDRINUSE (98)
00038 #define KD_EAGAIN (11)
00039 #define KD_EBADF (9)
00040 #define KD_EBUSY (16)
00041 #define KD_ECANCELED (125)
00042 #define KD_ECONNABORTED (103)
00043 #define KD_ECONNREFUSED (111)
00044 #define KD_ECONNRESET (104)
00045 #define KD_EDEADLK (35)
00046 #define KD_EDESTADDRREQ (89)
00047 #define KD_EDOM (33)
00048 #define KD_ERANGE (34)
00049 #define KD_EEXIST (17)
00050 #define KD_EFAULT (14)
00051 #define KD_EFBIG (27)
00052 #define KD_EHOSTUNREACH (113)
00053 #define KD_EINPROGRESS (115)
00054 #define KD_EINTR (4)
00055 #define KD_EINVAL (22)
00056 #define KD_EIO (5)
00057 #define KD_EISCONN (106)
00058 #define KD_EISDIR (21)
00059 #define KD_EMFILE (24)
00060 #define KD_ENAMETOOLONG (36)
00061 #define KD_ENETDOWN (100)
00062 #define KD_ENETRESET (102)
00063 #define KD_ENETUNREACH (101)
00064 #define KD_ENOBUFS (105)
00065 #define KD_ENOENT (2)
00066 #define KD_ENOMEM (12)
00067 #define KD_ENOSPC (28)
00068 #define KD_ENOSYS (28)
00069 #define KD_ENOTCONN (107)
00070 #define KD_ENOTDIR (20)
00071 #define KD_ENOTEMPTY (39)
00072 #define KD_ENOTSOCK (88)
00073 #define KD_ENOTSUP (95)
00074 #define KD_EPERM (1)
00075 #define KD_EPROTO (71)
00076 #define KD_ETIMEDOUT (110)
00077 #define KD_EILSEQ (84)
00078 #endif
00079 
00081 typedef OMX_U32    CPresult;
00082 typedef char *     CPstring;  
00083 typedef void *     CPhandle;
00084 typedef OMX_U32    CPuint;
00085 typedef OMX_S32    CPint;  
00086 typedef char       CPbyte;  
00087 typedef OMX_BOOL   CPbool;
00088 
00092 typedef enum CP_ORIGINTYPE {
00093     CP_OriginBegin,      
00094     CP_OriginCur,      
00095     CP_OriginEnd,      
00096     CP_OriginMax = 0X7FFFFFFF
00097 } CP_ORIGINTYPE;
00098 
00102 typedef enum CP_ACCESSTYPE {
00103     CP_AccessRead,      
00104     CP_AccessWrite,  
00105     CP_AccessReadWrite ,  
00106     CP_AccessMax = 0X7FFFFFFF
00107 } CP_ACCESSTYPE;
00108 
00112 typedef enum CP_CHECKBYTESRESULTTYPE
00113 {
00114     CP_CheckBytesOk,                    
00116     CP_CheckBytesNotReady,              
00120     CP_CheckBytesInsufficientBytes  ,     
00123     CP_CheckBytesAtEndOfStream,         
00125     CP_CheckBytesOutOfBuffers,          
00126     CP_CheckBytesMax = 0X7FFFFFFF
00127 } CP_CHECKBYTESRESULTTYPE;
00128 
00132 typedef enum CP_EVENTTYPE{
00133     CP_BytesAvailable,              
00134     CP_Overflow,                   
00135     CP_PipeDisconnected  ,              
00136     CP_EventMax = 0X7FFFFFFF
00137 } CP_EVENTTYPE;
00138 
00142 typedef struct CP_PIPETYPE
00143 {
00145     CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
00146 
00148     CPresult (*Close)( CPhandle hContent );
00149 
00151     CPresult (*Create)( CPhandle *hContent, CPstring szURI );
00152 
00154     CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult );
00155 
00157     CPresult (*SetPosition)( CPhandle  hContent, CPint nOffset, CP_ORIGINTYPE eOrigin);
00158 
00160     CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition);
00161 
00164     CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize); 
00165 
00178     CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
00179 
00181     CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer);
00182 
00185     CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize); 
00186 
00190     CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
00191 
00194     CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);
00195 
00197     CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam));
00198 
00199 } CP_PIPETYPE;
00200 
00201 #endif
00202 

Generated for OpenMAX Bellagio rel. 0.3.5-svn by  doxygen 1.5.1
SourceForge.net Logo