VirtualBox

Changeset 65738 in vbox for trunk/src


Ignore:
Timestamp:
Feb 10, 2017 4:11:40 PM (8 years ago)
Author:
vboxsync
Message:

DrvAudio: Added DrvAudioHlpPCMPropsPrint().

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r65675 r65738  
    159159bool DrvAudioHlpPCMPropsAreEqual(const PPDMAUDIOPCMPROPS pPCMProps, const PPDMAUDIOSTREAMCFG pCfg);
    160160bool DrvAudioHlpPCMPropsAreValid(const PPDMAUDIOPCMPROPS pProps);
     161void DrvAudioHlpPCMPropsPrint(const PPDMAUDIOPCMPROPS pProps);
    161162int DrvAudioHlpPCMPropsToStreamCfg(const PPDMAUDIOPCMPROPS pPCMProps, PPDMAUDIOSTREAMCFG pCfg);
    162163const char *DrvAudioHlpRecSrcToStr(const PDMAUDIORECSOURCE enmRecSource);
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r65675 r65738  
    841841
    842842/**
     843 * Prints PCM properties to the debug log.
     844 *
     845 * @param   pProps              Stream configuration to log.
     846 */
     847void DrvAudioHlpPCMPropsPrint(const PPDMAUDIOPCMPROPS pProps)
     848{
     849    AssertPtrReturnVoid(pProps);
     850
     851    Log(("uHz=%RU32, cChannels=%RU8, cBits=%RU8%s",
     852         pProps->uHz, pProps->cChannels, pProps->cBits, pProps->fSigned ? "S" : "U"));
     853}
     854
     855/**
    843856 * Converts PCM properties to a audio stream configuration.
    844857 *
    845858 * @return  IPRT status code.
    846  * @param   pPCMProps           Pointer to PCM properties to convert.
     859 * @param   pProps              Pointer to PCM properties to convert.
    847860 * @param   pCfg                Pointer to audio stream configuration to store result into.
    848861 */
    849 int DrvAudioHlpPCMPropsToStreamCfg(const PPDMAUDIOPCMPROPS pPCMProps, PPDMAUDIOSTREAMCFG pCfg)
    850 {
    851     AssertPtrReturn(pPCMProps, VERR_INVALID_POINTER);
    852     AssertPtrReturn(pCfg,      VERR_INVALID_POINTER);
    853 
    854     memcpy(&pCfg->Props, pPCMProps, sizeof(PDMAUDIOPCMPROPS));
     862int DrvAudioHlpPCMPropsToStreamCfg(const PPDMAUDIOPCMPROPS pProps, PPDMAUDIOSTREAMCFG pCfg)
     863{
     864    AssertPtrReturn(pProps, VERR_INVALID_POINTER);
     865    AssertPtrReturn(pCfg,   VERR_INVALID_POINTER);
     866
     867    memcpy(&pCfg->Props, pProps, sizeof(PDMAUDIOPCMPROPS));
    855868    return VINF_SUCCESS;
    856869}
Note: See TracChangeset for help on using the changeset viewer.

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