| 1 |
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ |
| 2 |
|
| 3 |
File: oct6100_playout_buf_pub.h |
| 4 |
|
| 5 |
Copyright (c) 2001-2007 Octasic Inc. |
| 6 |
|
| 7 |
Description: |
| 8 |
|
| 9 |
File containing all defines, macros, and structures pertaining to the file |
| 10 |
oct6100_playout_buf.c. All elements defined in this file are for public |
| 11 |
usage of the API. All private elements are defined in the |
| 12 |
oct6100_playout_buf_priv.h file. |
| 13 |
|
| 14 |
This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is |
| 15 |
free software; you can redistribute it and/or modify it under the terms of |
| 16 |
the GNU General Public License as published by the Free Software Foundation; |
| 17 |
either version 2 of the License, or (at your option) any later version. |
| 18 |
|
| 19 |
The OCT6100 GPL API is distributed in the hope that it will be useful, but |
| 20 |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 21 |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 22 |
for more details. |
| 23 |
|
| 24 |
You should have received a copy of the GNU General Public License |
| 25 |
along with the OCT6100 GPL API; if not, write to the Free Software |
| 26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 27 |
|
| 28 |
$Octasic_Release: OCT612xAPI-01.00-PR49 $ |
| 29 |
|
| 30 |
$Octasic_Revision: 21 $ |
| 31 |
|
| 32 |
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ |
| 33 |
|
| 34 |
#ifndef __OCT6100_PLAYOUT_BUF_PUB_H__ |
| 35 |
#define __OCT6100_PLAYOUT_BUF_PUB_H__ |
| 36 |
|
| 37 |
/***************************** INCLUDE FILES *******************************/ |
| 38 |
|
| 39 |
|
| 40 |
/***************************** DEFINES *************************************/ |
| 41 |
|
| 42 |
|
| 43 |
/***************************** TYPES ***************************************/ |
| 44 |
|
| 45 |
typedef struct _OCT6100_BUFFER_LOAD_ |
| 46 |
{ |
| 47 |
PUINT32 pulBufferIndex; /* Index identifying the buffer. */ |
| 48 |
PUINT32 pulPlayoutFreeMemSize; /* Amount of free memory available for other buffers. */ |
| 49 |
|
| 50 |
PUINT8 pbyBufferPattern; /* A byte pointer pointing to a valid buffer to be loaded into the chip's external memory. */ |
| 51 |
UINT32 ulBufferSize; /* Size of the buffer loaded into external memory. */ |
| 52 |
|
| 53 |
UINT32 ulBufferPcmLaw; /* Buffer PCM law. */ |
| 54 |
|
| 55 |
} tOCT6100_BUFFER_LOAD, *tPOCT6100_BUFFER_LOAD; |
| 56 |
|
| 57 |
typedef struct _OCT6100_BUFFER_LOAD_BLOCK_INIT_ |
| 58 |
{ |
| 59 |
PUINT32 pulBufferIndex; /* Index identifying the buffer. */ |
| 60 |
PUINT32 pulPlayoutFreeMemSize; /* Amount of free memory available for other buffers. */ |
| 61 |
|
| 62 |
UINT32 ulBufferSize; /* Size of the buffer to be loaded in memory. This space will be reserved. */ |
| 63 |
|
| 64 |
UINT32 ulBufferPcmLaw; /* Buffer PCM law. */ |
| 65 |
|
| 66 |
} tOCT6100_BUFFER_LOAD_BLOCK_INIT, *tPOCT6100_BUFFER_LOAD_BLOCK_INIT; |
| 67 |
|
| 68 |
typedef struct _OCT6100_BUFFER_LOAD_BLOCK_ |
| 69 |
{ |
| 70 |
UINT32 ulBufferIndex; /* Index identifying the buffer. */ |
| 71 |
|
| 72 |
/* Offset, in bytes, of the first byte in the block to be loaded. */ |
| 73 |
/* This offset is with respect to the beginning of the buffer. */ |
| 74 |
/* This value must be modulo 2 */ |
| 75 |
UINT32 ulBlockOffset; |
| 76 |
|
| 77 |
/* Size of the block to be loaded into external memory. */ |
| 78 |
/* This value must be modulo 2. */ |
| 79 |
UINT32 ulBlockLength; |
| 80 |
|
| 81 |
/* A pointer pointing to a valid buffer block to be loaded */ |
| 82 |
/* into the chip's external memory. This is a pointer to the entire */ |
| 83 |
/* buffer. The API uses the ulBlockOffset and ulBlockLength to index */ |
| 84 |
/* within this buffer and obtain the block to be loaded. */ |
| 85 |
PUINT8 pbyBufferPattern; |
| 86 |
|
| 87 |
} tOCT6100_BUFFER_LOAD_BLOCK, *tPOCT6100_BUFFER_LOAD_BLOCK; |
| 88 |
|
| 89 |
typedef struct _OCT6100_BUFFER_UNLOAD_ |
| 90 |
{ |
| 91 |
UINT32 ulBufferIndex; /* Index identifying the buffer. */ |
| 92 |
|
| 93 |
} tOCT6100_BUFFER_UNLOAD, *tPOCT6100_BUFFER_UNLOAD; |
| 94 |
|
| 95 |
typedef struct _OCT6100_BUFFER_PLAYOUT_ADD_ |
| 96 |
{ |
| 97 |
UINT32 ulChannelHndl; /* Echo cancelling channel on which to play the buffer. */ |
| 98 |
|
| 99 |
UINT32 ulBufferIndex; /* Index identifying the buffer. */ |
| 100 |
|
| 101 |
UINT32 ulPlayoutPort; /* Selected channel port where to play to tone. */ |
| 102 |
UINT32 ulMixingMode; /* Weither or not the voice stream will be muted while playing the buffer. */ |
| 103 |
|
| 104 |
INT32 lGainDb; /* Gain applied to the buffer that will be played on the specified port. */ |
| 105 |
|
| 106 |
BOOL fRepeat; /* Use ulRepeatCount variable. */ |
| 107 |
UINT32 ulRepeatCount; /* Number of times to repeat playing the selected buffer. */ |
| 108 |
|
| 109 |
UINT32 ulDuration; /* Duration in millisecond that this buffer should play. Setting this overrides fRepeat. */ |
| 110 |
|
| 111 |
UINT32 ulBufferLength; /* Length of the buffer to play (starting at the beginning), AUTO_SELECT for all. */ |
| 112 |
|
| 113 |
} tOCT6100_BUFFER_PLAYOUT_ADD, *tPOCT6100_BUFFER_PLAYOUT_ADD; |
| 114 |
|
| 115 |
typedef struct _OCT6100_BUFFER_PLAYOUT_START_ |
| 116 |
{ |
| 117 |
UINT32 ulChannelHndl; /* Echo cancelling channel on which to play the buffer. */ |
| 118 |
UINT32 ulPlayoutPort; /* Selected channel port where to play to tone. */ |
| 119 |
|
| 120 |
BOOL fNotifyOnPlayoutStop; /* Check if the buffers have finished playing on this channel/port. */ |
| 121 |
/* The events are queued in a soft buffer that the user must empty regularly. */ |
| 122 |
UINT32 ulUserEventId; /* Returned to the user when the playout is finished and the user has set the fNotifyOnPlayoutStop flag. */ |
| 123 |
|
| 124 |
BOOL fAllowStartWhileActive; /* Use this to add buffers to something that is already playing on the channel/port. */ |
| 125 |
|
| 126 |
} tOCT6100_BUFFER_PLAYOUT_START, *tPOCT6100_BUFFER_PLAYOUT_START; |
| 127 |
|
| 128 |
typedef struct _OCT6100_BUFFER_PLAYOUT_STOP_ |
| 129 |
{ |
| 130 |
UINT32 ulChannelHndl; /* Echo cancelling channel on which to play the buffer. */ |
| 131 |
UINT32 ulPlayoutPort; /* Selected channel port where to play to tone. */ |
| 132 |
BOOL fStopCleanly; /* Whether or not the skip will be clean. */ |
| 133 |
|
| 134 |
PBOOL pfAlreadyStopped; /* Whether playout was already stopped or not. */ |
| 135 |
PBOOL pfNotifyOnPlayoutStop; /* Whether the user chosed to receive an event on playout stop. */ |
| 136 |
|
| 137 |
} tOCT6100_BUFFER_PLAYOUT_STOP, *tPOCT6100_BUFFER_PLAYOUT_STOP; |
| 138 |
|
| 139 |
/************************** FUNCTION PROTOTYPES *****************************/ |
| 140 |
|
| 141 |
UINT32 Oct6100BufferPlayoutLoadDef( |
| 142 |
OUT tPOCT6100_BUFFER_LOAD f_pBufferLoad ); |
| 143 |
UINT32 Oct6100BufferPlayoutLoad( |
| 144 |
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, |
| 145 |
IN OUT tPOCT6100_BUFFER_LOAD f_pBufferLoad ); |
| 146 |
|
| 147 |
UINT32 Oct6100BufferPlayoutLoadBlockInitDef( |
| 148 |
OUT tPOCT6100_BUFFER_LOAD_BLOCK_INIT f_pBufferLoadBlockInit ); |
| 149 |
UINT32 Oct6100BufferPlayoutLoadBlockInit( |
| 150 |
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, |
| 151 |
IN OUT tPOCT6100_BUFFER_LOAD_BLOCK_INIT f_pBufferLoadBlockInit ); |
| 152 |
|
| 153 |
UINT32 Oct6100BufferPlayoutLoadBlockDef( |
| 154 |
OUT tPOCT6100_BUFFER_LOAD_BLOCK f_pBufferLoadBlock ); |
| 155 |
UINT32 Oct6100BufferPlayoutLoadBlock( |
| 156 |
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, |
| 157 |
IN OUT tPOCT6100_BUFFER_LOAD_BLOCK f_pBufferLoadBlock ); |
| 158 |
|
| 159 |
UINT32 Oct6100BufferPlayoutUnloadDef( |
| 160 |
OUT tPOCT6100_BUFFER_UNLOAD f_pBufferUnload ); |
| 161 |
UINT32 Oct6100BufferPlayoutUnload( |
| 162 |
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, |
| 163 |
IN OUT tPOCT6100_BUFFER_UNLOAD f_pBufferUnload ); |
| 164 |
|
| 165 |
UINT32 Oct6100BufferPlayoutAddDef( |
| 166 |
OUT tPOCT6100_BUFFER_PLAYOUT_ADD f_pBufferPlayoutAdd ); |
| 167 |
UINT32 Oct6100BufferPlayoutAdd( |
| 168 |
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, |
| 169 |
IN OUT tPOCT6100_BUFFER_PLAYOUT_ADD f_pBufferPlayoutAdd ); |
| 170 |
|
| 171 |
UINT32 Oct6100BufferPlayoutStartDef( |
| 172 |
OUT tPOCT6100_BUFFER_PLAYOUT_START f_pBufferPlayoutStart ); |
| 173 |
UINT32 Oct6100BufferPlayoutStart( |
| 174 |
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, |
| 175 |
IN OUT tPOCT6100_BUFFER_PLAYOUT_START f_pBufferPlayoutStart ); |
| 176 |
|
| 177 |
UINT32 Oct6100BufferPlayoutStopDef( |
| 178 |
OUT tPOCT6100_BUFFER_PLAYOUT_STOP f_pBufferPlayoutStop ); |
| 179 |
UINT32 Oct6100BufferPlayoutStop( |
| 180 |
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, |
| 181 |
IN OUT tPOCT6100_BUFFER_PLAYOUT_STOP f_pBufferPlayoutStop ); |
| 182 |
|
| 183 |
#endif /* __OCT6100_PLAYOUT_BUF_PUB_H__ */ |