VirtualBox

Changeset 63547 in vbox for trunk


Ignore:
Timestamp:
Aug 16, 2016 12:33:51 PM (8 years ago)
Author:
vboxsync
Message:

Audio/DrvHostCoreAudio.cpp: Removed USE_NON_DEPRECATED_APIS and use the current APIs by default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp

    r63534 r63547  
    275275*   Defined Constants And Macros                                                                                                 *
    276276*********************************************************************************************************************************/
    277 /** @todo r=bird: The three API calls we use for finding, opening and closing
    278  * the default audio component are deprecated since 10.8.  This define switches
    279  * over to using the replacement/renamed APIs introduced in 10.6+ */
    280 #define USE_NON_DEPRECATED_APIS 1
    281 
    282277/** @name Initialization status indicator used for the recreation of the AudioUnits.
    283278 * @{ */
     
    12601255
    12611256        /* Try to find the default HAL output component. */
    1262 #ifdef USE_NON_DEPRECATED_APIS
    12631257        AudioComponentDescription cd;
    1264 #else
    1265         ComponentDescription cd;
    1266 #endif
     1258
    12671259        RT_ZERO(cd);
    12681260        cd.componentType         = kAudioUnitType_Output;
    12691261        cd.componentSubType      = kAudioUnitSubType_HALOutput;
    12701262        cd.componentManufacturer = kAudioUnitManufacturer_Apple;
    1271 #ifdef USE_NON_DEPRECATED_APIS
     1263
    12721264        AudioComponent cp = AudioComponentFindNext(NULL, &cd);
    1273 #else
    1274         Component cp = FindNextComponent(NULL, &cd);
    1275 #endif
    12761265        if (cp == 0)
    12771266        {
     
    12811270
    12821271        /* Open the default HAL output component. */
    1283 #ifdef USE_NON_DEPRECATED_APIS
    12841272        err = AudioComponentInstanceNew(cp, &pStreamIn->audioUnit);
    1285 #else
    1286         err = OpenAComponent(cp, &pStreamIn->audioUnit);
    1287 #endif
    12881273        if (err != noErr)
    12891274        {
     
    16851670
    16861671        /* Try to find the default HAL output component. */
    1687 #ifdef USE_NON_DEPRECATED_APIS
    16881672        AudioComponentDescription cd;
    1689 #else
    1690         ComponentDescription cd;
    1691 #endif
    16921673        RT_ZERO(cd);
     1674
    16931675        cd.componentType         = kAudioUnitType_Output;
    16941676        cd.componentSubType      = kAudioUnitSubType_HALOutput;
    16951677        cd.componentManufacturer = kAudioUnitManufacturer_Apple;
    1696 #ifdef USE_NON_DEPRECATED_APIS
     1678
    16971679        AudioComponent cp = AudioComponentFindNext(NULL, &cd);
    1698 #else
    1699         Component cp = FindNextComponent(NULL, &cd);
    1700 #endif
    17011680        if (cp == 0)
    17021681        {
     
    17061685
    17071686        /* Open the default HAL output component. */
    1708 #ifdef USE_NON_DEPRECATED_APIS
    17091687        err = AudioComponentInstanceNew(cp, &pStreamOut->audioUnit);
    1710 #else
    1711         err = OpenAComponent(cp, &pStreamOut->audioUnit);
    1712 #endif
    17131688        if (err != noErr)
    17141689        {
     
    24352410        err = AudioUnitUninitialize(pStreamIn->audioUnit);
    24362411        if (err == noErr)
    2437 #ifdef USE_NON_DEPRECATED_APIS
    24382412            err = AudioComponentInstanceDispose(pStreamIn->audioUnit);
    2439 #else
    2440             err = CloseComponent(pStreamIn->audioUnit);
    2441 #endif
    24422413
    24432414        if (   err != noErr
     
    25502521        err = AudioUnitUninitialize(pStreamOut->audioUnit);
    25512522        if (err == noErr)
    2552 #ifdef USE_NON_DEPRECATED_APIS
    25532523            err = AudioComponentInstanceDispose(pStreamOut->audioUnit);
    2554 #else
    2555             err = CloseComponent(pStreamOut->audioUnit);
    2556 #endif
    25572524
    25582525        if (   err != noErr
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette