summaryrefslogtreecommitdiff
path: root/domx/omx_core/inc/OMX_ContentPipe.h
diff options
context:
space:
mode:
Diffstat (limited to 'domx/omx_core/inc/OMX_ContentPipe.h')
-rwxr-xr-xdomx/omx_core/inc/OMX_ContentPipe.h105
1 files changed, 61 insertions, 44 deletions
diff --git a/domx/omx_core/inc/OMX_ContentPipe.h b/domx/omx_core/inc/OMX_ContentPipe.h
index 5f6310c..6b1025e 100755
--- a/domx/omx_core/inc/OMX_ContentPipe.h
+++ b/domx/omx_core/inc/OMX_ContentPipe.h
@@ -1,23 +1,40 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
/*
- * Copyright (c) 2008 The Khronos Group Inc.
- *
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
+ * to the following conditions:
* The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
+ * in all copies or substantial portions of the Software.
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
@@ -64,83 +81,83 @@
/** Map types from OMX standard types only here so interface is as generic as possible. */
typedef OMX_U32 CPresult;
-typedef char * CPstring;
+typedef char * CPstring;
typedef void * CPhandle;
typedef OMX_U32 CPuint;
-typedef OMX_S32 CPint;
-typedef char CPbyte;
+typedef OMX_S32 CPint;
+typedef char CPbyte;
typedef OMX_BOOL CPbool;
-/** enumeration of origin types used in the CP_PIPETYPE's Seek function
+/** enumeration of origin types used in the CP_PIPETYPE's Seek function
* @ingroup cp
*/
typedef enum CP_ORIGINTYPE {
- CP_OriginBegin,
- CP_OriginCur,
- CP_OriginEnd,
- CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_OriginBegin,
+ CP_OriginCur,
+ CP_OriginEnd,
+ CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
CP_OriginMax = 0X7FFFFFFF
} CP_ORIGINTYPE;
-/** enumeration of contact access types used in the CP_PIPETYPE's Open function
+/** enumeration of contact access types used in the CP_PIPETYPE's Open function
* @ingroup cp
*/
typedef enum CP_ACCESSTYPE {
- CP_AccessRead,
- CP_AccessWrite,
- CP_AccessReadWrite ,
- CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_AccessRead,
+ CP_AccessWrite,
+ CP_AccessReadWrite ,
+ CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
CP_AccessMax = 0X7FFFFFFF
} CP_ACCESSTYPE;
-/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
+/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
* @ingroup cp
*/
typedef enum CP_CHECKBYTESRESULTTYPE
{
- CP_CheckBytesOk, /**< There are at least the request number
+ CP_CheckBytesOk, /**< There are at least the request number
of bytes available */
- CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes
- and presently lacks sufficient bytes.
- Client will be called when they are
+ CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes
+ and presently lacks sufficient bytes.
+ Client will be called when they are
sufficient bytes are available. */
- CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes
- but those available are less than those
+ CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes
+ but those available are less than those
requested */
CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream
and no more bytes are available. */
CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */
- CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
CP_CheckBytesMax = 0X7FFFFFFF
} CP_CHECKBYTESRESULTTYPE;
-/** enumeration of content pipe events sent to the client callback.
+/** enumeration of content pipe events sent to the client callback.
* @ingroup cp
*/
typedef enum CP_EVENTTYPE{
CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/
CP_Overflow, /** enumeration of content pipe events sent to the client callback*/
CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/
- CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
CP_EventMax = 0X7FFFFFFF
} CP_EVENTTYPE;
-/** content pipe definition
+/** content pipe definition
* @ingroup cp
*/
typedef struct CP_PIPETYPE
{
- /** Open a content stream for reading or writing. */
+ /** Open a content stream for reading or writing. */
CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
- /** Close a content stream. */
+ /** Close a content stream. */
CPresult (*Close)( CPhandle hContent );
- /** Create a content source and open it for writing. */
+ /** Create a content source and open it for writing. */
CPresult (*Create)( CPhandle *hContent, CPstring szURI );
/** Check the that specified number of bytes are available for reading or writing (depending on access type).*/
@@ -154,19 +171,19 @@ typedef struct CP_PIPETYPE
/** Retrieve data of the specified size from the content stream (advance content pointer by size of data).
Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */
- CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
+ CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
- /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
+ /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also
- returns the size of the block actually read. Content pointer advances the by the returned size.
- Note: pipe provides pointer. This function is appropriate for large reads. The client must call
- ReleaseReadBuffer when done with buffer.
+ returns the size of the block actually read. Content pointer advances the by the returned size.
+ Note: pipe provides pointer. This function is appropriate for large reads. The client must call
+ ReleaseReadBuffer when done with buffer.
In some cases the requested block may not reside in contiguous memory within the
- pipe implementation. For instance if the pipe leverages a circular buffer then the requested
- block may straddle the boundary of the circular buffer. By default a pipe implementation
+ pipe implementation. For instance if the pipe leverages a circular buffer then the requested
+ block may straddle the boundary of the circular buffer. By default a pipe implementation
performs a copy in this case to provide the block to the pipe client in one contiguous buffer.
- If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
+ If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
boundary. Here the client may retrieve the data in segments over successive calls. */
CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
@@ -175,14 +192,14 @@ typedef struct CP_PIPETYPE
/** Write data of the specified size to the content (advance content pointer by size of data).
Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */
- CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
+ CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
- /** Retrieve a buffer allocated by the pipe used to write data to the content.
+ /** Retrieve a buffer allocated by the pipe used to write data to the content.
Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate
for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/
CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
- /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
+ /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
the contents of the buffer to content and advance content pointer by the size of the buffer */
CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);