VirtualBox

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
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