Changeset 61706 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 15, 2016 9:59:40 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
r61698 r61706 123 123 124 124 /* First try to set the new frame buffer size. */ 125 OSStatus err = AudioObjectSetPropertyData(deviceID, &propAdr, NULL, 0, sizeof(cReqSize), &cReqSize);125 OSStatus err = AudioObjectSetPropertyData(deviceID, &propAdr, 0, NULL, sizeof(cReqSize), &cReqSize); 126 126 127 127 /* Check if it really was set. */ … … 262 262 static const OSStatus caConverterEOFDErr = 0x656F6664; /* 'eofd' */ 263 263 264 /* Prototypes needed for COREAUDIOSTREAMCBCTX. */ 265 struct COREAUDIOSTREAMIN; 266 typedef struct COREAUDIOSTREAMIN *PCOREAUDIOSTREAMIN; 267 struct COREAUDIOSTREAMOUT; 268 typedef struct COREAUDIOSTREAMOUT *PCOREAUDIOSTREAMOUT; 269 270 /** 271 * Simple structure for maintaining a stream's callback context. 272 ** @todo Remove this as soon as we have unified input/output streams in this backend. 273 */ 274 typedef struct COREAUDIOSTREAMCBCTX 275 { 276 /** The stream's direction. */ 277 PDMAUDIODIR enmDir; 278 union 279 { 280 /** Pointer to self, if it's an input stream. */ 281 PCOREAUDIOSTREAMIN pIn; 282 /** Pointer to self, if it's an output stream. */ 283 PCOREAUDIOSTREAMOUT pOut; 284 }; 285 } COREAUDIOSTREAMCBCTX, *PCOREAUDIOSTREAMCBCTX; 286 287 /** @todo Unify COREAUDIOSTREAMOUT / COREAUDIOSTREAMIN. */ 264 288 typedef struct COREAUDIOSTREAMOUT 265 289 { … … 282 306 /** Flag whether the "default device changed" listener was registered. */ 283 307 bool fDefDevChgListReg; 308 /** Flag whether the "device state changed" listener was registered. */ 309 bool fDevStateChgListReg; 310 /** Callback context for this stream for handing this stream in to 311 * a CoreAudio callback. 312 ** @todo Remove this as soon as we have unified input/output streams in this backend. */ 313 COREAUDIOSTREAMCBCTX cbCtx; 284 314 } COREAUDIOSTREAMOUT, *PCOREAUDIOSTREAMOUT; 285 315 … … 312 342 /** Flag whether the "default device changed" listener was registered. */ 313 343 bool fDefDevChgListReg; 344 /** Flag whether the "device state changed" listener was registered. */ 345 bool fDevStateChgListReg; 346 /** Callback context for this stream for handing this stream in to 347 * a CoreAudio callback. 348 ** @todo Remove this as soon as we have unified input/output streams in this backend. */ 349 COREAUDIOSTREAMCBCTX cbCtx; 314 350 } COREAUDIOSTREAMIN, *PCOREAUDIOSTREAMIN; 315 351 … … 327 363 static int coreAudioDestroyStreamOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream); 328 364 329 /* Callback for getting notified when the default input/output device has been changed. */ 365 static DECLCALLBACK(OSStatus) drvHostCoreAudioDeviceStateChanged(AudioObjectID propertyID, 366 UInt32 nAddresses, 367 const AudioObjectPropertyAddress properties[], 368 void *pvUser) 369 { 370 PCOREAUDIOSTREAMCBCTX pCbCtx = (PCOREAUDIOSTREAMCBCTX)pvUser; 371 372 LogFlowFunc(("propertyID=%u nAddresses=%u pvUser=%p\n", propertyID, nAddresses, pvUser)); 373 374 UInt32 uAlive = 1; 375 UInt32 uSize = sizeof(UInt32); 376 377 AudioObjectPropertyAddress propAdr = { kAudioDevicePropertyDeviceIsAlive, kAudioObjectPropertyScopeGlobal, 378 kAudioObjectPropertyElementMaster }; 379 380 AudioDeviceID deviceID = pCbCtx->enmDir == PDMAUDIODIR_IN 381 ? pCbCtx->pIn->deviceID : pCbCtx->pOut->deviceID; 382 383 OSStatus err = AudioObjectGetPropertyData(deviceID, &propAdr, 0, NULL, &uSize, &uAlive); 384 385 bool fIsDead = false; 386 387 if (err == kAudioHardwareBadDeviceError) 388 fIsDead = true; /* Unplugged. */ 389 else if ((err == kAudioHardwareNoError) && (!RT_BOOL(uAlive))) 390 fIsDead = true; /* Something else happened. */ 391 392 if (fIsDead) 393 { 394 switch (pCbCtx->enmDir) 395 { 396 case PDMAUDIODIR_IN: 397 { 398 PCOREAUDIOSTREAMIN pStreamIn = pCbCtx->pIn; 399 400 /* We move the reinitialization to the next output event. 401 * This make sure this thread isn't blocked and the 402 * reinitialization is done when necessary only. */ 403 ASMAtomicXchgU32(&pStreamIn->status, CA_STATUS_REINIT); 404 405 LogRel(("CoreAudio: Capturing device stopped functioning\n")); 406 break; 407 } 408 409 case PDMAUDIODIR_OUT: 410 { 411 PCOREAUDIOSTREAMOUT pStreamOut = pCbCtx->pOut; 412 413 /* We move the reinitialization to the next output event. 414 * This make sure this thread isn't blocked and the 415 * reinitialization is done when necessary only. */ 416 ASMAtomicXchgU32(&pStreamOut->status, CA_STATUS_REINIT); 417 418 LogRel(("CoreAudio: Playback device stopped functioning\n")); 419 break; 420 } 421 422 default: 423 AssertMsgFailed(("Not implemented\n")); 424 break; 425 } 426 } 427 428 return noErr; 429 } 430 431 /* Callback for getting notified when the default recording/playback device has been changed. */ 330 432 static DECLCALLBACK(OSStatus) coreAudioDefaultDeviceChanged(AudioObjectID propertyID, 331 433 UInt32 nAddresses, … … 357 459 if (pStreamIn->deviceID != uResp) 358 460 { 359 LogRel(("CoreAudio: Default inputdevice has changed\n"));461 LogRel(("CoreAudio: Default recording device has changed\n")); 360 462 361 463 /* We move the reinitialization to the next input event. … … 385 487 if (pStreamOut->deviceID != uResp) 386 488 { 387 LogRel(("CoreAudio: Default outputdevice has changed\n"));489 LogRel(("CoreAudio: Default playback device has changed\n")); 388 490 389 491 /* We move the reinitialization to the next input event. … … 722 824 if (pStreamIn->deviceID == kAudioDeviceUnknown) 723 825 { 724 /* Fetch the default audio inputdevice currently in use. */826 /* Fetch the default audio recording device currently in use. */ 725 827 AudioObjectPropertyAddress propAdr = { kAudioHardwarePropertyDefaultInputDevice, 726 828 kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; … … 729 831 if (err != noErr) 730 832 { 731 LogRel(("CoreAudio: Unable to determine default inputdevice (%RI32)\n", err));833 LogRel(("CoreAudio: Unable to determine default recording device (%RI32)\n", err)); 732 834 return VERR_NOT_FOUND; 733 835 } … … 735 837 736 838 /* 737 * Try to get the name of the inputdevice and log it. It's not fatal if it fails.839 * Try to get the name of the recording device and log it. It's not fatal if it fails. 738 840 */ 739 841 CFStringRef strTemp; … … 761 863 { 762 864 CFRelease(strTemp); 763 LogRel(("CoreAudio: Using inputdevice: %s (UID: %s)\n", pszDevName, pszUID));865 LogRel(("CoreAudio: Using recording device: %s (UID: %s)\n", pszDevName, pszUID)); 764 866 765 867 RTMemFree(pszUID); … … 773 875 { 774 876 /* This is not fatal, can happen for some Macs. */ 775 LogRel2(("CoreAudio: Unable to determine inputdevice name (%RI32)\n", err));877 LogRel2(("CoreAudio: Unable to determine recording device name (%RI32)\n", err)); 776 878 } 777 879 … … 784 886 if (err != noErr) 785 887 { 786 /* Can happen if no inputdevice is available by default. Happens on some Macs,888 /* Can happen if no recording device is available by default. Happens on some Macs, 787 889 * so don't log this by default to not scare people. */ 788 LogRel2(("CoreAudio: Failed to determine frame buffer size of the audio inputdevice (%RI32)\n", err));890 LogRel2(("CoreAudio: Failed to determine frame buffer size of the audio recording device (%RI32)\n", err)); 789 891 return VERR_AUDIO_BACKEND_INIT_FAILED; 790 892 } … … 794 896 if (err != noErr) 795 897 { 796 LogRel(("CoreAudio: Failed to set frame buffer size for the audio inputdevice (%RI32)\n", err));898 LogRel(("CoreAudio: Failed to set frame buffer size for the audio recording device (%RI32)\n", err)); 797 899 return VERR_AUDIO_BACKEND_INIT_FAILED; 798 900 } … … 842 944 } 843 945 844 /* Set the default audio inputdevice as the device for the new AudioUnit. */946 /* Set the default audio recording device as the device for the new AudioUnit. */ 845 947 err = AudioUnitSetProperty(pStreamIn->audioUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 846 948 0, &pStreamIn->deviceID, sizeof(pStreamIn->deviceID)); … … 881 983 coreAudioPCMInfoToASBDesc(&pStreamIn->Stream.Props, &pStreamIn->streamFormat); 882 984 883 coreAudioPrintASBDesc("CoreAudio: Inputdevice", &pStreamIn->deviceFormat);985 coreAudioPrintASBDesc("CoreAudio: recording device", &pStreamIn->deviceFormat); 884 986 coreAudioPrintASBDesc("CoreAudio: Input stream", &pStreamIn->streamFormat); 885 987 … … 989 1091 if (err != noErr) 990 1092 { 991 LogRel(("CoreAudio: Failed to get inputdevice format (%RI32)\n", err));1093 LogRel(("CoreAudio: Failed to get recording device format (%RI32)\n", err)); 992 1094 return VERR_AUDIO_BACKEND_INIT_FAILED; 993 1095 } … … 1067 1169 if (RT_SUCCESS(rc)) 1068 1170 { 1171 /* Set callback context. */ 1172 pStreamIn->cbCtx.enmDir = PDMAUDIODIR_IN; 1173 pStreamIn->cbCtx.pIn = pStreamIn; 1174 1069 1175 ASMAtomicXchgU32(&pStreamIn->status, CA_STATUS_INIT); 1070 1176 … … 1099 1205 if (pStreamOut->deviceID == kAudioDeviceUnknown) 1100 1206 { 1101 /* Fetch the default audio inputdevice currently in use. */1207 /* Fetch the default audio recording device currently in use. */ 1102 1208 AudioObjectPropertyAddress propAdr = { kAudioHardwarePropertyDefaultOutputDevice, 1103 1209 kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; … … 1106 1212 if (err != noErr) 1107 1213 { 1108 LogRel(("CoreAudio: Unable to determine default outputdevice (%RI32)\n", err));1214 LogRel(("CoreAudio: Unable to determine default playback device (%RI32)\n", err)); 1109 1215 return VERR_NOT_FOUND; 1110 1216 } … … 1112 1218 1113 1219 /* 1114 * Try to get the name of the outputdevice and log it. It's not fatal if it fails.1220 * Try to get the name of the playback device and log it. It's not fatal if it fails. 1115 1221 */ 1116 1222 CFStringRef strTemp; … … 1138 1244 { 1139 1245 CFRelease(strTemp); 1140 LogRel(("CoreAudio: Using outputdevice: %s (UID: %s)\n", pszDevName, pszUID));1246 LogRel(("CoreAudio: Using playback device: %s (UID: %s)\n", pszDevName, pszUID)); 1141 1247 1142 1248 RTMemFree(pszUID); … … 1148 1254 } 1149 1255 else 1150 LogRel(("CoreAudio: Unable to determine outputdevice name (%RI32)\n", err));1256 LogRel(("CoreAudio: Unable to determine playback device name (%RI32)\n", err)); 1151 1257 1152 1258 /* Get the default frames buffer size, so that we can setup our internal buffers. */ … … 1158 1264 if (err != noErr) 1159 1265 { 1160 LogRel(("CoreAudio: Failed to determine frame buffer size of the audio outputdevice (%RI32)\n", err));1266 LogRel(("CoreAudio: Failed to determine frame buffer size of the audio playback device (%RI32)\n", err)); 1161 1267 return VERR_AUDIO_BACKEND_INIT_FAILED; 1162 1268 } … … 1166 1272 if (err != noErr) 1167 1273 { 1168 LogRel(("CoreAudio: Failed to set frame buffer size for the audio outputdevice (%RI32)\n", err));1274 LogRel(("CoreAudio: Failed to set frame buffer size for the audio playback device (%RI32)\n", err)); 1169 1275 return VERR_AUDIO_BACKEND_INIT_FAILED; 1170 1276 } … … 1202 1308 } 1203 1309 1204 /* Set the default audio outputdevice as the device for the new AudioUnit. */1310 /* Set the default audio playback device as the device for the new AudioUnit. */ 1205 1311 err = AudioUnitSetProperty(pStreamOut->audioUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 1206 1312 0, &pStreamOut->deviceID, sizeof(pStreamOut->deviceID)); … … 1241 1347 coreAudioPCMInfoToASBDesc(&pStreamOut->Stream.Props, &pStreamOut->streamFormat); 1242 1348 1243 coreAudioPrintASBDesc("CoreAudio: Outputdevice", &pStreamOut->deviceFormat);1349 coreAudioPrintASBDesc("CoreAudio: playback device", &pStreamOut->deviceFormat); 1244 1350 coreAudioPrintASBDesc("CoreAudio: Output format", &pStreamOut->streamFormat); 1245 1351 … … 1349 1455 if (RT_SUCCESS(rc)) 1350 1456 { 1457 /* Set callback context. */ 1458 pStreamOut->cbCtx.enmDir = PDMAUDIODIR_OUT; 1459 pStreamOut->cbCtx.pOut = pStreamOut; 1460 1351 1461 ASMAtomicXchgU32(&pStreamOut->status, CA_STATUS_INIT); 1352 1462 … … 1809 1919 1810 1920 /* 1811 * Unregister inputdevice callbacks.1921 * Unregister recording device callbacks. 1812 1922 */ 1813 1923 AudioObjectPropertyAddress propAdr = { kAudioDeviceProcessorOverload, kAudioObjectPropertyScopeGlobal, … … 1818 1928 /* Not Fatal */ 1819 1929 if (RT_UNLIKELY(err != noErr)) 1820 LogRel(("CoreAudio: Failed to remove the processor overload listener (%RI32)\n", err));1930 LogRel(("CoreAudio: Failed to remove the recording processor overload listener (%RI32)\n", err)); 1821 1931 #endif /* DEBUG */ 1822 1932 … … 1826 1936 /* Not Fatal */ 1827 1937 if (RT_UNLIKELY(err != noErr)) 1828 LogRel(("CoreAudio: Failed to remove the sample rate changed listener (%RI32)\n", err));1938 LogRel(("CoreAudio: Failed to remove the recording sample rate changed listener (%RI32)\n", err)); 1829 1939 1830 1940 if (pStreamIn->fDefDevChgListReg) … … 1838 1948 } 1839 1949 else 1840 LogRel(("CoreAudio: [Output] Failed to remove the default input device changed listener (%RI32)\n", err)); 1950 LogRel(("CoreAudio: Failed to remove the default recording device changed listener (%RI32)\n", err)); 1951 } 1952 1953 if (pStreamIn->fDevStateChgListReg) 1954 { 1955 AudioObjectPropertyAddress propAdr2 = { kAudioDevicePropertyDeviceIsAlive, kAudioObjectPropertyScopeGlobal, 1956 kAudioObjectPropertyElementMaster }; 1957 err = AudioObjectRemovePropertyListener(pStreamIn->deviceID, &propAdr2, 1958 drvHostCoreAudioDeviceStateChanged, &pStreamIn->cbCtx); 1959 if (RT_LIKELY(err == noErr)) 1960 { 1961 pStreamIn->fDevStateChgListReg = false; 1962 } 1963 else 1964 LogRel(("CoreAudio: Failed to remove the recording device state changed listener (%RI32)\n", err)); 1841 1965 } 1842 1966 … … 1867 1991 else 1868 1992 { 1869 LogRel(("CoreAudio: Failed to close the AudioUnit (%RI32)\n", err));1993 LogRel(("CoreAudio: Failed to close the recording unit (%RI32)\n", err)); 1870 1994 rc = VERR_GENERAL_FAILURE; /** @todo Fudge! */ 1871 1995 } … … 1873 1997 else 1874 1998 { 1875 LogRel(("CoreAudio: Failed to uninitialize the AudioUnit (%RI32)\n", err));1999 LogRel(("CoreAudio: Failed to uninitialize the recording unit (%RI32)\n", err)); 1876 2000 rc = VERR_GENERAL_FAILURE; /** @todo Fudge! */ 1877 2001 } … … 1920 2044 /* Not Fatal */ 1921 2045 if (RT_UNLIKELY(err != noErr)) 1922 LogRel(("CoreAudio: Failed to remove the p rocessor overload listener (%RI32)\n", err));2046 LogRel(("CoreAudio: Failed to remove the playback processor overload listener (%RI32)\n", err)); 1923 2047 #endif /* DEBUG */ 1924 2048 … … 1928 2052 /* Not Fatal */ 1929 2053 if (RT_UNLIKELY(err != noErr)) 1930 LogRel(("CoreAudio: Failed to remove the sample rate changed listener (%RI32)\n", err));2054 LogRel(("CoreAudio: Failed to remove the playback sample rate changed listener (%RI32)\n", err)); 1931 2055 1932 2056 if (pStreamOut->fDefDevChgListReg) … … 1942 2066 } 1943 2067 else 1944 LogRel(("CoreAudio: [Output] Failed to remove the default playback device changed listener (%RI32)\n", err)); 2068 LogRel(("CoreAudio: Failed to remove the default playback device changed listener (%RI32)\n", err)); 2069 } 2070 2071 if (pStreamOut->fDevStateChgListReg) 2072 { 2073 AudioObjectPropertyAddress propAdr2 = { kAudioDevicePropertyDeviceIsAlive, kAudioObjectPropertyScopeGlobal, 2074 kAudioObjectPropertyElementMaster }; 2075 err = AudioObjectRemovePropertyListener(pStreamOut->deviceID, &propAdr2, 2076 drvHostCoreAudioDeviceStateChanged, &pStreamOut->cbCtx); 2077 if (RT_LIKELY(err == noErr)) 2078 { 2079 pStreamOut->fDevStateChgListReg = false; 2080 } 2081 else 2082 LogRel(("CoreAudio: Failed to remove the playback device state changed listener (%RI32)\n", err)); 1945 2083 } 1946 2084 … … 1962 2100 } 1963 2101 else 1964 LogRel(("CoreAudio: Failed to close the AudioUnit (%RI32)\n", err));2102 LogRel(("CoreAudio: Failed to close the playback unit (%RI32)\n", err)); 1965 2103 } 1966 2104 else 1967 LogRel(("CoreAudio: Failed to uninitialize the AudioUnit (%RI32)\n", err));2105 LogRel(("CoreAudio: Failed to uninitialize the playback unit (%RI32)\n", err)); 1968 2106 } 1969 2107 else … … 1990 2128 pStreamIn->status = CA_STATUS_UNINIT; 1991 2129 pStreamIn->fDefDevChgListReg = false; 2130 pStreamIn->fDevStateChgListReg = false; 1992 2131 1993 2132 bool fDeviceByUser = false; /* Do we use a device which was set by the user? */ … … 2004 2143 /* Not fatal */ 2005 2144 if (pStreamIn->deviceID == kAudioDeviceUnknown) 2006 LogRel(("CoreAudio: Unable to find inputdevice %s. Falling back to the default audio device. \n", DeviceUID.pszInputDeviceUID));2145 LogRel(("CoreAudio: Unable to find recording device %s. Falling back to the default audio device. \n", DeviceUID.pszInputDeviceUID)); 2007 2146 else 2008 2147 fDeviceByUser = true; … … 2014 2153 if (RT_SUCCESS(rc)) 2015 2154 { 2155 OSStatus err; 2156 2016 2157 /* When the devices isn't forced by the user, we want default device change notifications. */ 2017 2158 if (!fDeviceByUser) … … 2019 2160 AudioObjectPropertyAddress propAdr = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, 2020 2161 kAudioObjectPropertyElementMaster }; 2021 OSStatuserr = AudioObjectAddPropertyListener(kAudioObjectSystemObject, &propAdr,2022 2162 err = AudioObjectAddPropertyListener(kAudioObjectSystemObject, &propAdr, 2163 coreAudioDefaultDeviceChanged, (void *)pStreamIn); 2023 2164 /* Not fatal. */ 2024 2165 if (RT_LIKELY(err == noErr)) … … 2027 2168 } 2028 2169 else 2029 LogRel(("CoreAudio: Failed to add the default input device changed listener (%RI32)\n", err)); 2030 } 2170 LogRel(("CoreAudio: Failed to add the default recording device changed listener (%RI32)\n", err)); 2171 } 2172 2173 /* Register callback for being notified if the device stops being alive. */ 2174 AudioObjectPropertyAddress propAdr = { kAudioDevicePropertyDeviceIsAlive, kAudioObjectPropertyScopeGlobal, 2175 kAudioObjectPropertyElementMaster }; 2176 err = AudioObjectAddPropertyListener(pStreamIn->deviceID, &propAdr, drvHostCoreAudioDeviceStateChanged, 2177 (void *)&pStreamIn->cbCtx); 2178 /* Not fatal. */ 2179 if (RT_LIKELY(err == noErr)) 2180 { 2181 pStreamIn->fDevStateChgListReg = true; 2182 } 2183 else 2184 LogRel(("CoreAudio: Failed to add the recording device state changed listener (%RI32)\n", err)); 2031 2185 } 2032 2186 … … 2048 2202 pStreamOut->status = CA_STATUS_UNINIT; 2049 2203 pStreamOut->fDefDevChgListReg = false; 2204 pStreamOut->fDevStateChgListReg = false; 2050 2205 2051 2206 bool fDeviceByUser = false; /* Do we use a device which was set by the user? */ … … 2064 2219 /* Not fatal */ 2065 2220 if (pStreamOut->audioDeviceId == kAudioDeviceUnknown) 2066 LogRel(("CoreAudio: Unable to find outputdevice %s. Falling back to the default audio device. \n", DeviceUID.pszOutputDeviceUID));2221 LogRel(("CoreAudio: Unable to find playback device %s. Falling back to the default audio device. \n", DeviceUID.pszOutputDeviceUID)); 2067 2222 else 2068 2223 fDeviceByUser = true; … … 2074 2229 if (RT_SUCCESS(rc)) 2075 2230 { 2231 OSStatus err; 2232 2076 2233 /* When the devices isn't forced by the user, we want default device change notifications. */ 2077 2234 if (!fDeviceByUser) … … 2079 2236 AudioObjectPropertyAddress propAdr = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, 2080 2237 kAudioObjectPropertyElementMaster }; 2081 OSStatuserr = AudioObjectAddPropertyListener(kAudioObjectSystemObject, &propAdr,2082 2238 err = AudioObjectAddPropertyListener(kAudioObjectSystemObject, &propAdr, 2239 coreAudioDefaultDeviceChanged, (void *)pStreamOut); 2083 2240 /* Not fatal. */ 2084 2241 if (RT_LIKELY(err == noErr)) … … 2087 2244 } 2088 2245 else 2089 LogRel(("CoreAudio: Failed to add the default output device changed listener (%RI32)\n", err)); 2090 } 2246 LogRel(("CoreAudio: Failed to add the default playback device changed listener (%RI32)\n", err)); 2247 } 2248 2249 2250 /* Register callback for being notified if the device stops being alive. */ 2251 AudioObjectPropertyAddress propAdr = { kAudioDevicePropertyDeviceIsAlive, kAudioObjectPropertyScopeGlobal, 2252 kAudioObjectPropertyElementMaster }; 2253 err = AudioObjectAddPropertyListener(pStreamOut->deviceID, &propAdr, drvHostCoreAudioDeviceStateChanged, 2254 (void *)&pStreamOut->cbCtx); 2255 /* Not fatal. */ 2256 if (RT_LIKELY(err == noErr)) 2257 { 2258 pStreamOut->fDevStateChgListReg = true; 2259 } 2260 else 2261 LogRel(("CoreAudio: Failed to add the playback device state changed listener (%RI32)\n", err)); 2091 2262 } 2092 2263
Note:
See TracChangeset
for help on using the changeset viewer.