| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2012, 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_input_capture.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/6 $ |
|---|
| 12 | * $brcm_Date: 2/9/12 11:21a $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: Audio Input Capture Interface |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/ape/7422/bape_input_capture.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/6 2/9/12 11:21a jgarrett |
|---|
| 21 | * SW7425-2074: Enabling input halt and revising MAI shutown for |
|---|
| 22 | * multichannel PCM |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/5 3/1/11 3:25p jgarrett |
|---|
| 25 | * SW7422-146: Moving sample rate to input port from input capture |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/4 2/22/11 5:43p jgarrett |
|---|
| 28 | * SW7422-146: Implemented type renaming based on filter graph review |
|---|
| 29 | * comments |
|---|
| 30 | * |
|---|
| 31 | * Hydra_Software_Devel/3 1/5/11 11:32a jgarrett |
|---|
| 32 | * SW7422-146: Moving sample rate to input capture |
|---|
| 33 | * |
|---|
| 34 | * Hydra_Software_Devel/2 12/16/10 4:04p jgarrett |
|---|
| 35 | * SW7422-146: Initial compilable APE for 7422 |
|---|
| 36 | * |
|---|
| 37 | * Hydra_Software_Devel/1 12/14/10 2:16p jgarrett |
|---|
| 38 | * SW7422-146: Adding initial API for APE/DSP |
|---|
| 39 | * |
|---|
| 40 | ***************************************************************************/ |
|---|
| 41 | |
|---|
| 42 | #ifndef BAPE_INPUT_CAPTURE_H_ |
|---|
| 43 | #define BAPE_INPUT_CAPTURE_H_ |
|---|
| 44 | |
|---|
| 45 | /*************************************************************************** |
|---|
| 46 | Summary: |
|---|
| 47 | InputCapture Handle |
|---|
| 48 | ***************************************************************************/ |
|---|
| 49 | typedef struct BAPE_InputCapture *BAPE_InputCaptureHandle; |
|---|
| 50 | |
|---|
| 51 | /*************************************************************************** |
|---|
| 52 | Summary: |
|---|
| 53 | InputCapture open settings |
|---|
| 54 | ***************************************************************************/ |
|---|
| 55 | typedef struct BAPE_InputCaptureOpenSettings |
|---|
| 56 | { |
|---|
| 57 | bool useLargeRingBuffers; /* If true, large ringbuffers will be used, |
|---|
| 58 | otherwise standard buffers will be used. */ |
|---|
| 59 | } BAPE_InputCaptureOpenSettings; |
|---|
| 60 | |
|---|
| 61 | /*************************************************************************** |
|---|
| 62 | Summary: |
|---|
| 63 | Get Default InputCapture Settings |
|---|
| 64 | ***************************************************************************/ |
|---|
| 65 | void BAPE_InputCapture_GetDefaultOpenSettings( |
|---|
| 66 | BAPE_InputCaptureOpenSettings *pSettings |
|---|
| 67 | ); |
|---|
| 68 | |
|---|
| 69 | /*************************************************************************** |
|---|
| 70 | Summary: |
|---|
| 71 | Open an input capture channel |
|---|
| 72 | ***************************************************************************/ |
|---|
| 73 | BERR_Code BAPE_InputCapture_Open( |
|---|
| 74 | BAPE_Handle deviceHandle, |
|---|
| 75 | unsigned index, |
|---|
| 76 | const BAPE_InputCaptureOpenSettings *pSettings, |
|---|
| 77 | BAPE_InputCaptureHandle *pHandle /* [out] */ |
|---|
| 78 | ); |
|---|
| 79 | |
|---|
| 80 | /*************************************************************************** |
|---|
| 81 | Summary: |
|---|
| 82 | Close an input capture channel |
|---|
| 83 | ***************************************************************************/ |
|---|
| 84 | void BAPE_InputCapture_Close( |
|---|
| 85 | BAPE_InputCaptureHandle handle |
|---|
| 86 | ); |
|---|
| 87 | |
|---|
| 88 | /*************************************************************************** |
|---|
| 89 | Summary: |
|---|
| 90 | InputCapture Start Settings |
|---|
| 91 | ***************************************************************************/ |
|---|
| 92 | typedef struct BAPE_InputCaptureStartSettings |
|---|
| 93 | { |
|---|
| 94 | BAPE_InputPort input; |
|---|
| 95 | } BAPE_InputCaptureStartSettings; |
|---|
| 96 | |
|---|
| 97 | /*************************************************************************** |
|---|
| 98 | Summary: |
|---|
| 99 | Get Default InputCapture Start Settings |
|---|
| 100 | ***************************************************************************/ |
|---|
| 101 | void BAPE_InputCapture_GetDefaultStartSettings( |
|---|
| 102 | BAPE_InputCaptureStartSettings *pSettings /* [out] */ |
|---|
| 103 | ); |
|---|
| 104 | |
|---|
| 105 | /*************************************************************************** |
|---|
| 106 | Summary: |
|---|
| 107 | Start InputCapture |
|---|
| 108 | ***************************************************************************/ |
|---|
| 109 | BERR_Code BAPE_InputCapture_Start( |
|---|
| 110 | BAPE_InputCaptureHandle handle, |
|---|
| 111 | const BAPE_InputCaptureStartSettings *pSettings |
|---|
| 112 | ); |
|---|
| 113 | |
|---|
| 114 | /*************************************************************************** |
|---|
| 115 | Summary: |
|---|
| 116 | Stop InputCapture |
|---|
| 117 | ***************************************************************************/ |
|---|
| 118 | void BAPE_InputCapture_Stop( |
|---|
| 119 | BAPE_InputCaptureHandle handle |
|---|
| 120 | ); |
|---|
| 121 | |
|---|
| 122 | /*************************************************************************** |
|---|
| 123 | Summary: |
|---|
| 124 | Get Audio Source Connector for output data |
|---|
| 125 | ***************************************************************************/ |
|---|
| 126 | void BAPE_InputCapture_GetConnector( |
|---|
| 127 | BAPE_InputCaptureHandle handle, |
|---|
| 128 | BAPE_Connector *pConnector /* [out] */ |
|---|
| 129 | ); |
|---|
| 130 | |
|---|
| 131 | /*************************************************************************** |
|---|
| 132 | Summary: |
|---|
| 133 | Input Capture Interrupt Handlers |
|---|
| 134 | ***************************************************************************/ |
|---|
| 135 | typedef struct BAPE_InputCaptureInterruptHandlers |
|---|
| 136 | { |
|---|
| 137 | /* This interrupt fires when the active input has changed to an incompatible format and been halted. |
|---|
| 138 | The application must call BAPE_InputCapture_Stop() and BAPE_InputCapture_Start() to resume processing. */ |
|---|
| 139 | struct |
|---|
| 140 | { |
|---|
| 141 | void (*pCallback_isr)(void *pParam1, int param2); |
|---|
| 142 | void *pParam1; |
|---|
| 143 | int param2; |
|---|
| 144 | } inputHalted; |
|---|
| 145 | } BAPE_InputCaptureInterruptHandlers; |
|---|
| 146 | |
|---|
| 147 | /*************************************************************************** |
|---|
| 148 | Summary: |
|---|
| 149 | Get Currently Registered Interrupt Handlers |
|---|
| 150 | ***************************************************************************/ |
|---|
| 151 | void BAPE_InputCapture_GetInterruptHandlers( |
|---|
| 152 | BAPE_InputCaptureHandle handle, |
|---|
| 153 | BAPE_InputCaptureInterruptHandlers *pInterrupts /* [out] */ |
|---|
| 154 | ); |
|---|
| 155 | |
|---|
| 156 | /*************************************************************************** |
|---|
| 157 | Summary: |
|---|
| 158 | Set Interrupt Handlers |
|---|
| 159 | |
|---|
| 160 | Description: |
|---|
| 161 | To disable any unwanted interrupt, pass NULL for its callback routine |
|---|
| 162 | ***************************************************************************/ |
|---|
| 163 | BERR_Code BAPE_InputCapture_SetInterruptHandlers( |
|---|
| 164 | BAPE_InputCaptureHandle handle, |
|---|
| 165 | const BAPE_InputCaptureInterruptHandlers *pInterrupts |
|---|
| 166 | ); |
|---|
| 167 | |
|---|
| 168 | #endif /* #ifndef BAPE_INPUT_CAPTURE_H_ */ |
|---|
| 169 | |
|---|