- Timestamp:
- Apr 26, 2021 9:21:24 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144036
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r88717 r88718 1418 1418 return rc; 1419 1419 } 1420 AssertLogRelReturn(pStreamEx->pBackend->uMagic == PDMAUDIOBACKENDSTREAM_MAGIC, VERR_INTERNAL_ERROR_3); 1421 AssertLogRelReturn(pStreamEx->pBackend->pStream == &pStreamEx->Core, VERR_INTERNAL_ERROR_3); 1420 1422 1421 1423 /* Validate acquired configuration. */ … … 1769 1771 } 1770 1772 size_t const cbHstStrm = pThis->BackendCfg.cbStream; 1773 AssertStmt(cbHstStrm >= sizeof(PDMAUDIOBACKENDSTREAM), rc = VERR_OUT_OF_RANGE); 1771 1774 AssertStmt(cbHstStrm < _16M, rc = VERR_OUT_OF_RANGE); 1772 1775 if (RT_SUCCESS(rc)) … … 1783 1786 pThis->BackendCfg.szName, pCfgHost->szName[0] != '\0' ? pCfgHost->szName : "<Untitled>"); 1784 1787 1785 pStreamEx->Core.enmDir = pCfgHost->enmDir; 1786 pStreamEx->Core.cbBackend = (uint32_t)cbHstStrm; 1787 if (cbHstStrm) 1788 pStreamEx->pBackend = (PPDMAUDIOBACKENDSTREAM)(pStreamEx + 1); 1789 pStreamEx->fNoMixBufs = RT_BOOL(fFlags & PDMAUDIOSTREAM_CREATE_F_NO_MIXBUF); 1790 pStreamEx->uMagic = DRVAUDIOSTREAM_MAGIC; 1788 PPDMAUDIOBACKENDSTREAM pBackend = (PPDMAUDIOBACKENDSTREAM)(pStreamEx + 1); 1789 pBackend->uMagic = PDMAUDIOBACKENDSTREAM_MAGIC; 1790 pBackend->pStream = &pStreamEx->Core; 1791 pStreamEx->pBackend = pBackend; 1792 pStreamEx->Core.enmDir = pCfgHost->enmDir; 1793 pStreamEx->Core.cbBackend = (uint32_t)cbHstStrm; 1794 pStreamEx->fNoMixBufs = RT_BOOL(fFlags & PDMAUDIOSTREAM_CREATE_F_NO_MIXBUF); 1795 pStreamEx->uMagic = DRVAUDIOSTREAM_MAGIC; 1791 1796 1792 1797 /* … … 1988 1993 Assert(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC); 1989 1994 Assert(pStreamEx->uMagic == DRVAUDIOSTREAM_MAGIC); 1995 Assert(pStreamEx->pBackend && pStreamEx->pBackend->uMagic == PDMAUDIOBACKENDSTREAM_MAGIC); 1990 1996 1991 1997 int rc = RTCritSectEnter(&pThis->CritSect); -
trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp
r88672 r88718 109 109 typedef struct ALSAAUDIOSTREAM 110 110 { 111 /** Common part. */ 112 PDMAUDIOBACKENDSTREAM Core; 113 111 114 /** Handle to the ALSA PCM stream. */ 112 snd_pcm_t *hPCM;115 snd_pcm_t *hPCM; 113 116 /** Internal stream offset (for debugging). */ 114 uint64_t offInternal;117 uint64_t offInternal; 115 118 116 119 /** The stream's acquired configuration. */ 117 PDMAUDIOSTREAMCFG Cfg;120 PDMAUDIOSTREAMCFG Cfg; 118 121 /** The acquired ALSA stream config (same as Cfg). */ 119 ALSAAUDIOSTREAMCFG AlsaCfg;122 ALSAAUDIOSTREAMCFG AlsaCfg; 120 123 } ALSAAUDIOSTREAM; 121 124 /** Pointer to the ALSA host audio specific stream data. */ -
trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
r88534 r88718 374 374 typedef struct COREAUDIOSTREAM 375 375 { 376 /** Common part. */ 377 PDMAUDIOBACKENDSTREAM Core; 378 376 379 /** The stream's acquired configuration. */ 377 380 PPDMAUDIOSTREAMCFG pCfg; -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
r88691 r88718 108 108 typedef struct DSOUNDSTREAM 109 109 { 110 /** Common part. */ 111 PDMAUDIOBACKENDSTREAM Core; 110 112 /** Entry in DRVHOSTDSOUND::HeadStreams. */ 111 RTLISTNODE ListEntry;113 RTLISTNODE ListEntry; 112 114 /** The stream's acquired configuration. */ 113 PDMAUDIOSTREAMCFG Cfg;115 PDMAUDIOSTREAMCFG Cfg; 114 116 /** Buffer alignment. */ 115 uint8_t uAlign;117 uint8_t uAlign; 116 118 /** Whether this stream is in an enable state on the DirectSound side. */ 117 bool fEnabled;118 bool afPadding[2];119 bool fEnabled; 120 bool afPadding[2]; 119 121 /** Size (in bytes) of the DirectSound buffer. */ 120 DWORD cbBufSize;122 DWORD cbBufSize; 121 123 union 122 124 { … … 163 165 /** Timestamp (in ms) of the last transfer from the internal buffer to/from the 164 166 * DirectSound buffer. */ 165 uint64_t msLastTransfer;167 uint64_t msLastTransfer; 166 168 /** The stream's critical section for synchronizing access. */ 167 RTCRITSECT CritSect;169 RTCRITSECT CritSect; 168 170 /** Used for formatting the current DSound status. */ 169 char szStatus[127];171 char szStatus[127]; 170 172 /** Fixed zero terminator. */ 171 char const chStateZero;173 char const chStateZero; 172 174 } DSOUNDSTREAM, *PDSOUNDSTREAM; 173 175 -
trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp
r88534 r88718 43 43 typedef struct DEBUGAUDIOSTREAM 44 44 { 45 /** Common part. */ 46 PDMAUDIOBACKENDSTREAM Core; 45 47 /** The stream's acquired configuration. */ 46 PDMAUDIOSTREAMCFG Cfg;48 PDMAUDIOSTREAMCFG Cfg; 47 49 /** Audio file to dump output to or read input from. */ 48 PAUDIOHLPFILE pFile;50 PAUDIOHLPFILE pFile; 49 51 union 50 52 { … … 52 54 { 53 55 /** Current sample index for generate the sine wave. */ 54 uint64_t uSample;56 uint64_t uSample; 55 57 /** The fixed portion of the sin() input. */ 56 double rdFixed;58 double rdFixed; 57 59 /** Timestamp of last captured samples. */ 58 uint64_t tsLastCaptured;60 uint64_t tsLastCaptured; 59 61 /** Frequency (in Hz) of the sine wave to generate. */ 60 double rdFreqHz;62 double rdFreqHz; 61 63 } In; 62 64 }; -
trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp
r88693 r88718 38 38 typedef struct NULLAUDIOSTREAM 39 39 { 40 /** Common part. */ 41 PDMAUDIOBACKENDSTREAM Core; 40 42 /** The stream's acquired configuration. */ 41 PDMAUDIOSTREAMCFG Cfg;43 PDMAUDIOSTREAMCFG Cfg; 42 44 } NULLAUDIOSTREAM; 43 45 /** Pointer to a null audio stream. */ -
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r88534 r88718 87 87 typedef struct OSSAUDIOSTREAM 88 88 { 89 /** Common part. */ 90 PDMAUDIOBACKENDSTREAM Core; 89 91 /** The file descriptor. */ 90 int hFile;92 int hFile; 91 93 /** Buffer alignment. */ 92 uint8_t uAlign;94 uint8_t uAlign; 93 95 /** Set if we're draining the stream (output only). */ 94 bool fDraining;96 bool fDraining; 95 97 /** Internal stream byte offset. */ 96 uint64_t offInternal;98 uint64_t offInternal; 97 99 /** The stream's acquired configuration. */ 98 PDMAUDIOSTREAMCFG Cfg;100 PDMAUDIOSTREAMCFG Cfg; 99 101 /** The acquired OSS configuration. */ 100 OSSAUDIOSTREAMCFG OssCfg;102 OSSAUDIOSTREAMCFG OssCfg; 101 103 /** Handle to the thread draining output streams. */ 102 RTTHREAD hThreadDrain; 103 104 RTTHREAD hThreadDrain; 104 105 } OSSAUDIOSTREAM; 105 106 /** Pointer to an OSS audio stream. */ -
trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp
r88672 r88718 133 133 typedef struct PULSEAUDIOSTREAM 134 134 { 135 /** Common part. */ 136 PDMAUDIOBACKENDSTREAM Core; 135 137 /** The stream's acquired configuration. */ 136 PDMAUDIOSTREAMCFG Cfg;138 PDMAUDIOSTREAMCFG Cfg; 137 139 /** Pointer to driver instance. */ 138 PDRVHOSTPULSEAUDIO pDrv;140 PDRVHOSTPULSEAUDIO pDrv; 139 141 /** Pointer to opaque PulseAudio stream. */ 140 pa_stream *pStream;142 pa_stream *pStream; 141 143 /** Pulse sample format and attribute specification. */ 142 pa_sample_spec SampleSpec;144 pa_sample_spec SampleSpec; 143 145 /** Pulse playback and buffer metrics. */ 144 pa_buffer_attr BufAttr;146 pa_buffer_attr BufAttr; 145 147 /** Input: Pointer to Pulse sample peek buffer. */ 146 const uint8_t *pbPeekBuf;148 const uint8_t *pbPeekBuf; 147 149 /** Input: Current size (in bytes) of peeked data in buffer. */ 148 size_t cbPeekBuf;150 size_t cbPeekBuf; 149 151 /** Input: Our offset (in bytes) in peek data buffer. */ 150 size_t offPeekBuf;152 size_t offPeekBuf; 151 153 /** Output: Asynchronous drain operation. This is used as an indicator of 152 154 * whether we're currently draining the stream (will be cleaned up before 153 155 * resume/re-enable). */ 154 pa_operation *pDrainOp;156 pa_operation *pDrainOp; 155 157 /** Asynchronous cork/uncork operation. 156 158 * (This solely for cancelling before destroying the stream, so the callback 157 159 * won't do any after-freed accesses.) */ 158 pa_operation *pCorkOp;160 pa_operation *pCorkOp; 159 161 /** Asynchronous trigger operation. 160 162 * (This solely for cancelling before destroying the stream, so the callback 161 163 * won't do any after-freed accesses.) */ 162 pa_operation *pTriggerOp;164 pa_operation *pTriggerOp; 163 165 /** Output: Current latency (in microsecs). */ 164 uint64_t cUsLatency;166 uint64_t cUsLatency; 165 167 #ifdef LOG_ENABLED 166 168 /** Creation timestamp (in microsecs) of stream playback / recording. */ 167 pa_usec_t tsStartUs;169 pa_usec_t tsStartUs; 168 170 /** Timestamp (in microsecs) when last read from / written to the stream. */ 169 pa_usec_t tsLastReadWrittenUs;171 pa_usec_t tsLastReadWrittenUs; 170 172 #endif 171 173 #ifdef DEBUG 172 174 /** Number of occurred audio data underflows. */ 173 uint32_t cUnderflows;175 uint32_t cUnderflows; 174 176 #endif 175 177 } PULSEAUDIOSTREAM; -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r88534 r88718 43 43 typedef struct VAKITAUDIOSTREAM 44 44 { 45 /** Common part. */ 46 PDMAUDIOBACKENDSTREAM Core; 45 47 /** The stream's acquired configuration. */ 46 PDMAUDIOSTREAMCFG Cfg;48 PDMAUDIOSTREAMCFG Cfg; 47 49 /** Audio file to dump output to or read input from. */ 48 PAUDIOHLPFILE pFile;50 PAUDIOHLPFILE pFile; 49 51 /** Text file to store timing of audio buffers submittions. */ 50 PRTSTREAM pFileTiming;52 PRTSTREAM pFileTiming; 51 53 /** Timestamp of the first play or record request. */ 52 uint64_t tsStarted;54 uint64_t tsStarted; 53 55 /** Total number of frames played or recorded so far. */ 54 uint32_t cFramesSinceStarted;56 uint32_t cFramesSinceStarted; 55 57 union 56 58 { … … 58 60 { 59 61 /** Timestamp of last captured samples. */ 60 uint64_t tsLastCaptured;62 uint64_t tsLastCaptured; 61 63 } In; 62 64 struct 63 65 { 64 66 /** Timestamp of last played samples. */ 65 uint64_t tsLastPlayed;66 uint8_t *pbPlayBuffer;67 uint32_t cbPlayBuffer;67 uint64_t tsLastPlayed; 68 uint8_t *pbPlayBuffer; 69 uint32_t cbPlayBuffer; 68 70 } Out; 69 71 }; -
trunk/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
r88706 r88718 138 138 typedef struct DRVHOSTAUDIOWASSTREAM 139 139 { 140 /** Common part. */ 141 PDMAUDIOBACKENDSTREAM Core; 142 140 143 /** Entry in DRVHOSTAUDIOWAS::StreamHead. */ 141 144 RTLISTNODE ListEntry; -
trunk/src/VBox/Main/src-client/DrvAudioRec.cpp
r88534 r88718 246 246 typedef struct AVRECSTREAM 247 247 { 248 /** Common part. */ 249 PDMAUDIOBACKENDSTREAM Core; 248 250 /** The stream's acquired configuration. */ 249 PDMAUDIOSTREAMCFG Cfg;251 PDMAUDIOSTREAMCFG Cfg; 250 252 /** (Audio) frame buffer. */ 251 PRTCIRCBUF pCircBuf;253 PRTCIRCBUF pCircBuf; 252 254 /** Pointer to sink to use for writing. */ 253 PAVRECSINK pSink;255 PAVRECSINK pSink; 254 256 /** Last encoded PTS (in ms). */ 255 uint64_t uLastPTSMs;257 uint64_t uLastPTSMs; 256 258 /** Temporary buffer for the input (source) data to encode. */ 257 void *pvSrcBuf;259 void *pvSrcBuf; 258 260 /** Size (in bytes) of the temporary buffer holding the input (source) data to encode. */ 259 size_t cbSrcBuf;261 size_t cbSrcBuf; 260 262 /** Temporary buffer for the encoded output (destination) data. */ 261 void *pvDstBuf;263 void *pvDstBuf; 262 264 /** Size (in bytes) of the temporary buffer holding the encoded output (destination) data. */ 263 size_t cbDstBuf;265 size_t cbDstBuf; 264 266 } AVRECSTREAM, *PAVRECSTREAM; 265 267 -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r88534 r88718 48 48 typedef struct VRDESTREAM 49 49 { 50 /** Common part. */ 51 PDMAUDIOBACKENDSTREAM Core; 50 52 /** The stream's acquired configuration. */ 51 PDMAUDIOSTREAMCFG Cfg;53 PDMAUDIOSTREAMCFG Cfg; 52 54 union 53 55 { … … 55 57 { 56 58 /** Circular buffer for holding the recorded audio frames from the host. */ 57 PRTCIRCBUF pCircBuf;59 PRTCIRCBUF pCircBuf; 58 60 } In; 59 61 };
Note:
See TracChangeset
for help on using the changeset viewer.