VirtualBox

Changeset 88362 in vbox for trunk


Ignore:
Timestamp:
Apr 5, 2021 12:31:17 AM (4 years ago)
Author:
vboxsync
Message:

Audio: Removed PDMIHOSTAUDIO::pfnSetCallback (replaced by PDMIAUDIONOTIFYFROMHOST). bugref:9890

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r88359 r88362  
    993993
    994994
    995 /**
    996  * Audio backend callback types.
    997  * Those callbacks are being sent from the backend -> audio connector.
    998  */
    999 typedef enum PDMAUDIOBACKENDCBTYPE
    1000 {
    1001     /** Invalid, do not use. */
    1002     PDMAUDIOBACKENDCBTYPE_INVALID = 0,
    1003     /** The backend's status has changed. */
    1004     PDMAUDIOBACKENDCBTYPE_STATUS,
    1005     /** One or more host audio devices have changed. */
    1006     PDMAUDIOBACKENDCBTYPE_DEVICES_CHANGED,
    1007     /** Hack to blow the type up to 32-bit. */
    1008     PDMAUDIOBACKENDCBTYPE_32BIT_HACK = 0x7fffffff
    1009 } PDMAUDIOBACKENDCBTYPE;
    1010 
    1011 /** Pointer to a host audio interface. */
    1012 typedef struct PDMIHOSTAUDIO *PPDMIHOSTAUDIO;
    1013 
    1014 /**
    1015  * Host audio callback function.
    1016  *
    1017  * This function will be called from a backend to communicate with the host audio interface.
    1018  *
    1019  * @returns VBox status code.
    1020  * @param   pDrvIns             Pointer to driver instance which called us.
    1021  * @param   enmType             Callback type.
    1022  * @param   pvUser              User argument.
    1023  * @param   cbUser              Size (in bytes) of user argument.
    1024  */
    1025 typedef DECLCALLBACKTYPE(int, FNPDMHOSTAUDIOCALLBACK,(PPDMDRVINS pDrvIns, PDMAUDIOBACKENDCBTYPE enmType,
    1026                                                       void *pvUser, size_t cbUser));
    1027 /** Pointer to a FNPDMHOSTAUDIOCALLBACK(). */
    1028 typedef FNPDMHOSTAUDIOCALLBACK *PFNPDMHOSTAUDIOCALLBACK;
    1029 
    1030995
    1031996/** @todo r=bird: What is this exactly? */
    1032997#define PPDMAUDIOBACKENDSTREAM void *
     998
    1033999
    10341000/** Pointer to a audio connector interface. */
     
    12381204
    12391205
     1206/** Pointer to a host audio interface. */
     1207typedef struct PDMIHOSTAUDIO *PPDMIHOSTAUDIO;
     1208
    12401209/**
    12411210 * PDM host audio interface.
     
    12871256     */
    12881257    DECLR3CALLBACKMEMBER(PDMAUDIOBACKENDSTS, pfnGetStatus, (PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir));
    1289 
    1290     /**
    1291      * Sets a callback the audio backend can call. Optional.
    1292      *
    1293      * @returns VBox status code.
    1294      * @param   pInterface          Pointer to the interface structure containing the called function pointer.
    1295      * @param   pfnCallback         The callback function to use, or NULL when unregistering.
    1296      */
    1297     DECLR3CALLBACKMEMBER(int, pfnSetCallback, (PPDMIHOSTAUDIO pInterface, PFNPDMHOSTAUDIOCALLBACK pfnCallback));
    12981258
    12991259    /**
     
    14491409
    14501410/** PDMIHOSTAUDIO interface ID. */
    1451 #define PDMIHOSTAUDIO_IID                           "be34182b-d579-41e8-96e0-abb94900460f"
     1411#define PDMIHOSTAUDIO_IID                           "fafc2dfb-eaa8-4e8f-9d13-ffe9163e7c51"
    14521412
    14531413
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r88359 r88362  
    18921892}
    18931893
    1894 #ifdef VBOX_WITH_AUDIO_CALLBACKS  /** @todo r=bird: All this is non-sense that shall be replaced by a PDMIHOSTAUDIO partner interface. */
    1895 
    1896 /**
    1897  * @callback_method_impl{FNPDMHOSTAUDIOCALLBACK, Backend callback implementation.}
    1898  *
    1899  * @par Important:
    1900  * No calls back to the backend within this function, as the backend
    1901  * might hold any locks / critical sections while executing this
    1902  * callback. Will result in some ugly deadlocks (or at least locking
    1903  * order violations) then.
    1904  *
    1905  * @todo r=bird: The above warning is extremely bogus. You enter the critical
    1906  *       section of the driver here, if anything, that will be the lock order
    1907  *       violation.
    1908  */
    1909 static DECLCALLBACK(int) drvAudioBackendCallback(PPDMDRVINS pDrvIns, PDMAUDIOBACKENDCBTYPE enmType, void *pvUser, size_t cbUser)
    1910 {
    1911     AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
    1912     RT_NOREF(pvUser, cbUser);
    1913     /* pvUser and cbUser are optional. */
    1914 
    1915 /** @todo r=bird: WTF *is* this?  Seriously?!?
    1916  *
    1917  * DrvAudio will provide the host driver with a "callback" interface
    1918  * with methods like pfnNotifyDevicesChanged and pfnNotifyStatusChanged.
    1919  * The host drivers that implements callbacks can query the callback
    1920  * interface and make use of it.
    1921  */
    1922 
    1923     /* Get the upper driver (PDMIAUDIOCONNECTOR). */
    1924     AssertPtr(pDrvIns->pUpBase);
    1925     PPDMIAUDIOCONNECTOR pInterface = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIAUDIOCONNECTOR);
    1926     AssertPtr(pInterface);
    1927     PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IAudioConnector);
    1928     AssertPtr(pThis);
    1929 
    1930     int rc = RTCritSectEnter(&pThis->CritSect);
    1931     AssertRCReturn(rc, rc);
    1932 
    1933     LogFunc(("pThis=%p, enmType=%RU32, pvUser=%p, cbUser=%zu\n", pThis, enmType, pvUser, cbUser));
    1934 
    1935     switch (enmType)
    1936     {
    1937         case PDMAUDIOBACKENDCBTYPE_DEVICES_CHANGED:
    1938             LogRel(("Audio: Device configuration of driver '%s' has changed\n", pThis->szName));
    1939             drvAudioScheduleReInitInternal(pThis);
    1940             break;
    1941 
    1942         default:
    1943             AssertMsgFailed(("Not supported\n"));
    1944             break;
    1945     }
    1946 
    1947     RTCritSectLeave(&pThis->CritSect);
    1948 
    1949     LogFlowFunc(("Returning %Rrc\n", rc));
    1950     return rc;
    1951 }
    1952 
    1953 #endif /* VBOX_WITH_AUDIO_CALLBACKS */
    1954 
    19551894#ifdef VBOX_WITH_AUDIO_ENUM
    19561895/**
     
    20531992    AssertPtrNullReturn(pHostDrvAudio->pfnGetDevices, VERR_INVALID_POINTER);
    20541993    AssertPtrNullReturn(pHostDrvAudio->pfnGetStatus, VERR_INVALID_POINTER);
    2055     AssertPtrNullReturn(pHostDrvAudio->pfnSetCallback, VERR_INVALID_POINTER);
    20561994    AssertPtrReturn(pHostDrvAudio->pfnStreamCreate, VERR_INVALID_POINTER);
    20571995    AssertPtrReturn(pHostDrvAudio->pfnStreamDestroy, VERR_INVALID_POINTER);
     
    21072045    RT_NOREF(rc2);
    21082046    /* Ignore rc. */
    2109 #endif
    2110 
    2111 #ifdef VBOX_WITH_AUDIO_CALLBACKS
    2112     /*
    2113      * If the backend supports it, offer a callback to this connector.
    2114      */
    2115 /** @todo r=bird: Total misdesign.  If the backend wants to talk to us, it
    2116  *                should use PDMIBASE_QUERY_INTERFACE to get an interface from us. */
    2117     if (pThis->pHostDrvAudio->pfnSetCallback)
    2118     {
    2119         rc2 = pThis->pHostDrvAudio->pfnSetCallback(pThis->pHostDrvAudio, drvAudioBackendCallback);
    2120         if (RT_FAILURE(rc2))
    2121              LogRel(("Audio: Error registering callback for host driver '%s', rc=%Rrc\n", pThis->szName, rc2));
    2122         /* Not fatal. */
    2123     }
    21242047#endif
    21252048
     
    34053328
    34063329
    3407 #ifdef VBOX_WITH_AUDIO_CALLBACKS
    34083330/*********************************************************************************************************************************
    34093331*   PDMIAUDIONOTIFYFROMHOST interface implementation.                                                                            *
    34103332*********************************************************************************************************************************/
    3411 
     3333#ifdef VBOX_WITH_AUDIO_CALLBACKS
    34123334/**
    34133335 * @interface_method_impl{PDMIAUDIONOTIFYFROMHOST,pfnNotifyDevicesChanged}
  • trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp

    r88283 r88362  
    15041504    pThis->IHostAudio.pfnStreamPlay         = drvHostAlsaAudioHA_StreamPlay;
    15051505    pThis->IHostAudio.pfnStreamCapture      = drvHostAlsaAudioHA_StreamCapture;
    1506     pThis->IHostAudio.pfnSetCallback        = NULL;
    15071506    pThis->IHostAudio.pfnGetDevices         = NULL;
    15081507    pThis->IHostAudio.pfnStreamGetPending   = drvHostALSAStreamGetPending;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp

    r88360 r88362  
    25632563    pThis->IHostAudio.pfnStreamPlay         = drvHostCoreAudioHA_StreamPlay;
    25642564    pThis->IHostAudio.pfnStreamCapture      = drvHostCoreAudioHA_StreamCapture;
    2565     pThis->IHostAudio.pfnSetCallback        = NULL;
    25662565    pThis->IHostAudio.pfnGetDevices         = drvHostCoreAudioHA_GetDevices;
    25672566    pThis->IHostAudio.pfnStreamGetPending   = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp

    r88361 r88362  
    26292629    pThis->IHostAudio.pfnStreamPlay         = drvHostDSoundHA_StreamPlay;
    26302630    pThis->IHostAudio.pfnStreamCapture      = drvHostDSoundHA_StreamCapture;
    2631     pThis->IHostAudio.pfnSetCallback        = NULL;
    26322631    pThis->IHostAudio.pfnGetDevices         = drvHostDSoundHA_GetDevices;
    26332632    pThis->IHostAudio.pfnStreamGetPending   = drvHostDSoundHA_StreamGetPending;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp

    r88357 r88362  
    422422    pThis->IHostAudio.pfnStreamPlay         = drvHostDebugAudioHA_StreamPlay;
    423423    pThis->IHostAudio.pfnStreamCapture      = drvHostDebugAudioHA_StreamCapture;
    424     pThis->IHostAudio.pfnSetCallback        = NULL;
    425424    pThis->IHostAudio.pfnGetDevices         = NULL;
    426425    pThis->IHostAudio.pfnStreamGetPending   = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp

    r88286 r88362  
    360360    pThis->IHostAudio.pfnStreamPlay         = drvHostNullAudioHA_StreamPlay;
    361361    pThis->IHostAudio.pfnStreamCapture      = drvHostNullAudioHA_StreamCapture;
    362     pThis->IHostAudio.pfnSetCallback        = NULL;
    363362    pThis->IHostAudio.pfnGetDevices         = NULL;
    364363    pThis->IHostAudio.pfnStreamGetPending   = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp

    r88291 r88362  
    758758    pThis->IHostAudio.pfnStreamPlay         = drvHostOssAudioHA_StreamPlay;
    759759    pThis->IHostAudio.pfnStreamCapture      = drvHostOssAudioHA_StreamCapture;
    760     pThis->IHostAudio.pfnSetCallback        = NULL;
    761760    pThis->IHostAudio.pfnGetDevices         = NULL;
    762761    pThis->IHostAudio.pfnStreamGetPending   = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp

    r88282 r88362  
    17021702    pThis->IHostAudio.pfnStreamPlay         = drvHostPulseAudioHA_StreamPlay;
    17031703    pThis->IHostAudio.pfnStreamCapture      = drvHostPulseAudioHA_StreamCapture;
    1704     pThis->IHostAudio.pfnSetCallback        = NULL;
    17051704    pThis->IHostAudio.pfnGetDevices         = NULL;
    17061705    pThis->IHostAudio.pfnStreamGetPending   = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp

    r88235 r88362  
    425425    pThis->IHostAudio.pfnStreamPlay         = drvHostValKitAudioHA_StreamPlay;
    426426    pThis->IHostAudio.pfnStreamCapture      = drvHostValKitAudioHA_StreamCapture;
    427     pThis->IHostAudio.pfnSetCallback        = NULL;
    428427    pThis->IHostAudio.pfnGetDevices         = NULL;
    429428    pThis->IHostAudio.pfnStreamGetPending   = NULL;
  • trunk/src/VBox/Main/src-client/DrvAudioRec.cpp

    r88300 r88362  
    11561156    pThis->IHostAudio.pfnStreamPlay         = drvAudioVideoRecHA_StreamPlay;
    11571157    pThis->IHostAudio.pfnStreamCapture      = drvAudioVideoRecHA_StreamCapture;
    1158     pThis->IHostAudio.pfnSetCallback        = NULL;
    11591158    pThis->IHostAudio.pfnGetDevices         = NULL;
    11601159    pThis->IHostAudio.pfnStreamGetPending   = NULL;
  • trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp

    r88300 r88362  
    721721    pThis->IHostAudio.pfnGetDevices        = NULL;
    722722    pThis->IHostAudio.pfnGetStatus         = drvAudioVrdeHA_GetStatus;
    723     pThis->IHostAudio.pfnSetCallback       = NULL;
    724723    pThis->IHostAudio.pfnStreamCreate      = drvAudioVrdeHA_StreamCreate;
    725724    pThis->IHostAudio.pfnStreamDestroy     = drvAudioVrdeHA_StreamDestroy;
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