Changeset 61727 in vbox
- Timestamp:
- Jun 15, 2016 5:22:08 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
r61706 r61727 274 274 typedef struct COREAUDIOSTREAMCBCTX 275 275 { 276 /** Pointer to driver instance. */ 277 PDRVHOSTCOREAUDIO pThis; 276 278 /** The stream's direction. */ 277 279 PDMAUDIODIR enmDir; … … 351 353 352 354 353 static int coreAudioInitIn(PPDMAUDIOSTREAM pStream, uint32_t *pcSamples); 354 static int coreAudioReinitIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream); 355 static int coreAudioInitOut(PPDMAUDIOSTREAM pStream, uint32_t *pcSamples); 356 static int coreAudioReinitOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream); 355 static int coreAudioInitIn(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream, uint32_t *pcSamples); 356 static int coreAudioReinitIn(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream); 357 static int coreAudioInitOut(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream, uint32_t *pcSamples); 358 static int coreAudioReinitOut(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream); 359 static int coreAudioControlStreamIn(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd); 360 static int coreAudioControlStreamOut(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd); 361 static int coreAudioDestroyStreamIn(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream); 362 static int coreAudioDestroyStreamOut(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream); 363 357 364 static OSStatus coreAudioPlaybackAudioDevicePropertyChanged(AudioObjectID propertyID, UInt32 nAddresses, const AudioObjectPropertyAddress properties[], void *pvUser); 358 365 static OSStatus coreAudioPlaybackCb(void *pvUser, AudioUnitRenderActionFlags *pActionFlags, const AudioTimeStamp *pAudioTS, UInt32 uBusID, UInt32 cFrames, AudioBufferList* pBufData); 359 366 360 static int coreAudioControlStreamIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd); 361 static int coreAudioControlStreamOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd); 362 static int coreAudioDestroyStreamIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream); 363 static int coreAudioDestroyStreamOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream); 367 /** 368 * Does a (Re-)enumeration of the host's playback + capturing devices. 369 * 370 * @return IPRT status code. 371 * @param pThis Host audio driver instance. 372 * @param pCfg Where to store the enumeration results. 373 * @param fEnum Enumeration flags. 374 */ 375 static int coreAudioDevicesEnumerate(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOBACKENDCFG pCfg, bool fIn, uint32_t fEnum) 376 { 377 AssertPtrReturn(pThis, VERR_INVALID_POINTER); 378 /* pCfg is optional. */ 379 380 int rc = VINF_SUCCESS; 381 382 do 383 { 384 AudioObjectPropertyAddress propAdrDevList = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, 385 kAudioObjectPropertyElementMaster }; 386 UInt32 uSize = 0; 387 OSStatus err = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &propAdrDevList, 0, NULL, &uSize); 388 if (err != kAudioHardwareNoError) 389 break; 390 391 AudioDeviceID *pDevIDs = (AudioDeviceID *)alloca(uSize); 392 if (pDevIDs == NULL) 393 break; 394 395 err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &propAdrDevList, 0, NULL, &uSize, pDevIDs); 396 if (err != kAudioHardwareNoError) 397 break; 398 399 UInt32 cDevices = uSize / sizeof (AudioDeviceID); 400 for (UInt32 i = 0; i < cDevices; i++) 401 { 402 AudioDeviceID curDevID = pDevIDs[i]; 403 404 /* Check if the device is valid. */ 405 AudioObjectPropertyAddress propAddrCfg = { kAudioDevicePropertyStreamConfiguration, 406 fIn ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput, 407 kAudioObjectPropertyElementMaster }; 408 409 err = AudioObjectGetPropertyDataSize(curDevID, &propAddrCfg, 0, NULL, &uSize); 410 if (err != noErr) 411 continue; 412 413 AudioBufferList *pBufList = (AudioBufferList *)RTMemAlloc(uSize); 414 if (!pBufList) 415 continue; 416 417 bool fIsValid = false; 418 419 err = AudioObjectGetPropertyData(curDevID, &propAddrCfg, 0, NULL, &uSize, pBufList); 420 if (err == noErr) 421 { 422 for (UInt32 a = 0; a < pBufList->mNumberBuffers; a++) 423 { 424 fIsValid = pBufList->mBuffers[a].mNumberChannels > 0; 425 if (fIsValid) 426 break; 427 } 428 } 429 430 if (pBufList) 431 { 432 RTMemFree(pBufList); 433 pBufList = NULL; 434 } 435 436 if (!fIsValid) 437 continue; 438 439 /* Resolve the device's name. */ 440 AudioObjectPropertyAddress propAddrName = { kAudioObjectPropertyName, 441 fIn ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput, 442 kAudioObjectPropertyElementMaster }; 443 uSize = sizeof(CFStringRef); 444 CFStringRef pcfstrName = NULL; 445 446 err = AudioObjectGetPropertyData(curDevID, &propAddrName, 0, NULL, &uSize, &pcfstrName); 447 if (err != kAudioHardwareNoError) 448 continue; 449 450 CFIndex uMax = CFStringGetMaximumSizeForEncoding(CFStringGetLength(pcfstrName), kCFStringEncodingUTF8) + 1; 451 if (uMax) 452 { 453 char *pszName = (char *)RTStrAlloc(uMax); 454 if ( pszName 455 && CFStringGetCString(pcfstrName, pszName, uMax, kCFStringEncodingUTF8)) 456 { 457 LogRel2(("CoreAudio: Found %s device '%s'\n", fIn ? "recording" : "playback", pszName)); 458 459 if (pCfg) 460 { 461 if (fIn) 462 pCfg->cSources++; 463 else 464 pCfg->cSinks++; 465 } 466 } 467 468 if (pszName) 469 { 470 RTStrFree(pszName); 471 pszName = NULL; 472 } 473 } 474 475 CFRelease(pcfstrName); 476 } 477 478 } while (0); 479 480 LogFlowFuncLeaveRC(rc); 481 return rc; 482 } 483 484 /** 485 * Updates this host driver's internal status, according to the global, overall input/output 486 * state and all connected (native) audio streams. 487 * 488 * @param pThis Host audio driver instance. 489 * @param pCfg Where to store the backend configuration. Optional. 490 * @param fEnum Enumeration flags. 491 */ 492 int coreAudioUpdateStatusInternalEx(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOBACKENDCFG pCfg, uint32_t fEnum) 493 { 494 AssertPtrReturn(pThis, VERR_INVALID_POINTER); 495 /* pCfg is optional. */ 496 497 PDMAUDIOBACKENDCFG Cfg; 498 RT_ZERO(Cfg); 499 500 Cfg.cbStreamOut = sizeof(COREAUDIOSTREAMOUT); 501 Cfg.cbStreamIn = sizeof(COREAUDIOSTREAMIN); 502 Cfg.cMaxStreamsIn = UINT32_MAX; 503 Cfg.cMaxStreamsOut = UINT32_MAX; 504 505 int rc = coreAudioDevicesEnumerate(pThis, &Cfg, false /* fIn */, 0 /* fEnum */); 506 AssertRC(rc); 507 rc = coreAudioDevicesEnumerate(pThis, &Cfg, true /* fIn */, 0 /* fEnum */); 508 AssertRC(rc); 509 510 if (pCfg) 511 memcpy(pCfg, &Cfg, sizeof(PDMAUDIOBACKENDCFG)); 512 513 LogFlowFuncLeaveRC(rc); 514 return rc; 515 } 364 516 365 517 static DECLCALLBACK(OSStatus) drvHostCoreAudioDeviceStateChanged(AudioObjectID propertyID, … … 368 520 void *pvUser) 369 521 { 522 LogFlowFunc(("propertyID=%u nAddresses=%u pvUser=%p\n", propertyID, nAddresses, pvUser)); 523 370 524 PCOREAUDIOSTREAMCBCTX pCbCtx = (PCOREAUDIOSTREAMCBCTX)pvUser; 371 372 LogFlowFunc(("propertyID=%u nAddresses=%u pvUser=%p\n", propertyID, nAddresses, pvUser)); 525 AssertPtr(pCbCtx); 373 526 374 527 UInt32 uAlive = 1; … … 425 578 } 426 579 } 580 581 int rc2 = coreAudioDevicesEnumerate(pCbCtx->pThis, NULL /* pCfg */, false /* fIn */, 0 /* fEnum */); 582 AssertRC(rc2); 583 rc2 = coreAudioDevicesEnumerate(pCbCtx->pThis, NULL /* pCfg */, true /* fIn */, 0 /* fEnum */); 584 AssertRC(rc2); 427 585 428 586 return noErr; … … 439 597 LogFlowFunc(("propertyID=%u nAddresses=%u pvUser=%p\n", propertyID, nAddresses, pvUser)); 440 598 599 PCOREAUDIOSTREAMCBCTX pCbCtx = (PCOREAUDIOSTREAMCBCTX)pvUser; 600 AssertPtr(pCbCtx); 601 441 602 for (UInt32 idxAddress = 0; idxAddress < nAddresses; idxAddress++) 442 603 { … … 447 608 case kAudioHardwarePropertyDefaultInputDevice: 448 609 { 449 PCOREAUDIOSTREAMIN pStreamIn = (PCOREAUDIOSTREAMIN)pvUser;610 PCOREAUDIOSTREAMIN pStreamIn = pCbCtx->pIn; 450 611 451 612 /* This listener is called on every change of the hardware … … 472 633 case kAudioHardwarePropertyDefaultOutputDevice: 473 634 { 474 PCOREAUDIOSTREAMOUT pStreamOut = (PCOREAUDIOSTREAMOUT)pvUser;635 PCOREAUDIOSTREAMOUT pStreamOut = pCbCtx->pOut; 475 636 476 637 /* This listener is called on every change of the hardware … … 503 664 } 504 665 666 int rc2 = coreAudioDevicesEnumerate(pCbCtx->pThis, NULL /* pCfg */, false /* fIn */, 0 /* fEnum */); 667 AssertRC(rc2); 668 rc2 = coreAudioDevicesEnumerate(pCbCtx->pThis, NULL /* pCfg */, true /* fIn */, 0 /* fEnum */); 669 AssertRC(rc2); 670 505 671 /** @todo Implement callback notification here to let the audio connector / device emulation 506 672 * know that something has changed. */ … … 509 675 } 510 676 511 static int coreAudioReinitIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream) 512 { 513 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 514 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 515 677 static int coreAudioReinitIn(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream) 678 { 516 679 PCOREAUDIOSTREAMIN pStreamIn = (PCOREAUDIOSTREAMIN)pStream; 517 680 518 int rc = coreAudioDestroyStreamIn(p Interface, &pStreamIn->Stream);681 int rc = coreAudioDestroyStreamIn(pThis, &pStreamIn->Stream); 519 682 if (RT_SUCCESS(rc)) 520 683 { 521 rc = coreAudioInitIn( &pStreamIn->Stream, NULL /* pcSamples */);684 rc = coreAudioInitIn(pThis, &pStreamIn->Stream, NULL /* pcSamples */); 522 685 if (RT_SUCCESS(rc)) 523 rc = coreAudioControlStreamIn(p Interface, &pStreamIn->Stream, PDMAUDIOSTREAMCMD_ENABLE);686 rc = coreAudioControlStreamIn(pThis, &pStreamIn->Stream, PDMAUDIOSTREAMCMD_ENABLE); 524 687 } 525 688 … … 530 693 } 531 694 532 static int coreAudioReinitOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream) 533 { 534 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 535 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 536 695 static int coreAudioReinitOut(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream) 696 { 537 697 PCOREAUDIOSTREAMOUT pStreamOut = (PCOREAUDIOSTREAMOUT)pStream; 538 698 539 int rc = coreAudioDestroyStreamOut(p Interface, &pStreamOut->Stream);699 int rc = coreAudioDestroyStreamOut(pThis, &pStreamOut->Stream); 540 700 if (RT_SUCCESS(rc)) 541 701 { 542 rc = coreAudioInitOut( &pStreamOut->Stream, NULL /* pcSamples */);702 rc = coreAudioInitOut(pThis, &pStreamOut->Stream, NULL /* pcSamples */); 543 703 if (RT_SUCCESS(rc)) 544 rc = coreAudioControlStreamOut(p Interface, &pStreamOut->Stream, PDMAUDIOSTREAMCMD_ENABLE);704 rc = coreAudioControlStreamOut(pThis, &pStreamOut->Stream, PDMAUDIOSTREAMCMD_ENABLE); 545 705 } 546 706 … … 813 973 814 974 /** @todo Eventually split up this function, as this already is huge! */ 815 static int coreAudioInitIn(P PDMAUDIOSTREAM pStream, uint32_t *pcSamples)975 static int coreAudioInitIn(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream, uint32_t *pcSamples) 816 976 { 817 977 OSStatus err = noErr; … … 1170 1330 { 1171 1331 /* Set callback context. */ 1332 pStreamIn->cbCtx.pThis = pThis; 1172 1333 pStreamIn->cbCtx.enmDir = PDMAUDIODIR_IN; 1173 1334 pStreamIn->cbCtx.pIn = pStreamIn; … … 1194 1355 1195 1356 /** @todo Eventually split up this function, as this already is huge! */ 1196 static int coreAudioInitOut(P PDMAUDIOSTREAM pStream, uint32_t *pcSamples)1357 static int coreAudioInitOut(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream, uint32_t *pcSamples) 1197 1358 { 1198 1359 PCOREAUDIOSTREAMOUT pStreamOut = (PCOREAUDIOSTREAMOUT)pStream; … … 1456 1617 { 1457 1618 /* Set callback context. */ 1619 pStreamOut->cbCtx.pThis = pThis; 1458 1620 pStreamOut->cbCtx.enmDir = PDMAUDIODIR_OUT; 1459 1621 pStreamOut->cbCtx.pOut = pStreamOut; … … 1478 1640 return rc; 1479 1641 } 1480 1481 1642 1482 1643 /* Callback for getting notified when some of the properties of an audio device has changed. */ … … 1584 1745 /* Check if the audio device should be reinitialized. If so do it. */ 1585 1746 if (ASMAtomicReadU32(&pStreamIn->status) == CA_STATUS_REINIT) 1586 coreAudioReinitIn(p Interface, &pStreamIn->Stream);1747 coreAudioReinitIn(pThis, &pStreamIn->Stream); 1587 1748 1588 1749 if (ASMAtomicReadU32(&pStreamIn->status) != CA_STATUS_INIT) … … 1669 1830 if (ASMAtomicReadU32(&pStreamOut->status) == CA_STATUS_REINIT) 1670 1831 { 1671 rc = coreAudioReinitOut(p Interface, &pStreamOut->Stream);1832 rc = coreAudioReinitOut(pThis, &pStreamOut->Stream); 1672 1833 if (RT_FAILURE(rc)) 1673 1834 return rc; … … 1742 1903 } 1743 1904 1744 static DECLCALLBACK(int) coreAudioControlStreamOut(P PDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream,1745 P DMAUDIOSTREAMCMD enmStreamCmd)1905 static DECLCALLBACK(int) coreAudioControlStreamOut(PDRVHOSTCOREAUDIO pThis, 1906 PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd) 1746 1907 { 1747 1908 PCOREAUDIOSTREAMOUT pStreamOut = (PCOREAUDIOSTREAMOUT)pStream; … … 1818 1979 } 1819 1980 1820 static int coreAudioControlStreamIn(P PDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream,1821 P DMAUDIOSTREAMCMD enmStreamCmd)1981 static int coreAudioControlStreamIn(PDRVHOSTCOREAUDIO pThis, 1982 PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd) 1822 1983 { 1823 1984 PCOREAUDIOSTREAMIN pStreamIn = (PCOREAUDIOSTREAMIN)pStream; … … 1895 2056 } 1896 2057 1897 static int coreAudioDestroyStreamIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream) 1898 { 1899 PCOREAUDIOSTREAMIN pStreamIn = (PCOREAUDIOSTREAMIN) pStream; 1900 1901 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 1902 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 2058 static int coreAudioDestroyStreamIn(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream) 2059 { 2060 PCOREAUDIOSTREAMIN pStreamIn = (PCOREAUDIOSTREAMIN)pStream; 1903 2061 1904 2062 LogFlowFuncEnter(); … … 1913 2071 OSStatus err = noErr; 1914 2072 1915 int rc = coreAudioControlStreamIn(p Interface, &pStreamIn->Stream, PDMAUDIOSTREAMCMD_DISABLE);2073 int rc = coreAudioControlStreamIn(pThis, &pStreamIn->Stream, PDMAUDIOSTREAMCMD_DISABLE); 1916 2074 if (RT_SUCCESS(rc)) 1917 2075 { … … 2011 2169 } 2012 2170 2013 static int coreAudioDestroyStreamOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream) 2014 { 2015 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 2016 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 2017 2171 static int coreAudioDestroyStreamOut(PDRVHOSTCOREAUDIO pThis, PPDMAUDIOSTREAM pStream) 2172 { 2018 2173 PCOREAUDIOSTREAMOUT pStreamOut = (PCOREAUDIOSTREAMOUT)pStream; 2019 2174 … … 2027 2182 } 2028 2183 2029 int rc = coreAudioControlStreamOut(p Interface, &pStreamOut->Stream, PDMAUDIOSTREAMCMD_DISABLE);2184 int rc = coreAudioControlStreamOut(pThis, &pStreamOut->Stream, PDMAUDIOSTREAMCMD_DISABLE); 2030 2185 if (RT_SUCCESS(rc)) 2031 2186 { … … 2112 2267 } 2113 2268 2114 static int coreAudioCreateStreamIn(P PDMIHOSTAUDIO pInterface,2269 static int coreAudioCreateStreamIn(PDRVHOSTCOREAUDIO pThis, 2115 2270 PPDMAUDIOSTREAM pStream, PPDMAUDIOSTREAMCFG pCfg, uint32_t *pcSamples) 2116 2271 { … … 2148 2303 } 2149 2304 #endif 2150 rc = coreAudioInitIn( &pStreamIn->Stream, pcSamples);2305 rc = coreAudioInitIn(pThis, &pStreamIn->Stream, pcSamples); 2151 2306 } 2152 2307 … … 2189 2344 } 2190 2345 2191 static int coreAudioCreateStreamOut(P PDMIHOSTAUDIO pInterface,2346 static int coreAudioCreateStreamOut(PDRVHOSTCOREAUDIO pThis, 2192 2347 PPDMAUDIOSTREAM pStream, PPDMAUDIOSTREAMCFG pCfg, 2193 2348 uint32_t *pcSamples) … … 2224 2379 } 2225 2380 #endif 2226 rc = coreAudioInitOut(p Stream, pcSamples);2381 rc = coreAudioInitOut(pThis, pStream, pcSamples); 2227 2382 } 2228 2383 … … 2268 2423 static DECLCALLBACK(int) drvHostCoreAudioGetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pCfg) 2269 2424 { 2270 NOREF(pInterface); 2271 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 2272 2273 LogFlowFuncEnter(); 2274 2275 pCfg->cbStreamIn = sizeof(COREAUDIOSTREAMIN); 2276 pCfg->cbStreamOut = sizeof(COREAUDIOSTREAMOUT); 2277 pCfg->cMaxStreamsIn = UINT32_MAX; 2278 pCfg->cMaxStreamsOut = UINT32_MAX; 2279 2280 /** @todo Implement a proper device detection. */ 2281 pCfg->cSources = 1; 2282 pCfg->cSinks = 1; 2283 2284 return VINF_SUCCESS; 2425 AssertPtrReturn(pInterface, VERR_INVALID_POINTER); 2426 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 2427 2428 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 2429 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 2430 2431 return coreAudioUpdateStatusInternalEx(pThis, pCfg, 0 /* fEnum */); 2285 2432 } 2286 2433 … … 2299 2446 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 2300 2447 2448 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 2449 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 2450 2301 2451 int rc; 2302 2452 if (pCfg->enmDir == PDMAUDIODIR_IN) 2303 rc = coreAudioCreateStreamIn(p Interface, pStream, pCfg, pcSamples);2453 rc = coreAudioCreateStreamIn(pThis, pStream, pCfg, pcSamples); 2304 2454 else 2305 rc = coreAudioCreateStreamOut(p Interface, pStream, pCfg, pcSamples);2455 rc = coreAudioCreateStreamOut(pThis, pStream, pCfg, pcSamples); 2306 2456 2307 2457 LogFlowFunc(("%s: rc=%Rrc\n", pStream->szName, rc)); … … 2314 2464 AssertPtrReturn(pStream, VERR_INVALID_POINTER); 2315 2465 2466 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 2467 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 2468 2316 2469 int rc; 2317 2470 if (pStream->enmDir == PDMAUDIODIR_IN) 2318 rc = coreAudioDestroyStreamIn(p Interface, pStream);2471 rc = coreAudioDestroyStreamIn(pThis, pStream); 2319 2472 else 2320 rc = coreAudioDestroyStreamOut(p Interface, pStream);2473 rc = coreAudioDestroyStreamOut(pThis, pStream); 2321 2474 2322 2475 return rc; … … 2331 2484 Assert(pStream->enmCtx == PDMAUDIOSTREAMCTX_HOST); 2332 2485 2486 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 2487 PDRVHOSTCOREAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTCOREAUDIO); 2488 2333 2489 int rc; 2334 2490 if (pStream->enmDir == PDMAUDIODIR_IN) 2335 rc = coreAudioControlStreamIn(p Interface, pStream, enmStreamCmd);2491 rc = coreAudioControlStreamIn(pThis, pStream, enmStreamCmd); 2336 2492 else 2337 rc = coreAudioControlStreamOut(p Interface, pStream, enmStreamCmd);2493 rc = coreAudioControlStreamOut(pThis, pStream, enmStreamCmd); 2338 2494 2339 2495 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.