VirtualBox

Changeset 65012 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 27, 2016 10:58:38 AM (8 years ago)
Author:
vboxsync
Message:

Audio: Implemented DrvAudioHlpStreamCmdToStr(), logging.

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

Legend:

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

    r65011 r65012  
    334334        return rc;
    335335
    336     LogFlowFunc(("[%s] enmStreamCmd=%RU32\n", pStream->szName, enmStreamCmd));
     336    LogFlowFunc(("[%s] enmStreamCmd=%s\n", pStream->szName, DrvAudioHlpStreamCmdToStr(enmStreamCmd)));
    337337
    338338    rc = drvAudioStreamControlInternal(pThis, pStream, enmStreamCmd);
     
    358358    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
    359359
    360     LogFunc(("[%s] enmStreamCmd=%RU32\n", pStream->szName, enmStreamCmd));
     360    LogFunc(("[%s] enmStreamCmd=%s\n", pStream->szName, DrvAudioHlpStreamCmdToStr(enmStreamCmd)));
    361361
    362362    PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream);
     
    451451
    452452        default:
    453             AssertMsgFailed(("Command %RU32 not implemented\n", enmStreamCmd));
     453            AssertMsgFailed(("Command %s (%RU32) not implemented\n", DrvAudioHlpStreamCmdToStr(enmStreamCmd), enmStreamCmd));
    454454            rc = VERR_NOT_IMPLEMENTED;
    455455            break;
     
    482482#ifdef LOG_ENABLED
    483483    char *pszHstSts = dbgAudioStreamStatusToStr(pHstStream->fStatus);
    484     LogFlowFunc(("[%s] enmStreamCmd=%RU32, fStatus=%s\n", pHstStream->szName, enmStreamCmd, pszHstSts));
     484    LogFlowFunc(("[%s] enmStreamCmd=%s, fStatus=%s\n", pHstStream->szName, DrvAudioHlpStreamCmdToStr(enmStreamCmd), pszHstSts));
    485485    RTStrFree(pszHstSts);
    486486#endif /* LOG_ENABLED */
     
    17281728    PDRVAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO);
    17291729
    1730     LogFlowFunc(("enmCmd=%RU32\n", enmCmd));
     1730    LogFlowFunc(("enmCmd=%s\n", DrvAudioHlpStreamCmdToStr(enmCmd)));
    17311731
    17321732    if (!pThis->pHostDrvAudio)
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r64990 r65012  
    161161bool DrvAudioHlpStreamCfgIsValid(PPDMAUDIOSTREAMCFG pCfg);
    162162int DrvAudioHlpStreamCfgToProps(PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOPCMPROPS pProps);
     163const char *DrvAudioHlpStreamCmdToStr(PDMAUDIOSTREAMCMD enmCmd);
    163164PDMAUDIOFMT DrvAudioHlpStrToAudFmt(const char *pszFmt);
    164165
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r65011 r65012  
    992992            break;
    993993    }
     994}
     995
     996/**
     997 * Converts a stream command to a string.
     998 *
     999 * @returns Stringified stream command, or "Unknown", if not found.
     1000 * @param   enmCmd              Stream command to convert.
     1001 */
     1002const char *DrvAudioHlpStreamCmdToStr(PDMAUDIOSTREAMCMD enmCmd)
     1003{
     1004    switch (enmCmd)
     1005    {
     1006        case PDMAUDIOSTREAMCMD_UNKNOWN: return "Unknown";
     1007        case PDMAUDIOSTREAMCMD_ENABLE:  return "Enable";
     1008        case PDMAUDIOSTREAMCMD_DISABLE: return "Disable";
     1009        case PDMAUDIOSTREAMCMD_PAUSE:   return "Pause";
     1010        case PDMAUDIOSTREAMCMD_RESUME:  return "Resume";
     1011        default:                        break;
     1012    }
     1013
     1014    AssertMsgFailed(("Invalid stream command %ld\n", enmCmd));
     1015    return "Unknown";
    9941016}
    9951017
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