Changeset 89479 in vbox for trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
- Timestamp:
- Jun 3, 2021 12:35:28 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r89443 r89479 53 53 *********************************************************************************************************************************/ 54 54 /** 55 * OSS host audio driver instance data.56 * @implements PDMIAUDIOCONNECTOR57 */58 typedef struct DRVHOSTOSSAUDIO59 {60 /** Pointer to the driver instance structure. */61 PPDMDRVINS pDrvIns;62 /** Pointer to host audio interface. */63 PDMIHOSTAUDIO IHostAudio;64 /** Error count for not flooding the release log.65 * UINT32_MAX for unlimited logging. */66 uint32_t cLogErrors;67 } DRVHOSTOSSAUDIO;68 /** Pointer to the instance data for an OSS host audio driver. */69 typedef DRVHOSTOSSAUDIO *PDRVHOSTOSSAUDIO;70 71 /**72 55 * OSS audio stream configuration. 73 56 */ 74 typedef struct OSSAUDIOSTREAMCFG57 typedef struct DRVHSTAUDOSSSTREAMCFG 75 58 { 76 59 PDMAUDIOPCMPROPS Props; … … 79 62 uint16_t cbFragmentLog2; 80 63 uint32_t cbFragment; 81 } OSSAUDIOSTREAMCFG;64 } DRVHSTAUDOSSSTREAMCFG; 82 65 /** Pointer to an OSS audio stream configuration. */ 83 typedef OSSAUDIOSTREAMCFG *POSSAUDIOSTREAMCFG;66 typedef DRVHSTAUDOSSSTREAMCFG *PDRVHSTAUDOSSSTREAMCFG; 84 67 85 68 /** 86 69 * OSS audio stream. 87 70 */ 88 typedef struct OSSAUDIOSTREAM71 typedef struct DRVHSTAUDOSSSTREAM 89 72 { 90 73 /** Common part. */ … … 101 84 PDMAUDIOSTREAMCFG Cfg; 102 85 /** The acquired OSS configuration. */ 103 OSSAUDIOSTREAMCFGOssCfg;86 DRVHSTAUDOSSSTREAMCFG OssCfg; 104 87 /** Handle to the thread draining output streams. */ 105 88 RTTHREAD hThreadDrain; 106 } OSSAUDIOSTREAM;89 } DRVHSTAUDOSSSTREAM; 107 90 /** Pointer to an OSS audio stream. */ 108 typedef OSSAUDIOSTREAM *POSSAUDIOSTREAM; 91 typedef DRVHSTAUDOSSSTREAM *PDRVHSTAUDOSSSTREAM; 92 93 /** 94 * OSS host audio driver instance data. 95 * @implements PDMIAUDIOCONNECTOR 96 */ 97 typedef struct DRVHSTAUDOSS 98 { 99 /** Pointer to the driver instance structure. */ 100 PPDMDRVINS pDrvIns; 101 /** Pointer to host audio interface. */ 102 PDMIHOSTAUDIO IHostAudio; 103 /** Error count for not flooding the release log. 104 * UINT32_MAX for unlimited logging. */ 105 uint32_t cLogErrors; 106 } DRVHSTAUDOSS; 107 /** Pointer to the instance data for an OSS host audio driver. */ 108 typedef DRVHSTAUDOSS *PDRVHSTAUDOSS; 109 109 110 110 … … 119 119 120 120 121 static int ossOSSToAudioProps(PPDMAUDIOPCMPROPS pProps, int fmt, int cChannels, int uHz)121 static int drvHstAudOssToPdmAudioProps(PPDMAUDIOPCMPROPS pProps, int fmt, int cChannels, int uHz) 122 122 { 123 123 switch (fmt) … … 155 155 156 156 157 static int ossStreamClose(int *phFile)157 static int drvHstAudOssStreamClose(int *phFile) 158 158 { 159 159 if (!phFile || !*phFile || *phFile == -1) … … 179 179 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetConfig} 180 180 */ 181 static DECLCALLBACK(int) drvH ostOssAudioHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)181 static DECLCALLBACK(int) drvHstAudOssHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg) 182 182 { 183 183 RT_NOREF(pInterface); … … 187 187 */ 188 188 RTStrCopy(pBackendCfg->szName, sizeof(pBackendCfg->szName), "OSS"); 189 pBackendCfg->cbStream = sizeof( OSSAUDIOSTREAM);189 pBackendCfg->cbStream = sizeof(DRVHSTAUDOSSSTREAM); 190 190 pBackendCfg->fFlags = 0; 191 191 pBackendCfg->cMaxStreamsIn = 0; … … 242 242 243 243 244 245 246 244 /** 247 245 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus} 248 246 */ 249 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvH ostOssAudioHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)247 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHstAudOssHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir) 250 248 { 251 249 AssertPtrReturn(pInterface, PDMAUDIOBACKENDSTS_UNKNOWN); … … 256 254 257 255 258 static int ossStreamConfigure(int hFile, bool fInput, POSSAUDIOSTREAMCFG pOSSReq, POSSAUDIOSTREAMCFG pOSSAcq)256 static int drvHstAudOssStreamConfigure(int hFile, bool fInput, PDRVHSTAUDOSSSTREAMCFG pOSSReq, PDRVHSTAUDOSSSTREAMCFG pOSSAcq) 259 257 { 260 258 /* … … 334 332 RTErrConvertFromErrno(errno)); 335 333 336 int rc = ossOSSToAudioProps(&pOSSAcq->Props, iFormat, cChannels, iFrequenc);334 int rc = drvHstAudOssToPdmAudioProps(&pOSSAcq->Props, iFormat, cChannels, iFrequenc); 337 335 if (RT_SUCCESS(rc)) 338 336 { … … 353 351 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCreate} 354 352 */ 355 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,356 353 static DECLCALLBACK(int) drvHstAudOssHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 354 PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq) 357 355 { 358 356 AssertPtr(pInterface); RT_NOREF(pInterface); 359 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;357 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 360 358 AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER); 361 359 AssertPtrReturn(pCfgReq, VERR_INVALID_POINTER); … … 383 381 * channel mappings and whatnot. 384 382 */ 385 OSSAUDIOSTREAMCFG ReqOssCfg;383 DRVHSTAUDOSSSTREAMCFG ReqOssCfg; 386 384 RT_ZERO(ReqOssCfg); 387 385 … … 399 397 AssertLogRelStmt(cbBuffer < ((uint32_t)0x7ffe << ReqOssCfg.cbFragmentLog2), ReqOssCfg.cFragments = 0x7ffe); 400 398 401 rc = ossStreamConfigure(pStreamOSS->hFile, pCfgReq->enmDir == PDMAUDIODIR_IN, &ReqOssCfg, &pStreamOSS->OssCfg);399 rc = drvHstAudOssStreamConfigure(pStreamOSS->hFile, pCfgReq->enmDir == PDMAUDIODIR_IN, &ReqOssCfg, &pStreamOSS->OssCfg); 402 400 if (RT_SUCCESS(rc)) 403 401 { … … 412 410 413 411 memcpy(&pCfgAcq->Props, &pStreamOSS->OssCfg.Props, sizeof(PDMAUDIOPCMPROPS)); 414 pCfgAcq->Backend.cFramesPeriod = PDMAudioPropsBytesToFrames(&pCfgAcq->Props, pStreamOSS->OssCfg.cbFragment); 415 pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * pStreamOSS->OssCfg.cFragments; 416 if (pCfgReq->enmDir == PDMAUDIODIR_OUT) 417 pCfgAcq->Backend.cFramesPreBuffering = (uint64_t)pCfgReq->Backend.cFramesPreBuffering 418 * pCfgAcq->Backend.cFramesBufferSize 419 / RT_MAX(pCfgReq->Backend.cFramesBufferSize, 1); 420 else 421 pCfgAcq->Backend.cFramesPreBuffering = 0; /** @todo is this sane? */ 412 pCfgAcq->Backend.cFramesPeriod = PDMAudioPropsBytesToFrames(&pCfgAcq->Props, pStreamOSS->OssCfg.cbFragment); 413 pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * pStreamOSS->OssCfg.cFragments; 414 pCfgAcq->Backend.cFramesPreBuffering = (uint64_t)pCfgReq->Backend.cFramesPreBuffering 415 * pCfgAcq->Backend.cFramesBufferSize 416 / RT_MAX(pCfgReq->Backend.cFramesBufferSize, 1); 422 417 423 418 /* … … 427 422 return VINF_SUCCESS; 428 423 } 429 ossStreamClose(&pStreamOSS->hFile);424 drvHstAudOssStreamClose(&pStreamOSS->hFile); 430 425 } 431 426 else … … 442 437 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 443 438 */ 444 static DECLCALLBACK(int) drvHostOssAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 445 bool fImmediate) 439 static DECLCALLBACK(int) drvHstAudOssHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, bool fImmediate) 446 440 { 447 441 RT_NOREF(pInterface, fImmediate); 448 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;442 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 449 443 AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER); 450 444 451 ossStreamClose(&pStreamOSS->hFile);445 drvHstAudOssStreamClose(&pStreamOSS->hFile); 452 446 453 447 if (pStreamOSS->hThreadDrain != NIL_RTTHREAD) … … 465 459 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 466 460 */ 467 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)461 static DECLCALLBACK(int) drvHstAudOssHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 468 462 { 469 463 RT_NOREF(pInterface); 470 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;464 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 471 465 472 466 /** @todo this might be a little optimisitic... */ … … 496 490 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 497 491 */ 498 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)492 static DECLCALLBACK(int) drvHstAudOssHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 499 493 { 500 494 RT_NOREF(pInterface); 501 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;495 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 502 496 503 497 int rc; … … 548 542 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 549 543 */ 550 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)551 { 552 return drvH ostOssAudioHA_StreamDisable(pInterface, pStream);544 static DECLCALLBACK(int) drvHstAudOssHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 545 { 546 return drvHstAudOssHA_StreamDisable(pInterface, pStream); 553 547 } 554 548 … … 557 551 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 558 552 */ 559 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)560 { 561 return drvH ostOssAudioHA_StreamEnable(pInterface, pStream);553 static DECLCALLBACK(int) drvHstAudOssHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 554 { 555 return drvHstAudOssHA_StreamEnable(pInterface, pStream); 562 556 } 563 557 … … 567 561 * Thread for calling SNDCTL_DSP_SYNC (blocking) on an output stream.} 568 562 */ 569 static DECLCALLBACK(int) drvH ostOssAudioDrainThread(RTTHREAD ThreadSelf, void *pvUser)563 static DECLCALLBACK(int) drvHstAudOssDrainThread(RTTHREAD ThreadSelf, void *pvUser) 570 564 { 571 565 RT_NOREF(ThreadSelf); 572 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pvUser;566 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pvUser; 573 567 int rc; 574 568 … … 609 603 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 610 604 */ 611 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)612 { 613 PDRVH OSTOSSAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTOSSAUDIO, IHostAudio);614 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;605 static DECLCALLBACK(int) drvHstAudOssHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 606 { 607 PDRVHSTAUDOSS pThis = RT_FROM_MEMBER(pInterface, DRVHSTAUDOSS, IHostAudio); 608 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 615 609 AssertReturn(pStreamOSS->Cfg.enmDir == PDMAUDIODIR_OUT, VERR_WRONG_ORDER); 616 610 … … 638 632 } 639 633 640 int rc = RTThreadCreateF(&pStreamOSS->hThreadDrain, drvH ostOssAudioDrainThread, pStreamOSS, 0,634 int rc = RTThreadCreateF(&pStreamOSS->hThreadDrain, drvHstAudOssDrainThread, pStreamOSS, 0, 641 635 RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "ossdrai%u", pThis->pDrvIns->iInstance); 642 636 LogFunc(("Started drain thread: %Rrc\n", rc)); … … 647 641 648 642 649 650 643 /** 651 644 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl} 652 645 */ 653 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamControl(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,654 646 static DECLCALLBACK(int) drvHstAudOssHA_StreamControl(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 647 PDMAUDIOSTREAMCMD enmStreamCmd) 655 648 { 656 649 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method, … … 661 654 { 662 655 case PDMAUDIOSTREAMCMD_ENABLE: 663 return drvH ostOssAudioHA_StreamEnable(pInterface, pStream);656 return drvHstAudOssHA_StreamEnable(pInterface, pStream); 664 657 case PDMAUDIOSTREAMCMD_DISABLE: 665 return drvH ostOssAudioHA_StreamDisable(pInterface, pStream);658 return drvHstAudOssHA_StreamDisable(pInterface, pStream); 666 659 case PDMAUDIOSTREAMCMD_PAUSE: 667 return drvH ostOssAudioHA_StreamPause(pInterface, pStream);660 return drvHstAudOssHA_StreamPause(pInterface, pStream); 668 661 case PDMAUDIOSTREAMCMD_RESUME: 669 return drvH ostOssAudioHA_StreamResume(pInterface, pStream);662 return drvHstAudOssHA_StreamResume(pInterface, pStream); 670 663 case PDMAUDIOSTREAMCMD_DRAIN: 671 return drvH ostOssAudioHA_StreamDrain(pInterface, pStream);664 return drvHstAudOssHA_StreamDrain(pInterface, pStream); 672 665 /** @todo the drain call for OSS is SNDCTL_DSP_SYNC, however in the non-ALSA 673 666 * implementation of OSS it is probably blocking. Also, it comes with … … 686 679 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable} 687 680 */ 688 static DECLCALLBACK(uint32_t) drvH ostOssAudioHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)681 static DECLCALLBACK(uint32_t) drvHstAudOssHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 689 682 { 690 683 RT_NOREF(pInterface, pStream); … … 697 690 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetWritable} 698 691 */ 699 static DECLCALLBACK(uint32_t) drvH ostOssAudioHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)692 static DECLCALLBACK(uint32_t) drvHstAudOssHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 700 693 { 701 694 RT_NOREF(pInterface); 702 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;695 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 703 696 AssertPtr(pStreamOSS); 704 697 … … 733 726 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetState} 734 727 */ 735 static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvH ostOssAudioHA_StreamGetState(PPDMIHOSTAUDIO pInterface,736 728 static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHstAudOssHA_StreamGetState(PPDMIHOSTAUDIO pInterface, 729 PPDMAUDIOBACKENDSTREAM pStream) 737 730 { 738 731 RT_NOREF(pInterface); 739 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;732 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 740 733 AssertPtrReturn(pStreamOSS, PDMHOSTAUDIOSTREAMSTATE_INVALID); 741 734 if (!pStreamOSS->fDraining) … … 748 741 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPlay} 749 742 */ 750 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,751 743 static DECLCALLBACK(int) drvHstAudOssHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 744 const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten) 752 745 { 753 746 RT_NOREF(pInterface); 754 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;747 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 755 748 AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER); 756 749 … … 833 826 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCapture} 834 827 */ 835 static DECLCALLBACK(int) drvH ostOssAudioHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,836 828 static DECLCALLBACK(int) drvHstAudOssHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 829 void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead) 837 830 { 838 831 RT_NOREF(pInterface); 839 P OSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;832 PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream; 840 833 AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER); 841 834 Log3Func(("@%#RX64 cbBuf=%#x %s\n", pStreamOSS->offInternal, cbBuf, pStreamOSS->Cfg.szName)); … … 876 869 877 870 878 879 871 /** 880 872 * @interface_method_impl{PDMIBASE,pfnQueryInterface} 881 873 */ 882 static DECLCALLBACK(void *) drvH ostOSSAudioQueryInterface(PPDMIBASE pInterface, const char *pszIID)883 { 884 PPDMDRVINS 885 PDRVH OSTOSSAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTOSSAUDIO);874 static DECLCALLBACK(void *) drvHstAudOssQueryInterface(PPDMIBASE pInterface, const char *pszIID) 875 { 876 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 877 PDRVHSTAUDOSS pThis = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDOSS); 886 878 887 879 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase); … … 891 883 } 892 884 893 /** 894 * Constructs an OSS audio driver instance. 895 * 896 * @copydoc FNPDMDRVCONSTRUCT897 */ 898 static DECLCALLBACK(int) drvH ostOSSAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)885 886 /** 887 * @interface_method_impl{PDMDRVREG,pfnConstruct, 888 * Constructs an OSS audio driver instance.} 889 */ 890 static DECLCALLBACK(int) drvHstAudOssConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags) 899 891 { 900 892 RT_NOREF(pCfg, fFlags); 901 893 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 902 PDRVH OSTOSSAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTOSSAUDIO);894 PDRVHSTAUDOSS pThis = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDOSS); 903 895 LogRel(("Audio: Initializing OSS driver\n")); 904 896 … … 908 900 pThis->pDrvIns = pDrvIns; 909 901 /* IBase */ 910 pDrvIns->IBase.pfnQueryInterface = drvH ostOSSAudioQueryInterface;902 pDrvIns->IBase.pfnQueryInterface = drvHstAudOssQueryInterface; 911 903 /* IHostAudio */ 912 pThis->IHostAudio.pfnGetConfig = drvH ostOssAudioHA_GetConfig;904 pThis->IHostAudio.pfnGetConfig = drvHstAudOssHA_GetConfig; 913 905 pThis->IHostAudio.pfnGetDevices = NULL; 914 906 pThis->IHostAudio.pfnSetDevice = NULL; 915 pThis->IHostAudio.pfnGetStatus = drvH ostOssAudioHA_GetStatus;907 pThis->IHostAudio.pfnGetStatus = drvHstAudOssHA_GetStatus; 916 908 pThis->IHostAudio.pfnDoOnWorkerThread = NULL; 917 909 pThis->IHostAudio.pfnStreamConfigHint = NULL; 918 pThis->IHostAudio.pfnStreamCreate = drvH ostOssAudioHA_StreamCreate;910 pThis->IHostAudio.pfnStreamCreate = drvHstAudOssHA_StreamCreate; 919 911 pThis->IHostAudio.pfnStreamInitAsync = NULL; 920 pThis->IHostAudio.pfnStreamDestroy = drvH ostOssAudioHA_StreamDestroy;912 pThis->IHostAudio.pfnStreamDestroy = drvHstAudOssHA_StreamDestroy; 921 913 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 922 pThis->IHostAudio.pfnStreamControl = drvH ostOssAudioHA_StreamControl;923 pThis->IHostAudio.pfnStreamGetReadable = drvH ostOssAudioHA_StreamGetReadable;924 pThis->IHostAudio.pfnStreamGetWritable = drvH ostOssAudioHA_StreamGetWritable;914 pThis->IHostAudio.pfnStreamControl = drvHstAudOssHA_StreamControl; 915 pThis->IHostAudio.pfnStreamGetReadable = drvHstAudOssHA_StreamGetReadable; 916 pThis->IHostAudio.pfnStreamGetWritable = drvHstAudOssHA_StreamGetWritable; 925 917 pThis->IHostAudio.pfnStreamGetPending = NULL; 926 pThis->IHostAudio.pfnStreamGetState = drvH ostOssAudioHA_StreamGetState;927 pThis->IHostAudio.pfnStreamPlay = drvH ostOssAudioHA_StreamPlay;928 pThis->IHostAudio.pfnStreamCapture = drvH ostOssAudioHA_StreamCapture;918 pThis->IHostAudio.pfnStreamGetState = drvHstAudOssHA_StreamGetState; 919 pThis->IHostAudio.pfnStreamPlay = drvHstAudOssHA_StreamPlay; 920 pThis->IHostAudio.pfnStreamCapture = drvHstAudOssHA_StreamCapture; 929 921 930 922 return VINF_SUCCESS; … … 954 946 ~0U, 955 947 /* cbInstance */ 956 sizeof(DRVH OSTOSSAUDIO),948 sizeof(DRVHSTAUDOSS), 957 949 /* pfnConstruct */ 958 drvH ostOSSAudioConstruct,950 drvHstAudOssConstruct, 959 951 /* pfnDestruct */ 960 952 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.