Changeset 89484 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 3, 2021 1:00:54 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp
r89258 r89484 36 36 *********************************************************************************************************************************/ 37 37 /** Null audio stream. */ 38 typedef struct NULLAUDIOSTREAM38 typedef struct DRVHSTAUDNULLSTREAM 39 39 { 40 40 /** Common part. */ … … 42 42 /** The stream's acquired configuration. */ 43 43 PDMAUDIOSTREAMCFG Cfg; 44 } NULLAUDIOSTREAM;44 } DRVHSTAUDNULLSTREAM; 45 45 /** Pointer to a null audio stream. */ 46 typedef NULLAUDIOSTREAM *PNULLAUDIOSTREAM;46 typedef DRVHSTAUDNULLSTREAM *PDRVHSTAUDNULLSTREAM; 47 47 48 48 … … 51 51 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetConfig} 52 52 */ 53 static DECLCALLBACK(int) drvH ostNullAudioHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)53 static DECLCALLBACK(int) drvHstAudNullHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg) 54 54 { 55 55 NOREF(pInterface); … … 60 60 */ 61 61 RTStrCopy(pBackendCfg->szName, sizeof(pBackendCfg->szName), "NULL audio"); 62 pBackendCfg->cbStream = sizeof( NULLAUDIOSTREAM);62 pBackendCfg->cbStream = sizeof(DRVHSTAUDNULLSTREAM); 63 63 pBackendCfg->fFlags = 0; 64 64 pBackendCfg->cMaxStreamsOut = 1; /* Output */ … … 72 72 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus} 73 73 */ 74 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvH ostNullAudioHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)74 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHstAudNullHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir) 75 75 { 76 76 RT_NOREF(pInterface, enmDir); … … 82 82 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCreate} 83 83 */ 84 static DECLCALLBACK(int) drvH ostNullAudioHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,85 84 static DECLCALLBACK(int) drvHstAudNullHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 85 PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq) 86 86 { 87 87 RT_NOREF(pInterface); 88 P NULLAUDIOSTREAM pStreamNull = (PNULLAUDIOSTREAM)pStream;88 PDRVHSTAUDNULLSTREAM pStreamNull = (PDRVHSTAUDNULLSTREAM)pStream; 89 89 AssertPtrReturn(pStreamNull, VERR_INVALID_POINTER); 90 90 AssertPtrReturn(pCfgReq, VERR_INVALID_POINTER); … … 99 99 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 100 100 */ 101 static DECLCALLBACK(int) drvHostNullAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 102 bool fImmediate) 101 static DECLCALLBACK(int) drvHstAudNullHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, bool fImmediate) 103 102 { 104 103 RT_NOREF(pInterface, pStream, fImmediate); … … 110 109 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 111 110 */ 112 static DECLCALLBACK(int) drvH ostNullAudioHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)111 static DECLCALLBACK(int) drvHstAudNullHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 113 112 { 114 113 RT_NOREF(pInterface, pStream); … … 120 119 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl} 121 120 */ 122 static DECLCALLBACK(int) drvH ostNullAudioHA_StreamControl(PPDMIHOSTAUDIO pInterface,123 121 static DECLCALLBACK(int) drvHstAudNullHA_StreamControl(PPDMIHOSTAUDIO pInterface, 122 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd) 124 123 { 125 124 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method, … … 130 129 { 131 130 case PDMAUDIOSTREAMCMD_ENABLE: 132 return drvH ostNullAudioHA_StreamControlStub(pInterface, pStream);131 return drvHstAudNullHA_StreamControlStub(pInterface, pStream); 133 132 case PDMAUDIOSTREAMCMD_DISABLE: 134 return drvH ostNullAudioHA_StreamControlStub(pInterface, pStream);133 return drvHstAudNullHA_StreamControlStub(pInterface, pStream); 135 134 case PDMAUDIOSTREAMCMD_PAUSE: 136 return drvH ostNullAudioHA_StreamControlStub(pInterface, pStream);135 return drvHstAudNullHA_StreamControlStub(pInterface, pStream); 137 136 case PDMAUDIOSTREAMCMD_RESUME: 138 return drvH ostNullAudioHA_StreamControlStub(pInterface, pStream);137 return drvHstAudNullHA_StreamControlStub(pInterface, pStream); 139 138 case PDMAUDIOSTREAMCMD_DRAIN: 140 return drvH ostNullAudioHA_StreamControlStub(pInterface, pStream);139 return drvHstAudNullHA_StreamControlStub(pInterface, pStream); 141 140 142 141 case PDMAUDIOSTREAMCMD_END: … … 153 152 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable} 154 153 */ 155 static DECLCALLBACK(uint32_t) drvH ostNullAudioHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)154 static DECLCALLBACK(uint32_t) drvHstAudNullHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 156 155 { 157 156 RT_NOREF(pInterface, pStream); … … 164 163 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetWritable} 165 164 */ 166 static DECLCALLBACK(uint32_t) drvH ostNullAudioHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)165 static DECLCALLBACK(uint32_t) drvHstAudNullHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 167 166 { 168 167 RT_NOREF(pInterface, pStream); … … 174 173 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetPending} 175 174 */ 176 static DECLCALLBACK(uint32_t) drvH ostNullAudioHA_StreamGetPending(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)175 static DECLCALLBACK(uint32_t) drvHstAudNullHA_StreamGetPending(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 177 176 { 178 177 RT_NOREF(pInterface, pStream); … … 184 183 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetState} 185 184 */ 186 static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvH ostNullAudioHA_StreamGetState(PPDMIHOSTAUDIO pInterface,187 185 static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHstAudNullHA_StreamGetState(PPDMIHOSTAUDIO pInterface, 186 PPDMAUDIOBACKENDSTREAM pStream) 188 187 { 189 188 RT_NOREF(pInterface); … … 202 201 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPlay} 203 202 */ 204 static DECLCALLBACK(int) drvH ostNullAudioHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,205 203 static DECLCALLBACK(int) drvHstAudNullHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 204 const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten) 206 205 { 207 206 RT_NOREF(pInterface, pStream, pvBuf); … … 216 215 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCapture} 217 216 */ 218 static DECLCALLBACK(int) drvH ostNullAudioHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,219 217 static DECLCALLBACK(int) drvHstAudNullHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 218 void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead) 220 219 { 221 220 RT_NOREF(pInterface); 222 P NULLAUDIOSTREAM pStreamNull = (PNULLAUDIOSTREAM)pStream;221 PDRVHSTAUDNULLSTREAM pStreamNull = (PDRVHSTAUDNULLSTREAM)pStream; 223 222 224 223 /** @todo rate limit this? */ … … 238 237 DECL_HIDDEN_CONST(PDMIHOSTAUDIO) const g_DrvHostAudioNull = 239 238 { 240 /* .pfnGetConfig =*/ drvH ostNullAudioHA_GetConfig,239 /* .pfnGetConfig =*/ drvHstAudNullHA_GetConfig, 241 240 /* .pfnGetDevices =*/ NULL, 242 241 /* .pfnSetDevice =*/ NULL, 243 /* .pfnGetStatus =*/ drvH ostNullAudioHA_GetStatus,242 /* .pfnGetStatus =*/ drvHstAudNullHA_GetStatus, 244 243 /* .pfnDoOnWorkerThread =*/ NULL, 245 244 /* .pfnStreamConfigHint =*/ NULL, 246 /* .pfnStreamCreate =*/ drvH ostNullAudioHA_StreamCreate,245 /* .pfnStreamCreate =*/ drvHstAudNullHA_StreamCreate, 247 246 /* .pfnStreamInitAsync =*/ NULL, 248 /* .pfnStreamDestroy =*/ drvH ostNullAudioHA_StreamDestroy,247 /* .pfnStreamDestroy =*/ drvHstAudNullHA_StreamDestroy, 249 248 /* .pfnStreamNotifyDeviceChanged =*/ NULL, 250 /* .pfnStreamControl =*/ drvH ostNullAudioHA_StreamControl,251 /* .pfnStreamGetReadable =*/ drvH ostNullAudioHA_StreamGetReadable,252 /* .pfnStreamGetWritable =*/ drvH ostNullAudioHA_StreamGetWritable,253 /* .pfnStreamGetPending =*/ drvH ostNullAudioHA_StreamGetPending,254 /* .pfnStreamGetState =*/ drvH ostNullAudioHA_StreamGetState,255 /* .pfnStreamPlay =*/ drvH ostNullAudioHA_StreamPlay,256 /* .pfnStreamCapture =*/ drvH ostNullAudioHA_StreamCapture,249 /* .pfnStreamControl =*/ drvHstAudNullHA_StreamControl, 250 /* .pfnStreamGetReadable =*/ drvHstAudNullHA_StreamGetReadable, 251 /* .pfnStreamGetWritable =*/ drvHstAudNullHA_StreamGetWritable, 252 /* .pfnStreamGetPending =*/ drvHstAudNullHA_StreamGetPending, 253 /* .pfnStreamGetState =*/ drvHstAudNullHA_StreamGetState, 254 /* .pfnStreamPlay =*/ drvHstAudNullHA_StreamPlay, 255 /* .pfnStreamCapture =*/ drvHstAudNullHA_StreamCapture, 257 256 }; 258 257 … … 261 260 * @interface_method_impl{PDMIBASE,pfnQueryInterface} 262 261 */ 263 static DECLCALLBACK(void *) drvH ostNullAudioQueryInterface(PPDMIBASE pInterface, const char *pszIID)262 static DECLCALLBACK(void *) drvHstAudNullQueryInterface(PPDMIBASE pInterface, const char *pszIID) 264 263 { 265 264 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); … … 277 276 * @copydoc FNPDMDRVCONSTRUCT 278 277 */ 279 static DECLCALLBACK(int) drvH ostNullAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)278 static DECLCALLBACK(int) drvHstAudNullConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags) 280 279 { 281 280 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); … … 288 287 */ 289 288 /* IBase */ 290 pDrvIns->IBase.pfnQueryInterface = drvH ostNullAudioQueryInterface;289 pDrvIns->IBase.pfnQueryInterface = drvHstAudNullQueryInterface; 291 290 /* IHostAudio */ 292 291 *pThis = g_DrvHostAudioNull; … … 320 319 sizeof(PDMIHOSTAUDIO), 321 320 /* pfnConstruct */ 322 drvH ostNullAudioConstruct,321 drvHstAudNullConstruct, 323 322 /* pfnDestruct */ 324 323 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.