Changeset 60925 in vbox for trunk/include/VBox/vmm
- Timestamp:
- May 10, 2016 1:27:44 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r60368 r60925 28 28 29 29 #include <VBox/types.h> 30 #include <iprt/circbuf.h> 30 31 #include <iprt/critsect.h> 31 32 #include <iprt/list.h> … … 52 53 typedef enum PDMAUDIOFMT 53 54 { 54 AUD_FMT_INVALID,55 AUD_FMT_U8,56 AUD_FMT_S8,57 AUD_FMT_U16,58 AUD_FMT_S16,59 AUD_FMT_U32,60 AUD_FMT_S32,55 PDMAUDIOFMT_INVALID, 56 PDMAUDIOFMT_U8, 57 PDMAUDIOFMT_S8, 58 PDMAUDIOFMT_U16, 59 PDMAUDIOFMT_S16, 60 PDMAUDIOFMT_U32, 61 PDMAUDIOFMT_S32, 61 62 /** Hack to blow the type up to 32-bit. */ 62 AUD_FMT_32BIT_HACK = 0x7fffffff63 PDMAUDIOFMT_32BIT_HACK = 0x7fffffff 63 64 } PDMAUDIOFMT; 64 65 … … 152 153 153 154 /** 155 * Audio stream (data) layout. 156 */ 157 typedef enum PDMAUDIOSTREAMLAYOUT 158 { 159 /** Unknown access type; do not use. */ 160 PDMAUDIOSTREAMLAYOUT_UNKNOWN = 0, 161 /** Non-interleaved access, that is, consecutive 162 * access to the data. */ 163 PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED, 164 /** Interleaved access, where the data can be 165 * mixed together with data of other audio streams. */ 166 PDMAUDIOSTREAMLAYOUT_INTERLEAVED 167 } PDMAUDIOSTREAMLAYOUT, *PPDMAUDIOSTREAMLAYOUT; 168 169 /** No stream channel data flags defined. */ 170 #define PDMAUDIOSTREAMCHANNELDATA_FLAG_NONE 0 171 172 /** 173 * Structure for keeping a stream channel data block around. 174 */ 175 typedef struct PDMAUDIOSTREAMCHANNELDATA 176 { 177 /** Circular buffer for the channel data. */ 178 PRTCIRCBUF pCircBuf; 179 size_t cbAcq; 180 /** Channel data flags. */ 181 uint32_t fFlags; 182 } PDMAUDIOSTREAMCHANNELDATA, *PPDMAUDIOSTREAMCHANNELDATA; 183 184 /** 185 * Structure for a single channel of an audio stream. 186 * An audio stream consists of one or multiple channels, 187 * depending on the configuration. 188 */ 189 typedef struct PDMAUDIOSTREAMCHANNEL 190 { 191 /** Channel ID. */ 192 uint8_t uChannel; 193 /** Step size (in bytes) to the channel's next frame. */ 194 size_t cbStep; 195 /** Frame size (in bytes) of this channel. */ 196 size_t cbFrame; 197 /** Offset (in bytes) to first sample in the data block. */ 198 size_t cbFirst; 199 /** Currente offset (in bytes) in the data stream. */ 200 size_t cbOff; 201 /** Associated data buffer. */ 202 PDMAUDIOSTREAMCHANNELDATA Data; 203 } PDMAUDIOSTREAMCHANNEL, *PPDMAUDIOSTREAMCHANNEL; 204 205 /** 154 206 * Structure for keeping an audio stream configuration. 155 207 */ … … 157 209 { 158 210 /** Friendly name of the stream. */ 159 c onst char *pszName;211 char szName[64]; 160 212 /** Direction of the stream. */ 161 213 PDMAUDIODIR enmDir; … … 169 221 /** Frequency in Hertz (Hz). */ 170 222 uint32_t uHz; 171 /** Number of channels (2 for stereo, 1 for mono). */223 /** Number of audio channels (2 for stereo, 1 for mono). */ 172 224 uint8_t cChannels; 173 225 /** Audio format. */ … … 337 389 */ 338 390 int64_t iFreqRatio; 339 /* For quickly converting samples <-> bytes and 340 * vice versa. */ 391 /** For quickly converting samples <-> bytes and vice versa. */ 341 392 uint8_t cShift; 342 393 } PDMAUDIOMIXBUF; … … 347 398 /** No flags being set. */ 348 399 #define PDMAUDIOSTRMSTS_FLAG_NONE 0 400 /** Whether this stream has been initialized by the 401 * backend or not. */ 402 #define PDMAUDIOSTRMSTS_FLAG_INITIALIZED RT_BIT_32(0) 349 403 /** Whether this stream is enabled or disabled. */ 350 #define PDMAUDIOSTRMSTS_FLAG_ENABLED RT_BIT_32( 0)404 #define PDMAUDIOSTRMSTS_FLAG_ENABLED RT_BIT_32(1) 351 405 /** Whether this stream has been paused or not. This also implies 352 406 * that this is an enabled stream! */ 353 #define PDMAUDIOSTRMSTS_FLAG_PAUSED RT_BIT_32( 1)407 #define PDMAUDIOSTRMSTS_FLAG_PAUSED RT_BIT_32(2) 354 408 /** Whether this stream was marked as being disabled 355 409 * but there are still associated guest output streams 356 410 * which rely on its data. */ 357 #define PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE RT_BIT_32( 2)411 #define PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE RT_BIT_32(3) 358 412 /** Validation mask. */ 359 #define PDMAUDIOSTRMSTS_VALID_MASK UINT32_C(0x0000000 7)413 #define PDMAUDIOSTRMSTS_VALID_MASK UINT32_C(0x0000000F) 360 414 361 415 /** … … 418 472 bool fEmpty; 419 473 /** Name of this stream. */ 420 char *pszName;474 char szName[64]; 421 475 /** Number of references to this stream. Only can be 422 476 * destroyed if the reference count is reaching 0. */ 423 uint 8_tcRefs;477 uint32_t cRefs; 424 478 } PDMAUDIOGSTSTRMSTATE, *PPDMAUDIOGSTSTRMSTATE; 425 479 … … 515 569 /** 516 570 * Audio connector interface (up). 571 ** @todo Get rid of the separate XXXIn and XXXOut methods and unify the In/Out structs with a union, 572 ** so that we only have one guest and one host stream ultimately. 517 573 */ 518 574 typedef struct PDMIAUDIOCONNECTOR 519 575 { 520 576 DECLR3CALLBACKMEMBER(int, pfnQueryStatus, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcbAvailIn, uint32_t *pcbFreeOut, uint32_t *pcSamplesLive)); 577 578 /** 579 * Adds a reference to the specified input stream. 580 * 581 * @returns New reference count. 582 * @param pInterface Pointer to the interface structure containing the called function pointer. 583 * @param pGstStrmIn Pointer to guest input stream adding the reference to. 584 */ 585 DECLR3CALLBACKMEMBER(uint32_t, pfnAddRefIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn)); 586 587 /** 588 * Adds a reference to the specified output stream. 589 * 590 * @returns New reference count. 591 * @param pInterface Pointer to the interface structure containing the called function pointer. 592 * @param pGstStrmOut Pointer to guest output stream adding the reference to. 593 */ 594 DECLR3CALLBACKMEMBER(uint32_t, pfnAddRefOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut)); 595 596 /** 597 * Releases a reference from the input specified stream. 598 * 599 * @returns New reference count. 600 * @param pInterface Pointer to the interface structure containing the called function pointer. 601 * @param pGstStrmIn Pointer to guest input stream releasing a reference from. 602 */ 603 DECLR3CALLBACKMEMBER(uint32_t, pfnReleaseIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn)); 604 605 /** 606 * Releases a reference from the output specified stream. 607 * 608 * @returns New reference count. 609 * @param pInterface Pointer to the interface structure containing the called function pointer. 610 * @param pGstStrmOut Pointer to guest output stream releasing a reference from. 611 */ 612 DECLR3CALLBACKMEMBER(uint32_t, pfnReleaseOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut)); 521 613 522 614 /** … … 552 644 * @param pCfg Where to store the host audio backend configuration data. 553 645 */ 554 DECLR3CALLBACKMEMBER(int, pfnGetConfig uration, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOBACKENDCFG pCfg));646 DECLR3CALLBACKMEMBER(int, pfnGetConfig, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOBACKENDCFG pCfg)); 555 647 556 648 /** … … 616 708 * @param pInterface Pointer to the interface structure containing the called function pointer. 617 709 * @param pszName Friendly name of this input stream. 618 * @param pCfg Pointer to PDMAUDIOSTREAMCFG to use.619 710 * @param ppGstStrmIn Pointer where to return the guest guest input stream on success. 620 711 */ 621 DECLR3CALLBACKMEMBER(int, pfnCreateIn, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,622 PPDMAUDIO STREAMCFG pCfg, PPDMAUDIOGSTSTRMIN *ppGstStrmIn));712 DECLR3CALLBACKMEMBER(int, pfnCreateIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAMCFG pCfg, 713 PPDMAUDIOGSTSTRMIN *ppGstStrmIn)); 623 714 /** 624 715 * Creates a guest output stream. … … 626 717 * @returns VBox status code. 627 718 * @param pInterface Pointer to the interface structure containing the called function pointer. 628 * @param pszName Friendly name of this output stream.629 719 * @param pCfg Pointer to PDMAUDIOSTREAMCFG to use. 630 720 * @param ppGstStrmOut Pointer where to return the guest guest input stream on success. 631 721 */ 632 DECLR3CALLBACKMEMBER(int, pfnCreateOut, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName, 633 PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut)); 634 722 DECLR3CALLBACKMEMBER(int, pfnCreateOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAMCFG pCfg, 723 PPDMAUDIOGSTSTRMOUT *ppGstStrmOut)); 635 724 /** 636 725 * Destroys a guest input stream. … … 666 755 667 756 /** PDMIAUDIOCONNECTOR interface ID. */ 668 #define PDMIAUDIOCONNECTOR_IID " f0ef4012-ae89-4528-9dad-4ef496894df8"757 #define PDMIAUDIOCONNECTOR_IID "5bba362c-092a-493b-854b-5d0ad3acecc4" 669 758 670 759
Note:
See TracChangeset
for help on using the changeset viewer.