Changeset 88023 in vbox for trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
- Timestamp:
- Mar 8, 2021 6:01:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r88022 r88023 621 621 * @param enmFmt Audio format to retrieve value for. 622 622 */ 623 bool DrvAudioHlpAudFmtIsSigned(PDMAUDIOFMT enmFmt)623 bool PDMAudioFormatIsSigned(PDMAUDIOFMT enmFmt) 624 624 { 625 625 switch (enmFmt) … … 650 650 * @param enmFmt Audio format to retrieve value for. 651 651 */ 652 uint8_t DrvAudioHlpAudFmtToBits(PDMAUDIOFMT enmFmt)652 uint8_t PDMAudioFormatGetBits(PDMAUDIOFMT enmFmt) 653 653 { 654 654 switch (enmFmt) … … 742 742 * @param pCfg Stream configuration to initialize. 743 743 */ 744 void DrvAudioHlpStreamCfgInit(PPDMAUDIOSTREAMCFG pCfg)744 void PDMAudioStrmCfgInit(PPDMAUDIOSTREAMCFG pCfg) 745 745 { 746 746 AssertPtrReturnVoid(pCfg); … … 758 758 * @param pProps PCM properties to use. 759 759 */ 760 int DrvAudioHlpStreamCfgInitFromPcmProps(PPDMAUDIOSTREAMCFG pCfg, PCPDMAUDIOPCMPROPS pProps)760 int PDMAudioStrmCfgInitWithProps(PPDMAUDIOSTREAMCFG pCfg, PCPDMAUDIOPCMPROPS pProps) 761 761 { 762 762 AssertPtrReturn(pProps, VERR_INVALID_POINTER); 763 763 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 764 764 765 DrvAudioHlpStreamCfgInit(pCfg);765 PDMAudioStrmCfgInit(pCfg); 766 766 767 767 memcpy(&pCfg->Props, pProps, sizeof(PDMAUDIOPCMPROPS)); … … 798 798 * @param pProps PCM properties to match with. 799 799 */ 800 bool DrvAudioHlpStreamCfgMatchesPcmProps(PCPDMAUDIOSTREAMCFG pCfg, PCPDMAUDIOPCMPROPS pProps)800 bool PDMAudioStrmCfgMatchesProps(PCPDMAUDIOSTREAMCFG pCfg, PCPDMAUDIOPCMPROPS pProps) 801 801 { 802 802 AssertPtrReturn(pCfg, false); … … 809 809 * @param pCfg Audio stream configuration to free. 810 810 */ 811 void DrvAudioHlpStreamCfgFree(PPDMAUDIOSTREAMCFG pCfg)811 void PDMAudioStrmCfgFree(PPDMAUDIOSTREAMCFG pCfg) 812 812 { 813 813 if (pCfg) … … 825 825 * @param pSrcCfg Source stream configuration to copy to destination. 826 826 */ 827 int DrvAudioHlpStreamCfgCopy(PPDMAUDIOSTREAMCFG pDstCfg, PCPDMAUDIOSTREAMCFG pSrcCfg)827 int PDMAudioStrmCfgCopy(PPDMAUDIOSTREAMCFG pDstCfg, PCPDMAUDIOSTREAMCFG pSrcCfg) 828 828 { 829 829 AssertPtrReturn(pDstCfg, VERR_INVALID_POINTER); … … 845 845 /** 846 846 * Duplicates an audio stream configuration. 847 * Must be free'd with DrvAudioHlpStreamCfgFree().847 * Must be free'd with PDMAudioStrmCfgFree(). 848 848 * 849 849 * @return Duplicates audio stream configuration on success, or NULL on failure. 850 850 * @param pCfg Audio stream configuration to duplicate. 851 851 */ 852 PPDMAUDIOSTREAMCFG DrvAudioHlpStreamCfgDup(PCPDMAUDIOSTREAMCFG pCfg)852 PPDMAUDIOSTREAMCFG PDMAudioStrmCfgDup(PCPDMAUDIOSTREAMCFG pCfg) 853 853 { 854 854 AssertPtrReturn(pCfg, NULL); … … 866 866 return NULL; 867 867 868 int rc2 = DrvAudioHlpStreamCfgCopy(pDst, pCfg);868 int rc2 = PDMAudioStrmCfgCopy(pDst, pCfg); 869 869 if (RT_FAILURE(rc2)) 870 870 { 871 DrvAudioHlpStreamCfgFree(pDst);871 PDMAudioStrmCfgFree(pDst); 872 872 pDst = NULL; 873 873 } … … 882 882 * @param pCfg Stream configuration to log. 883 883 */ 884 void DrvAudioHlpStreamCfgPrint(PCPDMAUDIOSTREAMCFG pCfg) 885 { 886 if (!pCfg) 887 return; 888 889 LogFunc(("szName=%s, enmDir=%RU32 (uHz=%RU32, cBits=%RU8%s, cChannels=%RU8)\n", 890 pCfg->szName, pCfg->enmDir, 891 pCfg->Props.uHz, pCfg->Props.cbSample * 8, pCfg->Props.fSigned ? "S" : "U", pCfg->Props.cChannels)); 884 void PDMAudioStrmCfgLog(PCPDMAUDIOSTREAMCFG pCfg) 885 { 886 if (pCfg) 887 LogFunc(("szName=%s enmDir=%RU32 uHz=%RU32 cBits=%RU8%s cChannels=%RU8\n", pCfg->szName, pCfg->enmDir, 888 pCfg->Props.uHz, pCfg->Props.cbSample * 8, pCfg->Props.fSigned ? "S" : "U", pCfg->Props.cChannels)); 892 889 } 893 890 … … 999 996 uint32_t PDMAudioPropsGetBitrate(PCPDMAUDIOPCMPROPS pProps) 1000 997 { 1001 return DrvAudioHlpCalcBitrate(pProps->cbSample * 8, pProps->uHz, pProps->cChannels);998 return pProps->cbSample * pProps->cChannels * pProps->uHz * 8; 1002 999 } 1003 1000
Note:
See TracChangeset
for help on using the changeset viewer.