16ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/* ------------------------------------------------------------------
26ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * Copyright (C) 1998-2009 PacketVideo
36ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *
46ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
56ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * you may not use this file except in compliance with the License.
66ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * You may obtain a copy of the License at
76ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *
86ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
96ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *
106ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * Unless required by applicable law or agreed to in writing, software
116ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
126ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
136ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * express or implied.
146ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * See the License for the specific language governing permissions
156ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * and limitations under the License.
166ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * -------------------------------------------------------------------
176ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
186ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/*
196ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * Copyright (c) 2008 The Khronos Group Inc.
206ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *
216ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * Permission is hereby granted, free of charge, to any person obtaining
226ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * a copy of this software and associated documentation files (the
236ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * "Software"), to deal in the Software without restriction, including
246ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * without limitation the rights to use, copy, modify, merge, publish,
256ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * distribute, sublicense, and/or sell copies of the Software, and to
266ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * permit persons to whom the Software is furnished to do so, subject
276ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * to the following conditions:
286ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * The above copyright notice and this permission notice shall be included
296ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * in all copies or substantial portions of the Software.
306ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *
316ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
326ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
336ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
346ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
356ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
366ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
376ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
386ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *
396ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
406ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
416ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/** OMX_ContentPipe.h - OpenMax IL version 1.1.2
426ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *  The OMX_ContentPipe header file contains the definitions used to define
436ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *  the public interface for content piples.  This header file is intended to
446ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber *  be used by the component.
456ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
466ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
476ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#ifndef OMX_CONTENTPIPE_H
486ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define OMX_CONTENTPIPE_H
496ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
506ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#ifndef KD_EACCES
516ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/* OpenKODE error codes. CPResult values may be zero (indicating success
526ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber   or one of the following values) */
536ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EACCES (1)
546ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EADDRINUSE (2)
556ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EAGAIN (5)
566ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EBADF (7)
576ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EBUSY (8)
586ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ECONNREFUSED (9)
596ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ECONNRESET (10)
606ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EDEADLK (11)
616ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EDESTADDRREQ (12)
626ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ERANGE (35)
636ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EEXIST (13)
646ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EFBIG (14)
656ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EHOSTUNREACH (15)
666ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EINVAL (17)
676ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EIO (18)
686ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EISCONN (20)
696ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EISDIR (21)
706ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EMFILE (22)
716ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ENAMETOOLONG (23)
726ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ENOENT (24)
736ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ENOMEM (25)
746ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ENOSPC (26)
756ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ENOSYS (27)
766ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ENOTCONN (28)
776ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EPERM (33)
786ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_ETIMEDOUT (36)
796ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#define KD_EILSEQ (19)
806ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#endif
816ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
826ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/** Map types from OMX standard types only here so interface is as generic as possible. */
836ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef OMX_U32    CPresult;
846ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef char *     CPstring;
856ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef void *     CPhandle;
866ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef OMX_U32    CPuint;
876ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef OMX_S32    CPint;
886ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef char       CPbyte;
896ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef OMX_BOOL   CPbool;
906ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
916ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/** enumeration of origin types used in the CP_PIPETYPE's Seek function
926ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * @ingroup cp
936ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
946ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef enum CP_ORIGINTYPE {
956ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_OriginBegin,
966ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_OriginCur,
976ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_OriginEnd,
986ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
996ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
1006ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_OriginMax = 0X7FFFFFFF
1016ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber} CP_ORIGINTYPE;
1026ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1036ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/** enumeration of contact access types used in the CP_PIPETYPE's Open function
1046ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * @ingroup cp
1056ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
1066ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef enum CP_ACCESSTYPE {
1076ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_AccessRead,
1086ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_AccessWrite,
1096ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_AccessReadWrite ,
1106ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
1116ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
1126ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_AccessMax = 0X7FFFFFFF
1136ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber} CP_ACCESSTYPE;
1146ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1156ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
1166ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * @ingroup cp
1176ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
1186ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef enum CP_CHECKBYTESRESULTTYPE
1196ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber{
1206ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesOk,                    /**< There are at least the request number
1216ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber                                              of bytes available */
1226ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesNotReady,              /**< The pipe is still retrieving bytes
1236ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber                                              and presently lacks sufficient bytes.
1246ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber                                              Client will be called when they are
1256ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber                                              sufficient bytes are available. */
1266ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesInsufficientBytes  ,     /**< The pipe has retrieved all bytes
1276ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber                                              but those available are less than those
1286ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber                                              requested */
1296ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesAtEndOfStream,         /**< The pipe has reached the end of stream
1306ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber                                              and no more bytes are available. */
1316ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesOutOfBuffers,          /**< All read/write buffers are currently in use. */
1326ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
1336ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
1346ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_CheckBytesMax = 0X7FFFFFFF
1356ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber} CP_CHECKBYTESRESULTTYPE;
1366ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1376ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/** enumeration of content pipe events sent to the client callback.
1386ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * @ingroup cp
1396ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
1406ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef enum CP_EVENTTYPE{
1416ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_BytesAvailable,      	    /** bytes requested in a CheckAvailableBytes call are now available*/
1426ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_Overflow,  		           /** enumeration of content pipe events sent to the client callback*/
1436ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_PipeDisconnected  ,  		    /** enumeration of content pipe events sent to the client callback*/
1446ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
1456ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
1466ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CP_EventMax = 0X7FFFFFFF
1476ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber} CP_EVENTTYPE;
1486ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1496ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber/** content pipe definition
1506ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber * @ingroup cp
1516ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber */
1526ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Hubertypedef struct CP_PIPETYPE
1536ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber{
1546ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Open a content stream for reading or writing. */
1556ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
1566ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1576ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Close a content stream. */
1586ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*Close)( CPhandle hContent );
1596ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1606ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Create a content source and open it for writing. */
1616ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*Create)( CPhandle *hContent, CPstring szURI );
1626ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1636ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/
1646ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult );
1656ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1666ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Seek to certain position in the content relative to the specified origin. */
1676ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*SetPosition)( CPhandle  hContent, CPint nOffset, CP_ORIGINTYPE eOrigin);
1686ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1696ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Retrieve the current position relative to the start of the content. */
1706ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition);
1716ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1726ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Retrieve data of the specified size from the content stream (advance content pointer by size of data).
1736ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */
1746ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
1756ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1766ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
1776ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also
1786ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       returns the size of the block actually read. Content pointer advances the by the returned size.
1796ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       Note: pipe provides pointer. This function is appropriate for large reads. The client must call
1806ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       ReleaseReadBuffer when done with buffer.
1816ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1826ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       In some cases the requested block may not reside in contiguous memory within the
1836ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       pipe implementation. For instance if the pipe leverages a circular buffer then the requested
1846ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       block may straddle the boundary of the circular buffer. By default a pipe implementation
1856ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       performs a copy in this case to provide the block to the pipe client in one contiguous buffer.
1866ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
1876ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       boundary. Here the client may retrieve the data in segments over successive calls. */
1886ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
1896ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1906ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Release a buffer obtained by ReadBuffer back to the pipe. */
1916ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer);
1926ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1936ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Write data of the specified size to the content (advance content pointer by size of data).
1946ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */
1956ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
1966ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
1976ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Retrieve a buffer allocated by the pipe used to write data to the content.
1986ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate
1996ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/
2006ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
2016ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
2026ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
2036ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber       the contents of the buffer to content and advance content pointer by the size of the buffer */
2046ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);
2056ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
2066ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    /** Register a per-handle client callback with the content pipe. */
2076ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber    CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam));
2086ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
2096ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber} CP_PIPETYPE;
2106ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
2116ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber#endif
2126ac35f059726cf60a364c1efd783a99c901f2d9dAndreas Huber
213