- Timestamp:
- Jan 16, 2019 4:22:17 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128200
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r76553 r76841 193 193 /** Number of active (running) SDn streams. */ 194 194 uint8_t cStreamsActive; 195 #ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS196 195 /** The timer for pumping data thru the attached LUN drivers. */ 197 196 PTMTIMERR3 pTimerIO; … … 204 203 * Used to calculate the time actually elapsed between two timer callbacks. */ 205 204 uint64_t uTimerTSIO; 206 #endif207 205 PTMTIMER pTimerIRQ; 208 206 /** The base interface for LUN\#0. */ … … 223 221 static int sb16OpenOut(PSB16STATE pThis, PPDMAUDIOSTREAMCFG pCfg); 224 222 static void sb16CloseOut(PSB16STATE pThis); 225 #ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS226 223 static void sb16TimerMaybeStart(PSB16STATE pThis); 227 224 static void sb16TimerMaybeStop(PSB16STATE pThis); 228 #endif229 225 230 226 … … 313 309 if (hold) 314 310 { 315 #ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS316 311 pThis->cStreamsActive++; 317 312 sb16TimerMaybeStart(pThis); 318 #else319 # error "Implement me!"320 #endif321 313 PDMDevHlpDMASchedule(pThis->pDevInsR3); 322 314 } 323 #ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS324 315 else 325 316 { … … 328 319 sb16TimerMaybeStop(pThis); 329 320 } 330 #else331 # error "Implement me!"332 #endif333 321 } 334 322 … … 1648 1636 } 1649 1637 1650 #ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS1651 1652 1638 static void sb16TimerMaybeStart(PSB16STATE pThis) 1653 1639 { … … 1757 1743 } 1758 1744 } 1759 1760 #endif /* !VBOX_WITH_AUDIO_SB16_CALLBACKS */1761 1762 1745 1763 1746 /** … … 2483 2466 pThis->verCfg = u16Version; 2484 2467 2485 #ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS2486 2468 uint16_t uTimerHz; 2487 2469 rc = CFGMR3QueryU16Def(pCfg, "TimerHz", &uTimerHz, 100 /* Hz */); … … 2489 2471 return PDMDEV_SET_ERROR(pDevIns, rc, 2490 2472 N_("SB16 configuration error: failed to read Hertz (Hz) rate as unsigned integer")); 2491 #endif2492 2493 2473 /* 2494 2474 * Setup the mixer now that we've got the irq and dma channel numbers. … … 2591 2571 #endif 2592 2572 2593 #ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS2594 2573 if (RT_SUCCESS(rc)) 2595 2574 { … … 2605 2584 AssertMsgFailedReturn(("Error creating I/O timer, rc=%Rrc\n", rc), rc); 2606 2585 } 2607 #else /* !VBOX_WITH_AUDIO_SB16_CALLBACKS */2608 if (RT_SUCCESS(rc))2609 {2610 /** @todo Merge this callback registration with the validation block above once2611 * this becomes the standard. */2612 PSB16DRIVER pDrv;2613 RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)2614 {2615 /* Only register primary driver.2616 * The device emulation does the output multiplexing then. */2617 if (pDrv->fFlags != PDMAUDIODRVFLAGS_PRIMARY)2618 continue;2619 2620 PDMAUDIOCBRECORD AudioCallbacks[2];2621 2622 SB16CALLBACKCTX Ctx = { pThis, pDrv };2623 2624 AudioCallbacks[0].enmType = PDMAUDIOCALLBACKTYPE_INPUT;2625 AudioCallbacks[0].pfnCallback = sb16CallbackInput;2626 AudioCallbacks[0].pvCtx = &Ctx;2627 AudioCallbacks[0].cbCtx = sizeof(SB16CALLBACKCTX);2628 2629 AudioCallbacks[1].enmType = PDMAUDIOCALLBACKTYPE_OUTPUT;2630 AudioCallbacks[1].pfnCallback = sb16CallbackOutput;2631 AudioCallbacks[1].pvCtx = &Ctx;2632 AudioCallbacks[1].cbCtx = sizeof(SB16CALLBACKCTX);2633 2634 rc = pDrv->pConnector->pfnRegisterCallbacks(pDrv->pConnector, AudioCallbacks, RT_ELEMENTS(AudioCallbacks));2635 if (RT_FAILURE(rc))2636 break;2637 }2638 }2639 #endif /* VBOX_WITH_AUDIO_SB16_CALLBACKS */2640 2586 2641 2587 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
Note:
See TracChangeset
for help on using the changeset viewer.