VirtualBox

Changeset 88382 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 7, 2021 9:16:12 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143629
Message:

Audio: Replaced the PDMIHOSTAUDIO::pfnShutdown implementations in the VRDE and recorder drivers with pfnPowerOff methods. Removed dummy driver detach/attach implementations in same. Removed dummy pfnShutdown implementation in the dsound driver. bugref:9890

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DrvAudioRec.h

    r82968 r88382  
    5454    static DECLCALLBACK(int)  drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
    5555    static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
    56     static DECLCALLBACK(int)  drvAttach(PPDMDRVINS pDrvIns, uint32_t fFlags);
    57     static DECLCALLBACK(void) drvDetach(PPDMDRVINS pDrvIns, uint32_t fFlags);
     56    static DECLCALLBACK(void) drvPowerOff(PPDMDRVINS pDrvIns);
    5857
    5958private:
  • trunk/src/VBox/Main/include/DrvAudioVRDE.h

    r82968 r88382  
    6262    static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
    6363    static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
    64     static DECLCALLBACK(int) drvAttach(PPDMDRVINS pDrvIns, uint32_t fFlags);
    65     static DECLCALLBACK(void) drvDetach(PPDMDRVINS pDrvIns, uint32_t fFlags);
     64    static DECLCALLBACK(void) drvPowerOff(PPDMDRVINS pDrvIns);
    6665
    6766private:
  • trunk/src/VBox/Main/src-client/DrvAudioRec.cpp

    r88381 r88382  
    856856
    857857/**
    858  * @interface_method_impl{PDMIHOSTAUDIO,pfnShutdown}
    859  */
    860 static DECLCALLBACK(void) drvAudioVideoRecHA_Shutdown(PPDMIHOSTAUDIO pInterface)
    861 {
    862     LogFlowFuncEnter();
    863 
    864     PDRVAUDIORECORDING pThis = PDMIHOSTAUDIO_2_DRVAUDIORECORDING(pInterface);
    865 
    866     avRecSinkShutdown(&pThis->Sink);
    867 }
    868 
    869 
    870 /**
    871858 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus}
    872859 */
     
    10781065
    10791066/**
     1067 * @interface_method_impl{PDMDRVREG,pfnPowerOff}
     1068 */
     1069/*static*/ DECLCALLBACK(void) AudioVideoRec::drvPowerOff(PPDMDRVINS pDrvIns)
     1070{
     1071    PDRVAUDIORECORDING pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIORECORDING);
     1072    LogFlowFuncEnter();
     1073    avRecSinkShutdown(&pThis->Sink);
     1074}
     1075
     1076
     1077/**
     1078 * @interface_method_impl{PDMDRVREG,pfnDestruct}
     1079 */
     1080/*static*/ DECLCALLBACK(void) AudioVideoRec::drvDestruct(PPDMDRVINS pDrvIns)
     1081{
     1082    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     1083    PDRVAUDIORECORDING pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIORECORDING);
     1084
     1085    LogFlowFuncEnter();
     1086
     1087    switch (pThis->ContainerParms.enmType)
     1088    {
     1089        case AVRECCONTAINERTYPE_WEBM:
     1090        {
     1091            avRecSinkShutdown(&pThis->Sink);
     1092            RTStrFree(pThis->ContainerParms.WebM.pszFile);
     1093            break;
     1094        }
     1095
     1096        default:
     1097            break;
     1098    }
     1099
     1100    /*
     1101     * If the AudioVideoRec object is still alive, we must clear it's reference to
     1102     * us since we'll be invalid when we return from this method.
     1103     */
     1104    if (pThis->pAudioVideoRec)
     1105    {
     1106        pThis->pAudioVideoRec->mpDrv = NULL;
     1107        pThis->pAudioVideoRec = NULL;
     1108    }
     1109
     1110    LogFlowFuncLeave();
     1111}
     1112
     1113
     1114/**
    10801115 * Construct a audio video recording driver instance.
    10811116 *
    10821117 * @copydoc FNPDMDRVCONSTRUCT
    10831118 */
    1084 /* static */
    1085 DECLCALLBACK(int) AudioVideoRec::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
     1119/*static*/ DECLCALLBACK(int) AudioVideoRec::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
    10861120{
    10871121    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
     
    11041138    /* IHostAudio */
    11051139    pThis->IHostAudio.pfnInit               = NULL;
    1106     pThis->IHostAudio.pfnShutdown           = drvAudioVideoRecHA_Shutdown;
     1140    pThis->IHostAudio.pfnShutdown           = NULL;
    11071141    pThis->IHostAudio.pfnGetConfig          = drvAudioVideoRecHA_GetConfig;
    11081142    pThis->IHostAudio.pfnGetStatus          = drvAudioVideoRecHA_GetStatus;
     
    12151249}
    12161250
    1217 
    1218 /**
    1219  * @interface_method_impl{PDMDRVREG,pfnDestruct}
    1220  */
    1221 /* static */
    1222 DECLCALLBACK(void) AudioVideoRec::drvDestruct(PPDMDRVINS pDrvIns)
    1223 {
    1224     PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
    1225     PDRVAUDIORECORDING pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIORECORDING);
    1226 
    1227     LogFlowFuncEnter();
    1228 
    1229     switch (pThis->ContainerParms.enmType)
    1230     {
    1231         case AVRECCONTAINERTYPE_WEBM:
    1232         {
    1233             avRecSinkShutdown(&pThis->Sink);
    1234             RTStrFree(pThis->ContainerParms.WebM.pszFile);
    1235             break;
    1236         }
    1237 
    1238         default:
    1239             break;
    1240     }
    1241 
    1242     /*
    1243      * If the AudioVideoRec object is still alive, we must clear it's reference to
    1244      * us since we'll be invalid when we return from this method.
    1245      */
    1246     if (pThis->pAudioVideoRec)
    1247     {
    1248         pThis->pAudioVideoRec->mpDrv = NULL;
    1249         pThis->pAudioVideoRec = NULL;
    1250     }
    1251 
    1252     LogFlowFuncLeave();
    1253 }
    1254 
    1255 
    1256 /**
    1257  * @interface_method_impl{PDMDRVREG,pfnAttach}
    1258  */
    1259 /* static */
    1260 DECLCALLBACK(int) AudioVideoRec::drvAttach(PPDMDRVINS pDrvIns, uint32_t fFlags)
    1261 {
    1262     RT_NOREF(pDrvIns, fFlags);
    1263 
    1264     LogFlowFuncEnter();
    1265 
    1266     return VINF_SUCCESS;
    1267 }
    1268 
    1269 /**
    1270  * @interface_method_impl{PDMDRVREG,pfnDetach}
    1271  */
    1272 /* static */
    1273 DECLCALLBACK(void) AudioVideoRec::drvDetach(PPDMDRVINS pDrvIns, uint32_t fFlags)
    1274 {
    1275     RT_NOREF(pDrvIns, fFlags);
    1276 
    1277     LogFlowFuncEnter();
    1278 }
    12791251
    12801252/**
     
    13171289    NULL,
    13181290    /* pfnAttach */
    1319     AudioVideoRec::drvAttach,
     1291    NULL,
    13201292    /* pfnDetach */
    1321     AudioVideoRec::drvDetach,
     1293    NULL,
    13221294    /* pfnPowerOff */
    1323     NULL,
     1295    AudioVideoRec::drvPowerOff,
    13241296    /* pfnSoftReset */
    13251297    NULL,
  • trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp

    r88381 r88382  
    350350
    351351/**
    352  * @interface_method_impl{PDMIHOSTAUDIO,pfnShutdown}
    353  */
    354 static DECLCALLBACK(void) drvAudioVrdeHA_Shutdown(PPDMIHOSTAUDIO pInterface)
    355 {
    356     PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudio);
    357     AssertPtrReturnVoid(pDrv);
    358 
    359     if (pDrv->pConsoleVRDPServer)
    360         pDrv->pConsoleVRDPServer->SendAudioInputEnd(NULL);
    361 }
    362 
    363 
    364 /**
    365352 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus}
    366353 */
     
    658645    RT_NOREF(fEnabled);
    659646    return VINF_SUCCESS; /* Never veto. */
     647}
     648
     649
     650/**
     651 * @interface_method_impl{PDMDRVREG,pfnPowerOff}
     652 */
     653/*static*/ DECLCALLBACK(void) AudioVRDE::drvPowerOff(PPDMDRVINS pDrvIns)
     654{
     655    PDRVAUDIOVRDE pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIOVRDE);
     656    LogFlowFuncEnter();
     657
     658    if (pThis->pConsoleVRDPServer)
     659        pThis->pConsoleVRDPServer->SendAudioInputEnd(NULL);
     660}
     661
     662
     663/**
     664 * @interface_method_impl{PDMDRVREG,pfnDestruct}
     665 */
     666/*static*/ DECLCALLBACK(void) AudioVRDE::drvDestruct(PPDMDRVINS pDrvIns)
     667{
     668    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     669    PDRVAUDIOVRDE pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIOVRDE);
     670    LogFlowFuncEnter();
     671
     672    /** @todo For runtime detach maybe:
     673    if (pThis->pConsoleVRDPServer)
     674        pThis->pConsoleVRDPServer->SendAudioInputEnd(NULL); */
     675
     676    /*
     677     * If the AudioVRDE object is still alive, we must clear it's reference to
     678     * us since we'll be invalid when we return from this method.
     679     */
     680    if (pThis->pAudioVRDE)
     681    {
     682        pThis->pAudioVRDE->mpDrv = NULL;
     683        pThis->pAudioVRDE = NULL;
     684    }
    660685}
    661686
     
    691716    /* IHostAudio */
    692717    pThis->IHostAudio.pfnInit              = NULL;
    693     pThis->IHostAudio.pfnShutdown          = drvAudioVrdeHA_Shutdown;
     718    pThis->IHostAudio.pfnShutdown          = NULL;
    694719    pThis->IHostAudio.pfnGetConfig         = drvAudioVrdeHA_GetConfig;
    695720    pThis->IHostAudio.pfnGetDevices        = NULL;
     
    734759
    735760    return VINF_SUCCESS;
    736 }
    737 
    738 
    739 /**
    740  * @interface_method_impl{PDMDRVREG,pfnDestruct}
    741  */
    742 /* static */
    743 DECLCALLBACK(void) AudioVRDE::drvDestruct(PPDMDRVINS pDrvIns)
    744 {
    745     PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
    746     PDRVAUDIOVRDE pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIOVRDE);
    747     LogFlowFuncEnter();
    748 
    749     /*
    750      * If the AudioVRDE object is still alive, we must clear it's reference to
    751      * us since we'll be invalid when we return from this method.
    752      */
    753     if (pThis->pAudioVRDE)
    754     {
    755         pThis->pAudioVRDE->mpDrv = NULL;
    756         pThis->pAudioVRDE = NULL;
    757     }
    758 }
    759 
    760 /**
    761  * @interface_method_impl{PDMDRVREG,pfnAttach}
    762  */
    763 /* static */
    764 DECLCALLBACK(int) AudioVRDE::drvAttach(PPDMDRVINS pDrvIns, uint32_t fFlags)
    765 {
    766     RT_NOREF(pDrvIns, fFlags);
    767 
    768     LogFlowFuncEnter();
    769 
    770     return VINF_SUCCESS;
    771 }
    772 
    773 /**
    774  * @interface_method_impl{PDMDRVREG,pfnDetach}
    775  */
    776 /* static */
    777 DECLCALLBACK(void) AudioVRDE::drvDetach(PPDMDRVINS pDrvIns, uint32_t fFlags)
    778 {
    779     RT_NOREF(pDrvIns, fFlags);
    780 
    781     LogFlowFuncEnter();
    782761}
    783762
     
    822801    NULL,
    823802    /* pfnAttach */
    824     AudioVRDE::drvAttach,
     803    NULL,
    825804    /* pfnDetach */
    826     AudioVRDE::drvDetach,
     805    NULL,
    827806    /* pfnPowerOff */
    828     NULL,
     807    AudioVRDE::drvPowerOff,
    829808    /* pfnSoftReset */
    830809    NULL,
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