Changeset 90136 in vbox
- Timestamp:
- Jul 9, 2021 8:40:27 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHda.cpp
r90135 r90136 2589 2589 } 2590 2590 2591 /** 2592 * @interface_method_impl{HDACODECR3,pfnCbMixerAddStream} 2593 */ 2594 static DECLCALLBACK(int) hdaR3MixerAddStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PCPDMAUDIOSTREAMCFG pCfg) 2591 2592 /** 2593 * Adds a new audio stream to a specific mixer control. 2594 * 2595 * Depending on the mixer control the stream then gets assigned to one of the 2596 * internal mixer sinks, which in turn then handle the mixing of all connected 2597 * streams to that sink. 2598 * 2599 * @return VBox status code. 2600 * @param pDevIns The device instance. 2601 * @param enmMixerCtl Mixer control to assign new stream to. 2602 * @param pCfg Stream configuration for the new stream. 2603 */ 2604 DECLHIDDEN(int) hdaR3MixerAddStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PCPDMAUDIOSTREAMCFG pCfg) 2595 2605 { 2596 2606 PHDASTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PHDASTATER3); … … 2614 2624 2615 2625 /** 2616 * @interface_method_impl{HDACODECR3,pfnCbMixerRemoveStream} 2617 */ 2618 static DECLCALLBACK(int) hdaR3MixerRemoveStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate) 2626 * Removes a specified mixer control from the HDA's mixer. 2627 * 2628 * @return VBox status code. 2629 * @param pDevIns The device instance. 2630 * @param enmMixerCtl Mixer control to remove. 2631 * @param fImmediate Whether the backend should be allowed to 2632 * finished draining (@c false) or if it must be 2633 * destroyed immediately (@c true). 2634 */ 2635 DECLHIDDEN(int) hdaR3MixerRemoveStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate) 2619 2636 { 2620 2637 PHDASTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PHDASTATER3); … … 2685 2702 2686 2703 /** 2687 * @interface_method_impl{HDACODECR3,pfnCbMixerControl} 2704 * Controls an input / output converter widget, that is, which converter is 2705 * connected to which stream (and channel). 2706 * 2707 * @return VBox status code. 2708 * @param pDevIns The device instance. 2709 * @param enmMixerCtl Mixer control to set SD stream number and channel for. 2710 * @param uSD SD stream number (number + 1) to set. Set to 0 for unassign. 2711 * @param uChannel Channel to set. Only valid if a valid SD stream number is specified. 2688 2712 * 2689 2713 * @note Is also called directly by the DevHDA code. 2690 2714 */ 2691 static DECLCALLBACK(int) hdaR3MixerControl(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel)2715 DECLHIDDEN(int) hdaR3MixerControl(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel) 2692 2716 { 2693 2717 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); … … 2793 2817 2794 2818 /** 2795 * @interface_method_impl{HDACODECR3,pfnCbMixerSetVolume} 2796 */ 2797 static DECLCALLBACK(int) hdaR3MixerSetVolume(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol) 2819 * Sets the volume of a specified mixer control. 2820 * 2821 * @return IPRT status code. 2822 * @param pDevIns The device instance. 2823 * @param enmMixerCtl Mixer control to set volume for. 2824 * @param pVol Pointer to volume data to set. 2825 */ 2826 DECLHIDDEN(int) hdaR3MixerSetVolume(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol) 2798 2827 { 2799 2828 PHDASTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PHDASTATER3); … … 4956 4985 * Initialize the codec. 4957 4986 */ 4958 4959 /* Set codec callbacks to this controller. */ 4960 pThisCC->Codec.pDevIns = pDevIns; 4961 pThisCC->Codec.pfnCbMixerAddStream = hdaR3MixerAddStream; 4962 pThisCC->Codec.pfnCbMixerRemoveStream = hdaR3MixerRemoveStream; 4963 pThisCC->Codec.pfnCbMixerControl = hdaR3MixerControl; 4964 pThisCC->Codec.pfnCbMixerSetVolume = hdaR3MixerSetVolume; 4987 pThisCC->Codec.pDevIns = pDevIns; 4965 4988 4966 4989 /* Construct the common + R3 codec part. */ -
trunk/src/VBox/Devices/Audio/DevHda.h
r90134 r90136 806 806 807 807 808 /** @name DevHDA.cpp functions used by the codec. 809 * @{ */ 810 DECLHIDDEN(int) hdaR3MixerAddStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PCPDMAUDIOSTREAMCFG pCfg); 811 DECLHIDDEN(int) hdaR3MixerRemoveStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate); 812 DECLHIDDEN(int) hdaR3MixerControl(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel); 813 DECLHIDDEN(int) hdaR3MixerSetVolume(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol); 814 /** @} */ 815 816 808 817 /** @name Saved state versions for the HDA device 809 818 * @{ */ -
trunk/src/VBox/Devices/Audio/DevHdaCodec.cpp
r90135 r90136 940 940 PDMAudioMixerCtlGetName(enmMixerCtl), bLeft, bRight, Vol.fMuted ? "- Muted!" : "")); 941 941 942 return pThisCC->pfnCbMixerSetVolume(pThisCC->pDevIns, enmMixerCtl, &Vol);942 return hdaR3MixerSetVolume(pThisCC->pDevIns, enmMixerCtl, &Vol); 943 943 } 944 944 … … 2204 2204 2205 2205 /* Propagate to the controller. */ 2206 pThisCC->pfnCbMixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_FRONT, uSD, uChannel);2206 hdaR3MixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_FRONT, uSD, uChannel); 2207 2207 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 2208 pThisCC->pfnCbMixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_CENTER_LFE, uSD, uChannel);2209 pThisCC->pfnCbMixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_REAR, uSD, uChannel);2208 hdaR3MixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_CENTER_LFE, uSD, uChannel); 2209 hdaR3MixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_REAR, uSD, uChannel); 2210 2210 # endif 2211 2211 } 2212 2212 else if (enmDir == PDMAUDIODIR_IN) 2213 2213 { 2214 pThisCC->pfnCbMixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_LINE_IN, uSD, uChannel);2214 hdaR3MixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_LINE_IN, uSD, uChannel); 2215 2215 # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN 2216 pThisCC->pfnCbMixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_MIC_IN, uSD, uChannel);2216 hdaR3MixerControl(pThisCC->pDevIns, PDMAUDIOMIXERCTL_MIC_IN, uSD, uChannel); 2217 2217 # endif 2218 2218 } … … 2666 2666 2667 2667 if (RT_SUCCESS(rc)) 2668 rc = pThisCC->pfnCbMixerAddStream(pThisCC->pDevIns, enmMixerCtl, pCfg);2668 rc = hdaR3MixerAddStream(pThisCC->pDevIns, enmMixerCtl, pCfg); 2669 2669 2670 2670 LogFlowFuncLeaveRC(rc); … … 2677 2677 AssertPtrReturn(pThisCC, VERR_INVALID_POINTER); 2678 2678 2679 int rc = pThisCC->pfnCbMixerRemoveStream(pThisCC->pDevIns, enmMixerCtl, fImmediate);2679 int rc = hdaR3MixerRemoveStream(pThisCC->pDevIns, enmMixerCtl, fImmediate); 2680 2680 2681 2681 LogFlowFuncLeaveRC(rc); -
trunk/src/VBox/Devices/Audio/DevHdaCodec.h
r90135 r90136 851 851 PPDMDEVINS pDevIns; 852 852 853 /** @name Callbacks to the HDA controller, mostly used for multiplexing to the854 * various host backends.855 * @{ */856 /**857 *858 * Adds a new audio stream to a specific mixer control.859 *860 * Depending on the mixer control the stream then gets assigned to one of the861 * internal mixer sinks, which in turn then handle the mixing of all connected862 * streams to that sink.863 *864 * @return VBox status code.865 * @param pDevIns The device instance.866 * @param enmMixerCtl Mixer control to assign new stream to.867 * @param pCfg Stream configuration for the new stream.868 */869 DECLR3CALLBACKMEMBER(int, pfnCbMixerAddStream, (PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PCPDMAUDIOSTREAMCFG pCfg));870 /**871 * Removes a specified mixer control from the HDA's mixer.872 *873 * @return VBox status code.874 * @param pDevIns The device instance.875 * @param enmMixerCtl Mixer control to remove.876 * @param fImmediate Whether the backend should be allowed to877 * finished draining (@c false) or if it must be878 * destroyed immediately (@c true).879 */880 DECLR3CALLBACKMEMBER(int, pfnCbMixerRemoveStream, (PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate));881 /**882 * Controls an input / output converter widget, that is, which converter is883 * connected to which stream (and channel).884 *885 * @return VBox status code.886 * @param pDevIns The device instance.887 * @param enmMixerCtl Mixer control to set SD stream number and channel for.888 * @param uSD SD stream number (number + 1) to set. Set to 0 for unassign.889 * @param uChannel Channel to set. Only valid if a valid SD stream number is specified.890 */891 DECLR3CALLBACKMEMBER(int, pfnCbMixerControl, (PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel));892 /**893 * Sets the volume of a specified mixer control.894 *895 * @return IPRT status code.896 * @param pDevIns The device instance.897 * @param enmMixerCtl Mixer control to set volume for.898 * @param pVol Pointer to volume data to set.899 */900 DECLR3CALLBACKMEMBER(int, pfnCbMixerSetVolume, (PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol));901 /** @} */902 903 853 /** The state (was shared with ring-0 for a while). */ 904 854 HDACODEC State;
Note:
See TracChangeset
for help on using the changeset viewer.