Changeset 89415 in vbox for trunk/src/VBox
- Timestamp:
- May 31, 2021 8:31:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r89379 r89415 84 84 /** Pointer to the instance data for an VRDE audio driver. */ 85 85 typedef DRVAUDIOVRDE *PDRVAUDIOVRDE; 86 87 /* Sanity. */88 AssertCompileSize(PDMAUDIOFRAME, sizeof(int64_t) * 2 /* st_sample_t using by VRDP server */);89 90 86 91 87 … … 588 584 /** @todo Find some sane value here. We probably need a VRDE API VRDE to specify this. */ 589 585 if (pDrv->cClients) 590 return _16K * sizeof( PDMAUDIOFRAME);586 return _16K * sizeof(int64_t) * 2; 591 587 return 0; 592 588 } … … 631 627 Assert(uVrdpFormat == VRDE_AUDIO_FMT_MAKE(PDMAudioPropsHz(pProps), 2, 64, true)); 632 628 633 /* We specified PDMAUDIOSTREAMLAYOUT_RAW (== S64), so634 convert the buffer pointe and size accordingly: */635 PCPDMAUDIOFRAME paSampleBuf = (PCPDMAUDIOFRAME)pvBuf;636 uint32_t const cFramesToWrite = cbBuf / sizeof(paSampleBuf[0]);637 Assert(cFramesToWrite * sizeof(paSampleBuf[0]) == cbBuf);638 639 629 /** @todo r=bird: there was some incoherent mumbling about "using the 640 630 * internal counter to track if we (still) can write to the VRDP … … 643 633 * sensible, so I've removed it. */ 644 634 645 /* 646 * Call the VRDP server with the data. 647 */ 648 uint32_t cFramesWritten = 0; 649 while (cFramesWritten < cFramesToWrite) 650 { 651 uint32_t const cFramesChunk = cFramesToWrite - cFramesWritten; /** @todo For now write all at once. */ 652 653 /* Note: The VRDP server expects int64_t samples per channel, regardless 654 of the actual sample bits (e.g 8 or 16 bits). */ 655 pDrv->pConsoleVRDPServer->SendAudioSamples(&paSampleBuf[cFramesWritten], cFramesChunk /* Frames */, uVrdpFormat); 656 657 cFramesWritten += cFramesChunk; 658 } 659 660 Log3Func(("cFramesWritten=%RU32\n", cFramesWritten)); 661 *pcbWritten = cFramesWritten * sizeof(PDMAUDIOFRAME); 635 uint32_t cFrames = PDMAudioPropsBytesToFrames(&pStream->pStream->Props, cbBuf); 636 Assert(cFrames == cbBuf / (sizeof(uint64_t) * 2)); 637 pDrv->pConsoleVRDPServer->SendAudioSamples(pvBuf, cFrames, uVrdpFormat); 638 639 Log3Func(("cFramesWritten=%RU32\n", cFrames)); 640 *pcbWritten = PDMAudioPropsFramesToBytes(&pStream->pStream->Props, cFrames); 641 Assert(*pcbWritten == cbBuf); 662 642 return VINF_SUCCESS; 663 643 }
Note:
See TracChangeset
for help on using the changeset viewer.