Changeset 68488 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Aug 21, 2017 2:13:51 PM (7 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r68486 r68488 1952 1952 { 1953 1953 case PDMAUDIODEVICECBTYPE_DATA_INPUT: 1954 RTListAppend(&pThis-> lstCBIn, &pCB->Node);1954 RTListAppend(&pThis->In.lstCB, &pCB->Node); 1955 1955 break; 1956 1956 1957 1957 case PDMAUDIODEVICECBTYPE_DATA_OUTPUT: 1958 RTListAppend(&pThis-> lstCBOut, &pCB->Node);1958 RTListAppend(&pThis->Out.lstCB, &pCB->Node); 1959 1959 break; 1960 1960 … … 2215 2215 } 2216 2216 2217 pThis-> cStreamsFreeIn= pThis->BackendCfg.cMaxStreamsIn;2218 pThis-> cStreamsFreeOut= pThis->BackendCfg.cMaxStreamsOut;2219 2220 LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis-> cStreamsFreeIn, pThis->cStreamsFreeOut));2217 pThis->In.cStreamsFree = pThis->BackendCfg.cMaxStreamsIn; 2218 pThis->Out.cStreamsFree = pThis->BackendCfg.cMaxStreamsOut; 2219 2220 LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis->In.cStreamsFree, pThis->Out.cStreamsFree)); 2221 2221 2222 2222 LogRel2(("Audio: Host audio backend supports %RU32 input streams and %RU32 output streams at once\n", 2223 2223 /* Clamp for logging. Unlimited streams are defined by UINT32_MAX. */ 2224 RT_MIN(64, pThis-> cStreamsFreeIn), RT_MIN(64, pThis->cStreamsFreeOut)));2224 RT_MIN(64, pThis->In.cStreamsFree), RT_MIN(64, pThis->Out.cStreamsFree))); 2225 2225 2226 2226 #ifdef VBOX_WITH_AUDIO_ENUM … … 2490 2490 if (pCfgHost->enmDir == PDMAUDIODIR_IN) 2491 2491 { 2492 if (!pThis-> cStreamsFreeIn)2492 if (!pThis->In.cStreamsFree) 2493 2493 LogFunc(("Warning: No more input streams free to use\n")); 2494 2494 … … 2497 2497 else /* Out */ 2498 2498 { 2499 if (!pThis-> cStreamsFreeOut)2499 if (!pThis->Out.cStreamsFree) 2500 2500 { 2501 2501 LogFlowFunc(("Maximum number of host output streams reached\n")); … … 2639 2639 if (pCfgHost->enmDir == PDMAUDIODIR_IN) 2640 2640 { 2641 if (pThis-> cStreamsFreeIn)2642 pThis-> cStreamsFreeIn--;2641 if (pThis->In.cStreamsFree) 2642 pThis->In.cStreamsFree--; 2643 2643 } 2644 2644 else /* Out */ 2645 2645 { 2646 if (pThis-> cStreamsFreeOut)2647 pThis-> cStreamsFreeOut--;2646 if (pThis->Out.cStreamsFree) 2647 pThis->Out.cStreamsFree--; 2648 2648 } 2649 2649 … … 3029 3029 if (enmDir == PDMAUDIODIR_IN) 3030 3030 { 3031 pThis-> cStreamsFreeIn++;3031 pThis->In.cStreamsFree++; 3032 3032 } 3033 3033 else /* Out */ 3034 3034 { 3035 pThis-> cStreamsFreeOut++;3035 pThis->Out.cStreamsFree++; 3036 3036 } 3037 3037 } … … 3271 3271 RTListInit(&pThis->lstGstStreams); 3272 3272 #ifdef VBOX_WITH_AUDIO_CALLBACKS 3273 RTListInit(&pThis-> lstCBIn);3274 RTListInit(&pThis-> lstCBOut);3273 RTListInit(&pThis->In.lstCB); 3274 RTListInit(&pThis->Out.lstCB); 3275 3275 #endif 3276 3276 … … 3436 3436 */ 3437 3437 PPDMAUDIOCBRECORD pCB, pCBNext; 3438 RTListForEachSafe(&pThis-> lstCBIn, pCB, pCBNext, PDMAUDIOCBRECORD, Node)3438 RTListForEachSafe(&pThis->In.lstCB, pCB, pCBNext, PDMAUDIOCBRECORD, Node) 3439 3439 drvAudioCallbackDestroy(pCB); 3440 3440 3441 RTListForEachSafe(&pThis-> lstCBOut, pCB, pCBNext, PDMAUDIOCBRECORD, Node)3441 RTListForEachSafe(&pThis->Out.lstCB, pCB, pCBNext, PDMAUDIOCBRECORD, Node) 3442 3442 drvAudioCallbackDestroy(pCB); 3443 3443 #endif -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r68485 r68488 109 109 /** List of guest input/output audio streams. */ 110 110 RTLISTANCHOR lstGstStreams; 111 /** Max. number of free input streams.112 * UINT32_MAX for unlimited streams. */113 uint32_t cStreamsFreeIn;114 /** Max. number of free output streams.115 * UINT32_MAX for unlimited streams. */116 uint32_t cStreamsFreeOut;117 111 #ifdef VBOX_WITH_AUDIO_ENUM 118 112 /** Flag indicating to perform an (re-)enumeration of the host audio devices. */ … … 121 115 /** Audio configuration settings retrieved from the backend. */ 122 116 PDMAUDIOBACKENDCFG BackendCfg; 123 #ifdef VBOX_WITH_AUDIO_CALLBACKS124 /** @todo Use a map with primary key set to the callback type? */125 RTLISTANCHOR lstCBIn;126 RTLISTANCHOR lstCBOut;127 #endif128 117 #ifdef VBOX_WITH_STATISTICS 129 118 /** Statistics for the statistics manager (STAM). */ … … 135 124 * This flag overrides all the attached stream statuses. */ 136 125 bool fEnabled; 126 /** Max. number of free input streams. 127 * UINT32_MAX for unlimited streams. */ 128 uint32_t cStreamsFree; 129 #ifdef VBOX_WITH_AUDIO_CALLBACKS 130 RTLISTANCHOR lstCB; 131 #endif 137 132 } In; 138 133 struct … … 141 136 * This flag overrides all the attached stream statuses. */ 142 137 bool fEnabled; 138 /** Max. number of free output streams. 139 * UINT32_MAX for unlimited streams. */ 140 uint32_t cStreamsFree; 141 #ifdef VBOX_WITH_AUDIO_CALLBACKS 142 RTLISTANCHOR lstCB; 143 #endif 143 144 } Out; 144 145 } DRVAUDIO, *PDRVAUDIO;
Note:
See TracChangeset
for help on using the changeset viewer.