VirtualBox

Changeset 88230 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Mar 22, 2021 9:55:26 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143421
Message:

Audio: Renamed DrvAudio.h to DrvAudioCommon.h and move the DrvAudio.h structures into DrvAudio.cpp. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
20 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioMixer.cpp

    r88028 r88230  
    7474#include "AudioMixer.h"
    7575#include "AudioMixBuffer.h"
    76 #include "DrvAudio.h"
     76#include "DrvAudioCommon.h"
    7777
    7878#include <VBox/vmm/pdm.h>
  • trunk/src/VBox/Devices/Audio/DevHda.cpp

    r88229 r88230  
    5959#include "DevHdaStreamMap.h"
    6060
    61 #include "DrvAudio.h"
     61#include "DrvAudioCommon.h"
    6262
    6363
  • trunk/src/VBox/Devices/Audio/DevHdaCodec.cpp

    r88228 r88230  
    3939
    4040#include "VBoxDD.h"
    41 #include "DrvAudio.h"
    4241#include "AudioMixer.h"
    4342#include "DevHdaCodec.h"
  • trunk/src/VBox/Devices/Audio/DevHdaCommon.cpp

    r88228 r88230  
    2424#include <iprt/assert.h>
    2525#include <iprt/errcore.h>
     26#include <iprt/time.h>
    2627
    2728#include <VBox/AssertGuest.h>
     
    2930#define LOG_GROUP LOG_GROUP_DEV_HDA
    3031#include <VBox/log.h>
    31 
    32 #include "DrvAudio.h"
    3332
    3433#include "DevHda.h"
  • trunk/src/VBox/Devices/Audio/DevHdaStream.cpp

    r88228 r88230  
    3131#include <VBox/vmm/pdmaudioinline.h>
    3232
    33 #include "DrvAudio.h"
     33#include "DrvAudioCommon.h"
    3434
    3535#include "DevHda.h"
  • trunk/src/VBox/Devices/Audio/DevHdaStreamMap.cpp

    r88228 r88230  
    3030#include <iprt/string.h>
    3131
    32 #include "DrvAudio.h"
     32#include "DrvAudioCommon.h"
    3333
    3434#include "DevHdaStreamChannel.h"
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r88057 r88230  
    4141#include "AudioMixBuffer.h"
    4242#include "AudioMixer.h"
    43 #include "DrvAudio.h"
     43#include "DrvAudioCommon.h"
    4444
    4545
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r88028 r88230  
    6363#include "AudioMixBuffer.h"
    6464#include "AudioMixer.h"
    65 #include "DrvAudio.h"
     65#include "DrvAudioCommon.h"
    6666
    6767
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r88219 r88230  
    4444#include <stdlib.h>
    4545
    46 #include "DrvAudio.h"
     46#include "DrvAudioCommon.h"
    4747#include "AudioMixBuffer.h"
     48
     49
     50/*********************************************************************************************************************************
     51*   Structures and Typedefs                                                                                                      *
     52*********************************************************************************************************************************/
     53typedef enum
     54{
     55    AUD_OPT_INT,
     56    AUD_OPT_FMT,
     57    AUD_OPT_STR,
     58    AUD_OPT_BOOL
     59} audio_option_tag_e;
     60
     61typedef struct audio_option
     62{
     63    const char *name;
     64    audio_option_tag_e tag;
     65    void *valp;
     66    const char *descr;
     67    int *overridenp;
     68    int overriden;
     69} audio_option;
     70
     71#ifdef VBOX_WITH_STATISTICS
     72/**
     73 * Structure for keeping stream statistics for the
     74 * statistic manager (STAM).
     75 */
     76typedef struct DRVAUDIOSTATS
     77{
     78    STAMCOUNTER TotalStreamsActive;
     79    STAMCOUNTER TotalStreamsCreated;
     80    STAMCOUNTER TotalFramesRead;
     81    STAMCOUNTER TotalFramesWritten;
     82    STAMCOUNTER TotalFramesMixedIn;
     83    STAMCOUNTER TotalFramesMixedOut;
     84    STAMCOUNTER TotalFramesLostIn;
     85    STAMCOUNTER TotalFramesLostOut;
     86    STAMCOUNTER TotalFramesOut;
     87    STAMCOUNTER TotalFramesIn;
     88    STAMCOUNTER TotalBytesRead;
     89    STAMCOUNTER TotalBytesWritten;
     90    /** How much delay (in ms) for input processing. */
     91    STAMPROFILEADV DelayIn;
     92    /** How much delay (in ms) for output processing. */
     93    STAMPROFILEADV DelayOut;
     94} DRVAUDIOSTATS, *PDRVAUDIOSTATS;
     95#endif
     96
     97/**
     98 * Audio driver configuration data, tweakable via CFGM.
     99 */
     100typedef struct DRVAUDIOCFG
     101{
     102    /** PCM properties to use. */
     103    PDMAUDIOPCMPROPS     Props;
     104    /** Whether using signed sample data or not.
     105     *  Needed in order to know whether there is a custom value set in CFGM or not.
     106     *  By default set to UINT8_MAX if not set to a custom value. */
     107    uint8_t              uSigned;
     108    /** Whether swapping endianess of sample data or not.
     109     *  Needed in order to know whether there is a custom value set in CFGM or not.
     110     *  By default set to UINT8_MAX if not set to a custom value. */
     111    uint8_t              uSwapEndian;
     112    /** Configures the period size (in ms).
     113     *  This value reflects the time in between each hardware interrupt on the
     114     *  backend (host) side. */
     115    uint32_t             uPeriodSizeMs;
     116    /** Configures the (ring) buffer size (in ms). Often is a multiple of uPeriodMs. */
     117    uint32_t             uBufferSizeMs;
     118    /** Configures the pre-buffering size (in ms).
     119     *  Time needed in buffer before the stream becomes active (pre buffering).
     120     *  The bigger this value is, the more latency for the stream will occur.
     121     *  Set to 0 to disable pre-buffering completely.
     122     *  By default set to UINT32_MAX if not set to a custom value. */
     123    uint32_t             uPreBufSizeMs;
     124    /** The driver's debugging configuration. */
     125    struct
     126    {
     127        /** Whether audio debugging is enabled or not. */
     128        bool             fEnabled;
     129        /** Where to store the debugging files. */
     130        char             szPathOut[RTPATH_MAX];
     131    } Dbg;
     132} DRVAUDIOCFG, *PDRVAUDIOCFG;
     133
     134/**
     135 * Audio driver instance data.
     136 *
     137 * @implements PDMIAUDIOCONNECTOR
     138 */
     139typedef struct DRVAUDIO
     140{
     141    /** Friendly name of the driver. */
     142    char                    szName[64];
     143    /** Critical section for serializing access. */
     144    RTCRITSECT              CritSect;
     145    /** Shutdown indicator. */
     146    bool                    fTerminate;
     147    /** Our audio connector interface. */
     148    PDMIAUDIOCONNECTOR      IAudioConnector;
     149    /** Pointer to the driver instance. */
     150    PPDMDRVINS              pDrvIns;
     151    /** Pointer to audio driver below us. */
     152    PPDMIHOSTAUDIO          pHostDrvAudio;
     153    /** List of audio streams. */
     154    RTLISTANCHOR            lstStreams;
     155#ifdef VBOX_WITH_AUDIO_ENUM
     156    /** Flag indicating to perform an (re-)enumeration of the host audio devices. */
     157    bool                    fEnumerateDevices;
     158#endif
     159    /** Audio configuration settings retrieved from the backend. */
     160    PDMAUDIOBACKENDCFG      BackendCfg;
     161    /** Commonly used scratch buffer. */
     162    void                   *pvScratchBuf;
     163    /** Size (in bytes) of commonly used scratch buffer. */
     164    size_t                  cbScratchBuf;
     165#ifdef VBOX_WITH_STATISTICS
     166    /** Statistics for the statistics manager (STAM). */
     167    DRVAUDIOSTATS           Stats;
     168#endif
     169    struct
     170    {
     171        /** Whether this driver's input streams are enabled or not.
     172         *  This flag overrides all the attached stream statuses. */
     173        bool                fEnabled;
     174        /** Max. number of free input streams.
     175         *  UINT32_MAX for unlimited streams. */
     176        uint32_t            cStreamsFree;
     177#ifdef VBOX_WITH_AUDIO_CALLBACKS
     178        RTLISTANCHOR        lstCB;
     179#endif
     180        /** The driver's input confguration (tweakable via CFGM). */
     181        DRVAUDIOCFG         Cfg;
     182    } In;
     183    struct
     184    {
     185        /** Whether this driver's output streams are enabled or not.
     186         *  This flag overrides all the attached stream statuses. */
     187        bool                fEnabled;
     188        /** Max. number of free output streams.
     189         *  UINT32_MAX for unlimited streams. */
     190        uint32_t            cStreamsFree;
     191#ifdef VBOX_WITH_AUDIO_CALLBACKS
     192        RTLISTANCHOR        lstCB;
     193#endif
     194        /** The driver's output confguration (tweakable via CFGM). */
     195        DRVAUDIOCFG         Cfg;
     196    } Out;
     197} DRVAUDIO, *PDRVAUDIO;
     198
     199/** Makes a PDRVAUDIO out of a PPDMIAUDIOCONNECTOR. */
     200#define PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface) \
     201    ( (PDRVAUDIO)((uintptr_t)pInterface - RT_UOFFSETOF(DRVAUDIO, IAudioConnector)) )
    48202
    49203
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r88047 r88230  
    4343#include <stdlib.h>
    4444
    45 #include "DrvAudio.h"
     45#include "DrvAudioCommon.h"
    4646#include "AudioMixBuffer.h"
    4747
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.h

    r88229 r88230  
    1616 */
    1717
    18 #ifndef VBOX_INCLUDED_SRC_Audio_DrvAudio_h
    19 #define VBOX_INCLUDED_SRC_Audio_DrvAudio_h
     18#ifndef VBOX_INCLUDED_SRC_Audio_DrvAudioCommon_h
     19#define VBOX_INCLUDED_SRC_Audio_DrvAudioCommon_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    3232#include <VBox/vmm/pdm.h>
    3333#include <VBox/vmm/pdmaudioifs.h>
    34 
    35 typedef enum
    36 {
    37     AUD_OPT_INT,
    38     AUD_OPT_FMT,
    39     AUD_OPT_STR,
    40     AUD_OPT_BOOL
    41 } audio_option_tag_e;
    42 
    43 typedef struct audio_option
    44 {
    45     const char *name;
    46     audio_option_tag_e tag;
    47     void *valp;
    48     const char *descr;
    49     int *overridenp;
    50     int overriden;
    51 } audio_option;
    52 
    53 #ifdef VBOX_WITH_STATISTICS
    54 /**
    55  * Structure for keeping stream statistics for the
    56  * statistic manager (STAM).
    57  */
    58 typedef struct DRVAUDIOSTATS
    59 {
    60     STAMCOUNTER TotalStreamsActive;
    61     STAMCOUNTER TotalStreamsCreated;
    62     STAMCOUNTER TotalFramesRead;
    63     STAMCOUNTER TotalFramesWritten;
    64     STAMCOUNTER TotalFramesMixedIn;
    65     STAMCOUNTER TotalFramesMixedOut;
    66     STAMCOUNTER TotalFramesLostIn;
    67     STAMCOUNTER TotalFramesLostOut;
    68     STAMCOUNTER TotalFramesOut;
    69     STAMCOUNTER TotalFramesIn;
    70     STAMCOUNTER TotalBytesRead;
    71     STAMCOUNTER TotalBytesWritten;
    72     /** How much delay (in ms) for input processing. */
    73     STAMPROFILEADV DelayIn;
    74     /** How much delay (in ms) for output processing. */
    75     STAMPROFILEADV DelayOut;
    76 } DRVAUDIOSTATS, *PDRVAUDIOSTATS;
    77 #endif
    78 
    79 /**
    80  * Audio driver configuration data, tweakable via CFGM.
    81  */
    82 typedef struct DRVAUDIOCFG
    83 {
    84     /** PCM properties to use. */
    85     PDMAUDIOPCMPROPS     Props;
    86     /** Whether using signed sample data or not.
    87      *  Needed in order to know whether there is a custom value set in CFGM or not.
    88      *  By default set to UINT8_MAX if not set to a custom value. */
    89     uint8_t              uSigned;
    90     /** Whether swapping endianess of sample data or not.
    91      *  Needed in order to know whether there is a custom value set in CFGM or not.
    92      *  By default set to UINT8_MAX if not set to a custom value. */
    93     uint8_t              uSwapEndian;
    94     /** Configures the period size (in ms).
    95      *  This value reflects the time in between each hardware interrupt on the
    96      *  backend (host) side. */
    97     uint32_t             uPeriodSizeMs;
    98     /** Configures the (ring) buffer size (in ms). Often is a multiple of uPeriodMs. */
    99     uint32_t             uBufferSizeMs;
    100     /** Configures the pre-buffering size (in ms).
    101      *  Time needed in buffer before the stream becomes active (pre buffering).
    102      *  The bigger this value is, the more latency for the stream will occur.
    103      *  Set to 0 to disable pre-buffering completely.
    104      *  By default set to UINT32_MAX if not set to a custom value. */
    105     uint32_t             uPreBufSizeMs;
    106     /** The driver's debugging configuration. */
    107     struct
    108     {
    109         /** Whether audio debugging is enabled or not. */
    110         bool             fEnabled;
    111         /** Where to store the debugging files. */
    112         char             szPathOut[RTPATH_MAX];
    113     } Dbg;
    114 } DRVAUDIOCFG, *PDRVAUDIOCFG;
    115 
    116 /**
    117  * Audio driver instance data.
    118  *
    119  * @implements PDMIAUDIOCONNECTOR
    120  */
    121 typedef struct DRVAUDIO
    122 {
    123     /** Friendly name of the driver. */
    124     char                    szName[64];
    125     /** Critical section for serializing access. */
    126     RTCRITSECT              CritSect;
    127     /** Shutdown indicator. */
    128     bool                    fTerminate;
    129     /** Our audio connector interface. */
    130     PDMIAUDIOCONNECTOR      IAudioConnector;
    131     /** Pointer to the driver instance. */
    132     PPDMDRVINS              pDrvIns;
    133     /** Pointer to audio driver below us. */
    134     PPDMIHOSTAUDIO          pHostDrvAudio;
    135     /** List of audio streams. */
    136     RTLISTANCHOR            lstStreams;
    137 #ifdef VBOX_WITH_AUDIO_ENUM
    138     /** Flag indicating to perform an (re-)enumeration of the host audio devices. */
    139     bool                    fEnumerateDevices;
    140 #endif
    141     /** Audio configuration settings retrieved from the backend. */
    142     PDMAUDIOBACKENDCFG      BackendCfg;
    143     /** Commonly used scratch buffer. */
    144     void                   *pvScratchBuf;
    145     /** Size (in bytes) of commonly used scratch buffer. */
    146     size_t                  cbScratchBuf;
    147 #ifdef VBOX_WITH_STATISTICS
    148     /** Statistics for the statistics manager (STAM). */
    149     DRVAUDIOSTATS           Stats;
    150 #endif
    151     struct
    152     {
    153         /** Whether this driver's input streams are enabled or not.
    154          *  This flag overrides all the attached stream statuses. */
    155         bool                fEnabled;
    156         /** Max. number of free input streams.
    157          *  UINT32_MAX for unlimited streams. */
    158         uint32_t            cStreamsFree;
    159 #ifdef VBOX_WITH_AUDIO_CALLBACKS
    160         RTLISTANCHOR        lstCB;
    161 #endif
    162         /** The driver's input confguration (tweakable via CFGM). */
    163         DRVAUDIOCFG         Cfg;
    164     } In;
    165     struct
    166     {
    167         /** Whether this driver's output streams are enabled or not.
    168          *  This flag overrides all the attached stream statuses. */
    169         bool                fEnabled;
    170         /** Max. number of free output streams.
    171          *  UINT32_MAX for unlimited streams. */
    172         uint32_t            cStreamsFree;
    173 #ifdef VBOX_WITH_AUDIO_CALLBACKS
    174         RTLISTANCHOR        lstCB;
    175 #endif
    176         /** The driver's output confguration (tweakable via CFGM). */
    177         DRVAUDIOCFG         Cfg;
    178     } Out;
    179 } DRVAUDIO, *PDRVAUDIO;
    180 
    181 /** Makes a PDRVAUDIO out of a PPDMIAUDIOCONNECTOR. */
    182 #define PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface) \
    183     ( (PDRVAUDIO)((uintptr_t)pInterface - RT_UOFFSETOF(DRVAUDIO, IAudioConnector)) )
    18434
    18535/** @name Audio calculation helper methods.
     
    22474#define AUDIO_MAKE_FOURCC(c0, c1, c2, c3) RT_H2LE_U32_C(RT_MAKE_U32_FROM_U8(c0, c1, c2, c3))
    22575
    226 #endif /* !VBOX_INCLUDED_SRC_Audio_DrvAudio_h */
     76#endif /* !VBOX_INCLUDED_SRC_Audio_DrvAudioCommon_h */
    22777
  • trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp

    r88226 r88230  
    6060#include <alsa/control.h> /* For device enumeration. */
    6161
    62 #include "DrvAudio.h"
    6362#include "VBoxDD.h"
    6463
  • trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp

    r88226 r88230  
    2525#include <VBox/vmm/pdmaudiohostenuminline.h>
    2626
    27 #include "DrvAudio.h"
    2827#include "VBoxDD.h"
    2928
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp

    r88226 r88230  
    3333#include <VBox/vmm/pdmaudiohostenuminline.h>
    3434
    35 #include "DrvAudio.h"
    3635#include "VBoxDD.h"
    3736#ifdef VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp

    r88226 r88230  
    2929#include <VBox/vmm/pdmaudioinline.h>
    3030
    31 #include "DrvAudio.h"
     31#include "DrvAudioCommon.h"
    3232#include "VBoxDD.h"
    3333
  • trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp

    r88226 r88230  
    5555#include <VBox/vmm/pdmaudioinline.h>
    5656
    57 #include "DrvAudio.h"
    5857#include "VBoxDD.h"
    5958
  • trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp

    r88226 r88230  
    3131#include <VBox/vmm/pdmaudioinline.h>
    3232
    33 #include "DrvAudio.h"
    3433#include "VBoxDD.h"
    3534
  • trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp

    r88226 r88230  
    3737#include <pulse/pulseaudio.h>
    3838
    39 #include "DrvAudio.h"
    4039#include "VBoxDD.h"
    4140
  • trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp

    r88226 r88230  
    2525#include <VBox/vmm/pdmaudioinline.h>
    2626
    27 #include "DrvAudio.h"
     27#include "DrvAudioCommon.h"
    2828#include "VBoxDD.h"
    2929
  • trunk/src/VBox/Devices/Audio/VBoxMMNotificationClient.h

    r83239 r88230  
    3737#include <Mmdeviceapi.h>
    3838
    39 #include "DrvAudio.h"
    4039
    4140class VBoxMMNotificationClient : IMMNotificationClient
  • trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp

    r88112 r88230  
    3131
    3232#include "../AudioMixBuffer.h"
    33 #include "../DrvAudio.h"
     33#include "../DrvAudioCommon.h"
    3434
    3535
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette