Changeset 88358 in vbox for trunk/include/VBox/vmm
- Timestamp:
- Apr 4, 2021 11:35:36 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r88357 r88358 460 460 * expects audio data in st_sample_t format (historical reasons) 461 461 * which happens to be the same as PDMAUDIOFRAME for now. 462 * 463 * @todo r=bird: This is an internal AudioMixBuffer structure which should not 464 * be exposed here, I think. Only used to some sizeof statements in VRDE. 465 * (The problem with exposing it, is that we would like to move away from 466 * stereo and instead to anything from 1 to 16 channels. That means 467 * removing this structure entirely.) 462 468 */ 463 469 typedef struct PDMAUDIOFRAME … … 472 478 /** Pointer to a const single (stereo) audio frame. */ 473 479 typedef PDMAUDIOFRAME const *PCPDMAUDIOFRAME; 474 475 typedef enum PDMAUDIOENDIANNESS476 {477 /** The usual invalid value. */478 PDMAUDIOENDIANNESS_INVALID = 0,479 /** Little endian. */480 PDMAUDIOENDIANNESS_LITTLE,481 /** Bit endian. */482 PDMAUDIOENDIANNESS_BIG,483 /** Endianness doesn't have a meaning in the context. */484 PDMAUDIOENDIANNESS_NA,485 /** The end of the valid endian values (exclusive). */486 PDMAUDIOENDIANNESS_END,487 /** Hack to blow the type up to 32-bit. */488 PDMAUDIOENDIANNESS_32BIT_HACK = 0x7fffffff489 } PDMAUDIOENDIANNESS;490 491 /** @def PDMAUDIOHOSTENDIANNESS492 * The PDMAUDIOENDIANNESS value for the host. */493 #if defined(RT_LITTLE_ENDIAN)494 # define PDMAUDIOHOSTENDIANNESS PDMAUDIOENDIANNESS_LITTLE495 #elif defined(RT_BIG_ENDIAN)496 # define PDMAUDIOHOSTENDIANNESS PDMAUDIOENDIANNESS_BIG497 #else498 # error "Port me!"499 #endif500 480 501 481 /** … … 683 663 /** Associated data buffer. */ 684 664 PDMAUDIOSTREAMCHANNELDATA Data; 665 666 /** @todo r=bird: I'd structure this very differently. 667 * I would've had an array of channel descriptors like this: 668 * 669 * struct PDMAUDIOCHANNELDESC 670 * { 671 * uint8_t off; //< Stream offset in bytes. 672 * uint8_t id; //< PDMAUDIOSTREAMCHANNELID 673 * }; 674 * 675 * And I'd baked it into PDMAUDIOPCMPROPS as a fixed sized array with 16 entries 676 * (max HDA channel count IIRC). */ 685 677 } PDMAUDIOSTREAMMAP; 686 678 /** Pointer to an audio stream channel mapping. */ … … 1002 994 1003 995 /** 1004 * Audio callback source.1005 */1006 typedef enum PDMAUDIOCBSOURCE1007 {1008 /** Invalid, do not use. */1009 PDMAUDIOCBSOURCE_INVALID = 0,1010 /** Device emulation. */1011 PDMAUDIOCBSOURCE_DEVICE,1012 /** Audio connector interface. */1013 PDMAUDIOCBSOURCE_CONNECTOR,1014 /** Backend (lower). */1015 PDMAUDIOCBSOURCE_BACKEND,1016 /** Hack to blow the type up to 32-bit. */1017 PDMAUDIOCBSOURCE_32BIT_HACK = 0x7fffffff1018 } PDMAUDIOCBSOURCE;1019 1020 /**1021 * Audio device callback types.1022 * Those callbacks are being sent from the audio connector -> device emulation.1023 */1024 typedef enum PDMAUDIODEVICECBTYPE1025 {1026 /** Invalid, do not use. */1027 PDMAUDIODEVICECBTYPE_INVALID = 0,1028 /** Data is availabe as input for passing to the device emulation. */1029 PDMAUDIODEVICECBTYPE_DATA_INPUT,1030 /** Free data for the device emulation to write to the backend. */1031 PDMAUDIODEVICECBTYPE_DATA_OUTPUT,1032 /** Hack to blow the type up to 32-bit. */1033 PDMAUDIODEVICECBTYPE_32BIT_HACK = 0x7fffffff1034 } PDMAUDIODEVICECBTYPE;1035 1036 #if 0 /** @todo r=bird: Who needs this exactly? Fix the style or remove */1037 /**1038 * Device callback data for audio input.1039 */1040 typedef struct PDMAUDIODEVICECBDATA_DATA_INPUT1041 {1042 /** Input: How many bytes are availabe as input for passing1043 * to the device emulation. */1044 uint32_t cbInAvail;1045 /** Output: How many bytes have been read. */1046 uint32_t cbOutRead;1047 } PDMAUDIODEVICECBDATA_DATA_INPUT;1048 typedef PDMAUDIODEVICECBDATA_DATA_INPUT *PPDMAUDIODEVICECBDATA_DATA_INPUT;1049 1050 /**1051 * Device callback data for audio output.1052 */1053 typedef struct PDMAUDIODEVICECBDATA_DATA_OUTPUT1054 {1055 /** Input: How many bytes are free for the device emulation to write. */1056 uint32_t cbInFree;1057 /** Output: How many bytes were written by the device emulation. */1058 uint32_t cbOutWritten;1059 } PDMAUDIODEVICECBDATA_DATA_OUTPUT, *PPDMAUDIODEVICECBDATA_DATA_OUTPUT;1060 #endif1061 1062 /**1063 996 * Audio backend callback types. 1064 997 * Those callbacks are being sent from the backend -> audio connector. … … 1095 1028 typedef FNPDMHOSTAUDIOCALLBACK *PFNPDMHOSTAUDIOCALLBACK; 1096 1029 1097 /**1098 * Audio callback registration record.1099 */1100 typedef struct PDMAUDIOCBRECORD1101 {1102 /** List node. */1103 RTLISTANCHOR Node;1104 /** Callback source. */1105 PDMAUDIOCBSOURCE enmSource;1106 /** Callback type, based on the given source. */1107 union1108 {1109 /** Device callback stuff. */1110 struct1111 {1112 PDMAUDIODEVICECBTYPE enmType;1113 } Device;1114 } RT_UNION_NM(u);1115 /** Pointer to context data. Optional. */1116 void *pvCtx;1117 /** Size (in bytes) of context data.1118 * Must be 0 if pvCtx is NULL. */1119 size_t cbCtx;1120 } PDMAUDIOCBRECORD;1121 /** Pointer to an audio callback registration record. */1122 typedef PDMAUDIOCBRECORD *PPDMAUDIOCBRECORD;1123 1030 1124 1031 /** @todo r=bird: What is this exactly? */ … … 1325 1232 uint32_t *pcFramesCaptured)); 1326 1233 1327 /**1328 * Registers (device) callbacks.1329 * This is handy for letting the device emulation know of certain events, e.g. processing input / output data1330 * or configuration changes.1331 *1332 * @returns VBox status code.1333 * @param pInterface Pointer to the interface structure containing the called function pointer.1334 * @param paCallbacks Pointer to array of callbacks to register.1335 * @param cCallbacks Number of callbacks to register.1336 *1337 * @todo r=bird: Total misdesign. See more notes in drvAudioBackendCallback on1338 * the subject.1339 */1340 DECLR3CALLBACKMEMBER(int, pfnRegisterCallbacks, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOCBRECORD paCallbacks,1341 size_t cCallbacks));1342 1343 1234 } PDMIAUDIOCONNECTOR; 1344 1235 1345 1236 /** PDMIAUDIOCONNECTOR interface ID. */ 1346 #define PDMIAUDIOCONNECTOR_IID " 23c23c64-89aa-43b1-b20e-ba6881ab5746"1237 #define PDMIAUDIOCONNECTOR_IID "122511ca-deb3-4630-ad31-ade9f3177df4" 1347 1238 1348 1239
Note:
See TracChangeset
for help on using the changeset viewer.