Changeset 54230 in vbox for trunk/include/VBox/vmm
- Timestamp:
- Feb 17, 2015 1:13:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r53831 r54230 4 4 5 5 /* 6 * Copyright (C) 2006-201 4Oracle Corporation6 * Copyright (C) 2006-2015 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 64 64 65 65 /** 66 * Function pointer for device emulation callback.67 */68 typedef void (*PDMAUDIOCALLBACK_FN) (void *pvContext, uint32_t cbData);69 70 /**71 * Structure holding all necessary callback data to communicate72 * with the sound device emulation, e.g. for reading or writing73 * audio data.74 */75 typedef struct PDMAUDIOCALLBACK76 {77 /** Callback function to use in the device emulation. */78 PDMAUDIOCALLBACK_FN fn;79 /** Opaque pointer to context data given on callback80 * creation. Set by the device emulation. */81 void *pvContext;82 } PDMAUDIOCALLBACK, *PPDMAUDIOCALLBACK;83 84 /**85 66 * Audio configuration of a certain backend. 86 67 */ … … 142 123 #endif 143 124 144 typedef enum 125 typedef enum PDMAUDIODIR 126 { 127 PDMAUDIODIR_UNKNOWN = 0, 128 PDMAUDIODIR_IN = 1, 129 PDMAUDIODIR_OUT = 2, 130 PDMAUDIODIR_BOTH = 3 131 } PDMAUDIODIR; 132 133 typedef enum PDMAUDIOMIXERCTL 145 134 { 146 135 PDMAUDIOMIXERCTL_UNKNOWN = 0, … … 152 141 } PDMAUDIOMIXERCTL; 153 142 154 typedef enum 143 typedef enum PDMAUDIORECSOURCE 155 144 { 156 145 PDMAUDIORECSOURCE_UNKNOWN = 0, … … 372 361 /** Pointer to associated host input stream. */ 373 362 PPDMAUDIOHSTSTRMIN pHstStrmIn; 374 /**375 * Callback set by the device emulation on creation.376 * This function is used to mix the guest input samples into the target377 * host input recording buffer. */378 PDMAUDIOCALLBACK Callback;379 363 } PDMAUDIOGSTSTRMIN, *PPDMAUDIOGSTSTRMIN; 380 364 … … 397 381 /** Pointer to the associated host output stream. */ 398 382 PPDMAUDIOHSTSTRMOUT pHstStrmOut; 399 /**400 * Callback set by the device emulation on creation.401 * This function is used to tell the device emulation that we're ready to402 * process new samples.403 */404 PDMAUDIOCALLBACK Callback;405 383 } PDMAUDIOGSTSTRMOUT, *PPDMAUDIOGSTSTRMOUT; 406 384 … … 414 392 typedef struct PDMIAUDIOCONNECTOR 415 393 { 416 DECLR3CALLBACKMEMBER(int, pfnQuery Data, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcbAvailIn, uint32_t *pcbFreeOut, uint32_t *pcSamplesLive));394 DECLR3CALLBACKMEMBER(int, pfnQueryStatus, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcbAvailIn, uint32_t *pcbFreeOut, uint32_t *pcSamplesLive)); 417 395 418 396 /** … … 476 454 * @param uVolRight Right audio stream volume. 477 455 */ 478 DECLR3CALLBACKMEMBER(int, pfn IsSetOutVolume, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut,479 456 DECLR3CALLBACKMEMBER(int, pfnSetVolumeOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut, 457 bool fMute, uint8_t uVolLeft, uint8_t uVolRight)); 480 458 481 459 /** … … 534 512 * @param pszName Name of the audio channel. 535 513 * @param enmRecSource Specifies the type of recording source to be opened. 536 * @param fnCallback Callback function to be assigned to this input stream.537 * @param pvCallback Pointer to parameters assigned to the callback function.538 514 * @param pCfg Pointer to PDMAUDIOSTREAMCFG to use. 539 515 * @param ppGstStrmIn Pointer where to return the guest guest input stream on success. 540 516 */ 541 517 DECLR3CALLBACKMEMBER(int, pfnOpenIn, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName, 542 PDMAUDIORECSOURCE enmRecSource, 543 PDMAUDIOCALLBACK_FN fnCallback, void *pvCallback, 544 PPDMAUDIOSTREAMCFG pCfg, 518 PDMAUDIORECSOURCE enmRecSource, PPDMAUDIOSTREAMCFG pCfg, 545 519 PPDMAUDIOGSTSTRMIN *ppGstStrmIn)); 546 520 … … 551 525 * @param pInterface Pointer to the interface structure containing the called function pointer. 552 526 * @param pszName Name of the audio channel. 553 * @param fnCallback Callback function to be assigned to this input stream.554 * @param pvCallback Pointer to parameters assigned to the callback function.555 527 * @param pCfg Pointer to PDMAUDIOSTREAMCFG to use. 556 528 * @param ppGstStrmOut Pointer where to return the guest guest input stream on success. 557 529 */ 558 530 DECLR3CALLBACKMEMBER(int, pfnOpenOut, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName, 559 PDMAUDIOCALLBACK_FN fnCallback, void *pvCallback, 560 PPDMAUDIOSTREAMCFG pCfg, 561 PPDMAUDIOGSTSTRMOUT *ppGstStrmOut)); 562 563 DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface)); 531 PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut)); 532 533 DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcSamplesPlayed)); 564 534 565 535 /** … … 585 555 /** PDMIAUDIOCONNECTOR interface ID. */ 586 556 #define PDMIAUDIOCONNECTOR_IID "a41ca770-ed07-4f57-a0a6-41377d9d484f" 557 558 /** Defines all needed interface callbacks for an audio backend. */ 559 #define PDMAUDIO_IHOSTAUDIOR3_CALLBACKS(_aDrvName) \ 560 pThis->IHostAudioR3.pfnCaptureIn = _aDrvName##CaptureIn; \ 561 pThis->IHostAudioR3.pfnControlIn = _aDrvName##ControlIn; \ 562 pThis->IHostAudioR3.pfnControlOut = _aDrvName##ControlOut; \ 563 pThis->IHostAudioR3.pfnFiniIn = _aDrvName##FiniIn; \ 564 pThis->IHostAudioR3.pfnFiniOut = _aDrvName##FiniOut; \ 565 pThis->IHostAudioR3.pfnGetConf = _aDrvName##GetConf; \ 566 pThis->IHostAudioR3.pfnInit = _aDrvName##Init; \ 567 pThis->IHostAudioR3.pfnInitIn = _aDrvName##InitIn; \ 568 pThis->IHostAudioR3.pfnInitOut = _aDrvName##InitOut; \ 569 pThis->IHostAudioR3.pfnIsEnabled = _aDrvName##IsEnabled; \ 570 pThis->IHostAudioR3.pfnPlayOut = _aDrvName##PlayOut; 587 571 588 572 /** Pointer to a host audio interface. */ … … 661 645 DECLR3CALLBACKMEMBER(int, pfnFiniOut, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut)); 662 646 663 /** 664 * Plays an audio stream. 647 DECLR3CALLBACKMEMBER(bool, pfnIsEnabled, (PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)); 648 649 /** 650 * Plays a host audio stream. 665 651 * 666 652 * @returns VBox status code.
Note:
See TracChangeset
for help on using the changeset viewer.