VirtualBox

Changeset 88358 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Apr 4, 2021 11:35:36 PM (4 years ago)
Author:
vboxsync
Message:

Audio: Kicked out the unused callback registration interface aimed at the device side. This should be done using interfaces when/if needed (DrvAudio queries callback interfaces from the device, the device implements the ones it needs). bugref:9890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r88357 r88358  
    460460 *       expects audio data in st_sample_t format (historical reasons)
    461461 *       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.)
    462468 */
    463469typedef struct PDMAUDIOFRAME
     
    472478/** Pointer to a const single (stereo) audio frame. */
    473479typedef PDMAUDIOFRAME const *PCPDMAUDIOFRAME;
    474 
    475 typedef enum PDMAUDIOENDIANNESS
    476 {
    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 = 0x7fffffff
    489 } PDMAUDIOENDIANNESS;
    490 
    491 /** @def PDMAUDIOHOSTENDIANNESS
    492  * The PDMAUDIOENDIANNESS value for the host. */
    493 #if defined(RT_LITTLE_ENDIAN)
    494 # define PDMAUDIOHOSTENDIANNESS PDMAUDIOENDIANNESS_LITTLE
    495 #elif defined(RT_BIG_ENDIAN)
    496 # define PDMAUDIOHOSTENDIANNESS PDMAUDIOENDIANNESS_BIG
    497 #else
    498 # error "Port me!"
    499 #endif
    500480
    501481/**
     
    683663    /** Associated data buffer. */
    684664    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).  */
    685677} PDMAUDIOSTREAMMAP;
    686678/** Pointer to an audio stream channel mapping. */
     
    1002994
    1003995/**
    1004  * Audio callback source.
    1005  */
    1006 typedef enum PDMAUDIOCBSOURCE
    1007 {
    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 = 0x7fffffff
    1018 } PDMAUDIOCBSOURCE;
    1019 
    1020 /**
    1021  * Audio device callback types.
    1022  * Those callbacks are being sent from the audio connector ->  device emulation.
    1023  */
    1024 typedef enum PDMAUDIODEVICECBTYPE
    1025 {
    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 = 0x7fffffff
    1034 } 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_INPUT
    1041 {
    1042     /** Input: How many bytes are availabe as input for passing
    1043      *         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_OUTPUT
    1054 {
    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 #endif
    1061 
    1062 /**
    1063996 * Audio backend callback types.
    1064997 * Those callbacks are being sent from the backend -> audio connector.
     
    10951028typedef FNPDMHOSTAUDIOCALLBACK *PFNPDMHOSTAUDIOCALLBACK;
    10961029
    1097 /**
    1098  * Audio callback registration record.
    1099  */
    1100 typedef struct PDMAUDIOCBRECORD
    1101 {
    1102     /** List node. */
    1103     RTLISTANCHOR        Node;
    1104     /** Callback source. */
    1105     PDMAUDIOCBSOURCE    enmSource;
    1106     /** Callback type, based on the given source. */
    1107     union
    1108     {
    1109         /** Device callback stuff. */
    1110         struct
    1111         {
    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;
    11231030
    11241031/** @todo r=bird: What is this exactly? */
     
    13251232                                                 uint32_t *pcFramesCaptured));
    13261233
    1327     /**
    1328      * Registers (device) callbacks.
    1329      * This is handy for letting the device emulation know of certain events, e.g. processing input / output data
    1330      * 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 on
    1338      *       the subject.
    1339      */
    1340     DECLR3CALLBACKMEMBER(int, pfnRegisterCallbacks, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOCBRECORD paCallbacks,
    1341                                                      size_t cCallbacks));
    1342 
    13431234} PDMIAUDIOCONNECTOR;
    13441235
    13451236/** PDMIAUDIOCONNECTOR interface ID. */
    1346 #define PDMIAUDIOCONNECTOR_IID                  "23c23c64-89aa-43b1-b20e-ba6881ab5746"
     1237#define PDMIAUDIOCONNECTOR_IID                  "122511ca-deb3-4630-ad31-ade9f3177df4"
    13471238
    13481239
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