| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bape_path_priv.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/6 $ |
|---|
| 12 | * $brcm_Date: 6/20/11 7:02p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: APE Path routines |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/ape/7422/bape_path_priv.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/6 6/20/11 7:02p jgarrett |
|---|
| 21 | * SW7425-406: Adding input scaling coefficients to mixer |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/5 6/14/11 6:49p gskerl |
|---|
| 24 | * SW7425-321: Added prototypes for PathNode enumeration functions |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/4 5/18/11 6:50p jgarrett |
|---|
| 27 | * SW7425-408: Adding preliminary DDRE support |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/3 3/21/11 7:08p jgarrett |
|---|
| 30 | * SW7422-356: Adding MuxOutput |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/2 3/3/11 6:31p jgarrett |
|---|
| 33 | * SW7422-146: Adding SRC and DSOLA and path review feedback |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/1 2/28/11 1:28p jgarrett |
|---|
| 36 | * SW7422-146: Filter graph reworked to remove mixer dependencies |
|---|
| 37 | * |
|---|
| 38 | ***************************************************************************/ |
|---|
| 39 | |
|---|
| 40 | #include "bape_types.h" |
|---|
| 41 | #include "bape_priv.h" |
|---|
| 42 | |
|---|
| 43 | #ifndef BAPE_PATH_PRIV_H_ |
|---|
| 44 | #define BAPE_PATH_PRIV_H_ |
|---|
| 45 | |
|---|
| 46 | /*************************************************************************** |
|---|
| 47 | Summary: |
|---|
| 48 | Build paths for all downstream connections from a node |
|---|
| 49 | |
|---|
| 50 | Description: |
|---|
| 51 | FMM Resources will be acquired as needed. DSP stages will be added to |
|---|
| 52 | task create settings as needed. |
|---|
| 53 | ***************************************************************************/ |
|---|
| 54 | BERR_Code BAPE_PathNode_P_AcquirePathResources( |
|---|
| 55 | BAPE_PathNode *pNode |
|---|
| 56 | ); |
|---|
| 57 | |
|---|
| 58 | /*************************************************************************** |
|---|
| 59 | Summary: |
|---|
| 60 | Teardown paths for all downstream connections from a node as much as possible |
|---|
| 61 | |
|---|
| 62 | Description: |
|---|
| 63 | FMM Resources will be released. DSP Mixers will also be destroyed. |
|---|
| 64 | ***************************************************************************/ |
|---|
| 65 | void BAPE_PathNode_P_ReleasePathResources( |
|---|
| 66 | BAPE_PathNode *pNode |
|---|
| 67 | ); |
|---|
| 68 | |
|---|
| 69 | /*************************************************************************** |
|---|
| 70 | Summary: |
|---|
| 71 | Configure allocated resources. |
|---|
| 72 | |
|---|
| 73 | Description: |
|---|
| 74 | FMM Resources will be configured from producer -> consumer. DSP task is |
|---|
| 75 | allocated prior to this call, and stage settings will be applied. |
|---|
| 76 | ***************************************************************************/ |
|---|
| 77 | BERR_Code BAPE_PathNode_P_ConfigurePathResources( |
|---|
| 78 | BAPE_PathNode *pNode |
|---|
| 79 | ); |
|---|
| 80 | |
|---|
| 81 | /*************************************************************************** |
|---|
| 82 | Summary: |
|---|
| 83 | Start paths for all downstream connections from a node |
|---|
| 84 | |
|---|
| 85 | Description: |
|---|
| 86 | This will start the nodes in the path from consumer -> producer. |
|---|
| 87 | ***************************************************************************/ |
|---|
| 88 | BERR_Code BAPE_PathNode_P_StartPaths( |
|---|
| 89 | BAPE_PathNode *pNode |
|---|
| 90 | ); |
|---|
| 91 | |
|---|
| 92 | /*************************************************************************** |
|---|
| 93 | Summary: |
|---|
| 94 | Stop paths for downstream connections from this node |
|---|
| 95 | |
|---|
| 96 | Description: |
|---|
| 97 | This will stop the nodes in the path from producer -> consumer. The decoder |
|---|
| 98 | task handle is invalidated during this call. |
|---|
| 99 | ***************************************************************************/ |
|---|
| 100 | void BAPE_PathNode_P_StopPaths( |
|---|
| 101 | BAPE_PathNode *pNode |
|---|
| 102 | ); |
|---|
| 103 | |
|---|
| 104 | /*************************************************************************** |
|---|
| 105 | Summary: |
|---|
| 106 | Determine if a connection is possible |
|---|
| 107 | ***************************************************************************/ |
|---|
| 108 | BERR_Code BAPE_PathNode_P_ConnectionSupported( |
|---|
| 109 | BAPE_PathNode *pNode, |
|---|
| 110 | BAPE_Connector input |
|---|
| 111 | ); |
|---|
| 112 | |
|---|
| 113 | /*************************************************************************** |
|---|
| 114 | Summary: |
|---|
| 115 | Make a connection |
|---|
| 116 | ***************************************************************************/ |
|---|
| 117 | BERR_Code BAPE_PathNode_P_AddInput( |
|---|
| 118 | BAPE_PathNode *pNode, |
|---|
| 119 | BAPE_Connector input |
|---|
| 120 | ); |
|---|
| 121 | |
|---|
| 122 | /*************************************************************************** |
|---|
| 123 | Summary: |
|---|
| 124 | Destroy a connection |
|---|
| 125 | ***************************************************************************/ |
|---|
| 126 | BERR_Code BAPE_PathNode_P_RemoveInput( |
|---|
| 127 | BAPE_PathNode *pNode, |
|---|
| 128 | BAPE_Connector input |
|---|
| 129 | ); |
|---|
| 130 | |
|---|
| 131 | /*************************************************************************** |
|---|
| 132 | Summary: |
|---|
| 133 | Remove all inputs |
|---|
| 134 | ***************************************************************************/ |
|---|
| 135 | BERR_Code BAPE_PathNode_P_RemoveAllInputs( |
|---|
| 136 | BAPE_PathNode *pNode |
|---|
| 137 | ); |
|---|
| 138 | |
|---|
| 139 | /*************************************************************************** |
|---|
| 140 | Summary: |
|---|
| 141 | Get output status for this node |
|---|
| 142 | ***************************************************************************/ |
|---|
| 143 | void BAPE_PathNode_P_GetOutputStatus( |
|---|
| 144 | BAPE_PathNode *pNode, |
|---|
| 145 | BAPE_PathNodeOutputStatus *pStatus /* [out] */ |
|---|
| 146 | ); |
|---|
| 147 | |
|---|
| 148 | /*************************************************************************** |
|---|
| 149 | Summary: |
|---|
| 150 | Search for consumers by a type |
|---|
| 151 | ***************************************************************************/ |
|---|
| 152 | void BAPE_PathNode_P_FindConsumersByType( |
|---|
| 153 | BAPE_PathNode *pNode, |
|---|
| 154 | BAPE_PathNodeType type, |
|---|
| 155 | unsigned maxConsumers, |
|---|
| 156 | unsigned *pNumFound, /* [out] */ |
|---|
| 157 | BAPE_PathNode **pConsumers /* [out] Must be an array of at least maxConsumers length */ |
|---|
| 158 | ); |
|---|
| 159 | |
|---|
| 160 | /*************************************************************************** |
|---|
| 161 | Summary: |
|---|
| 162 | Search for consumers by a type and subtype |
|---|
| 163 | ***************************************************************************/ |
|---|
| 164 | void BAPE_PathNode_P_FindConsumersBySubtype( |
|---|
| 165 | BAPE_PathNode *pNode, |
|---|
| 166 | BAPE_PathNodeType type, |
|---|
| 167 | unsigned subtype, |
|---|
| 168 | unsigned maxConsumers, |
|---|
| 169 | unsigned *pNumFound, /* [out] */ |
|---|
| 170 | BAPE_PathNode **pConsumers /* [out] Must be an array of at least maxConsumers length */ |
|---|
| 171 | ); |
|---|
| 172 | |
|---|
| 173 | /*************************************************************************** |
|---|
| 174 | Summary: |
|---|
| 175 | Determine if a node is a consumer from this node |
|---|
| 176 | ***************************************************************************/ |
|---|
| 177 | bool BAPE_PathNode_P_NodeIsConsumer( |
|---|
| 178 | BAPE_PathNode *pSourceNode, |
|---|
| 179 | BAPE_PathNode *pConsumerNode |
|---|
| 180 | ); |
|---|
| 181 | |
|---|
| 182 | /*************************************************************************** |
|---|
| 183 | Summary: |
|---|
| 184 | Remove all inputs |
|---|
| 185 | ***************************************************************************/ |
|---|
| 186 | BERR_Code BAPE_PathNode_P_RemoveAllInputs( |
|---|
| 187 | BAPE_PathNode *pNode |
|---|
| 188 | ); |
|---|
| 189 | |
|---|
| 190 | /*************************************************************************** |
|---|
| 191 | Summary: |
|---|
| 192 | Set an connector's sample rate on the fly (used with decoders) |
|---|
| 193 | ***************************************************************************/ |
|---|
| 194 | void BAPE_Connector_P_SampleRateChange_isr( |
|---|
| 195 | BAPE_Connector connector |
|---|
| 196 | ); |
|---|
| 197 | |
|---|
| 198 | /*************************************************************************** |
|---|
| 199 | Summary: |
|---|
| 200 | Set an connector's sample rate on the fly (used with decoders) |
|---|
| 201 | ***************************************************************************/ |
|---|
| 202 | BERR_Code BAPE_Connector_P_FormatChange( |
|---|
| 203 | BAPE_Connector connector |
|---|
| 204 | ); |
|---|
| 205 | |
|---|
| 206 | /*************************************************************************** |
|---|
| 207 | Summary: |
|---|
| 208 | Get number of downstream connections for a connector |
|---|
| 209 | ***************************************************************************/ |
|---|
| 210 | unsigned BAPE_Connector_P_GetNumConnections( |
|---|
| 211 | BAPE_Connector connector |
|---|
| 212 | ); |
|---|
| 213 | |
|---|
| 214 | /*************************************************************************** |
|---|
| 215 | Summary: |
|---|
| 216 | Get a connection between a connector and a destination node |
|---|
| 217 | ***************************************************************************/ |
|---|
| 218 | BAPE_PathConnection *BAPE_Connector_P_GetConnectionToSink( |
|---|
| 219 | BAPE_Connector connector, |
|---|
| 220 | BAPE_PathNode *pSink |
|---|
| 221 | ); |
|---|
| 222 | |
|---|
| 223 | /*************************************************************************** |
|---|
| 224 | Summary: |
|---|
| 225 | Set the connector mute state |
|---|
| 226 | ***************************************************************************/ |
|---|
| 227 | void BAPE_Connector_P_SetMute( |
|---|
| 228 | BAPE_Connector connector, |
|---|
| 229 | bool muted |
|---|
| 230 | ); |
|---|
| 231 | |
|---|
| 232 | /*************************************************************************** |
|---|
| 233 | Summary: |
|---|
| 234 | Remove all downstream connections from this connector |
|---|
| 235 | ***************************************************************************/ |
|---|
| 236 | void BAPE_Connector_P_RemoveAllConnections( |
|---|
| 237 | BAPE_Connector connector |
|---|
| 238 | ); |
|---|
| 239 | |
|---|
| 240 | /*************************************************************************** |
|---|
| 241 | Summary: |
|---|
| 242 | Returns a null-terminated string representation of a BAPE_PathNodeType enum. |
|---|
| 243 | ***************************************************************************/ |
|---|
| 244 | const char *BAPE_PathNode_P_PathNodeTypeToText( |
|---|
| 245 | BAPE_PathNodeType pathNodeType |
|---|
| 246 | ); |
|---|
| 247 | |
|---|
| 248 | /*************************************************************************** |
|---|
| 249 | Summary: |
|---|
| 250 | Define a data type for the callback used by the following "enumerate" |
|---|
| 251 | functions. The callback arguments are: |
|---|
| 252 | pNode: pointer to the current node |
|---|
| 253 | level: the depth of the current node |
|---|
| 254 | index: the horizontal position of the current node (within the specified depth) |
|---|
| 255 | |
|---|
| 256 | ***************************************************************************/ |
|---|
| 257 | typedef unsigned (*BAPE_PathNode_P_EnumerateCallback)( |
|---|
| 258 | BAPE_PathNode *pNode, |
|---|
| 259 | int level, |
|---|
| 260 | int index |
|---|
| 261 | ); |
|---|
| 262 | |
|---|
| 263 | /*************************************************************************** |
|---|
| 264 | Summary: |
|---|
| 265 | Do a depth-first, pre-order traversal of the downstream PathNodes. The |
|---|
| 266 | specified callback will be called for each PathNode visited (except for the |
|---|
| 267 | starting PathNode) |
|---|
| 268 | ***************************************************************************/ |
|---|
| 269 | BERR_Code BAPE_PathNode_P_EnumerateUpstreamPathNodes( |
|---|
| 270 | BAPE_PathNode *pPathNode, |
|---|
| 271 | int level, |
|---|
| 272 | BAPE_PathNode_P_EnumerateCallback callback |
|---|
| 273 | ); |
|---|
| 274 | |
|---|
| 275 | |
|---|
| 276 | /*************************************************************************** |
|---|
| 277 | Summary: |
|---|
| 278 | Do a depth-first, pre-order traversal of the upstream PathNodes. The |
|---|
| 279 | specified callback will be called for each PathNode visited (except for the |
|---|
| 280 | starting PathNode) |
|---|
| 281 | ***************************************************************************/ |
|---|
| 282 | BERR_Code BAPE_PathNode_P_EnumerateDownstreamPathNodes( |
|---|
| 283 | BAPE_PathNode *pPathNode, |
|---|
| 284 | int level, |
|---|
| 285 | BAPE_PathNode_P_EnumerateCallback callback |
|---|
| 286 | ); |
|---|
| 287 | #endif |
|---|