Loading services/audiopolicy/Android.mk +5 −7 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ LOCAL_C_INCLUDES := \ $(call include-path-for, audio-utils) \ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \ $(TOPDIR)frameworks/av/services/audiopolicy/utilities \ $(TOPDIR)frameworks/av/services/audiopolicy/utilities LOCAL_SHARED_LIBRARIES := \ libcutils \ Loading Loading @@ -56,8 +56,7 @@ ifneq ($(USE_LEGACY_AUDIO_POLICY), 1) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ managerdefault/AudioPolicyManager.cpp \ LOCAL_SRC_FILES:= managerdefault/AudioPolicyManager.cpp LOCAL_SHARED_LIBRARIES := \ libcutils \ Loading @@ -75,8 +74,7 @@ LOCAL_REQUIRED_MODULES := \ parameter-framework.policy \ audio_policy_criteria.conf \ LOCAL_C_INCLUDES += \ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include LOCAL_C_INCLUDES += $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include LOCAL_SHARED_LIBRARIES += libaudiopolicyengineconfigurable Loading @@ -84,7 +82,7 @@ else LOCAL_SHARED_LIBRARIES += libaudiopolicyenginedefault endif endif # ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1) LOCAL_C_INCLUDES += \ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \ Loading Loading @@ -122,7 +120,7 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_C_INCLUDES += \ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface LOCAL_MODULE:= libaudiopolicymanager Loading services/audiopolicy/common/managerdefinitions/Android.mk +9 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ src/DeviceDescriptor.cpp \ src/AudioGain.cpp \ src/StreamDescriptor.cpp \ src/HwModule.cpp \ src/IOProfile.cpp \ src/AudioPort.cpp \ Loading @@ -20,6 +19,7 @@ LOCAL_SRC_FILES:= \ src/SoundTriggerSession.cpp \ src/SessionRoute.cpp \ src/AudioSourceDescriptor.cpp \ src/VolumeCurve.cpp \ src/TypeConverter.cpp \ src/AudioSession.cpp Loading @@ -35,9 +35,10 @@ LOCAL_C_INCLUDES := \ $(TOPDIR)frameworks/av/services/audiopolicy/utilities \ ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1) LOCAL_SRC_FILES += src/Serializer.cpp LOCAL_STATIC_LIBRARIES := libxml2 LOCAL_STATIC_LIBRARIES += libxml2 LOCAL_SHARED_LIBRARIES += libicuuc Loading @@ -46,7 +47,12 @@ LOCAL_C_INCLUDES += \ $(TOPDIR)external/icu/icu4c/source/common else LOCAL_SRC_FILES += src/ConfigParsingUtils.cpp LOCAL_SRC_FILES += \ src/ConfigParsingUtils.cpp \ src/StreamDescriptor.cpp \ src/Gains.cpp endif #ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1) LOCAL_EXPORT_C_INCLUDE_DIRS := \ Loading services/audiopolicy/common/managerdefinitions/include/AudioPolicyConfig.h +12 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ #include <AudioPolicyMix.h> #include <EffectDescriptor.h> #include <SoundTriggerSession.h> #include <StreamDescriptor.h> #include <SessionRoute.h> namespace android { Loading @@ -40,14 +39,24 @@ public: DeviceVector &availableOutputDevices, DeviceVector &availableInputDevices, sp<DeviceDescriptor> &defaultOutputDevices, bool &isSpeakerDrcEnabled) bool &isSpeakerDrcEnabled, VolumeCurvesCollection *volumes = nullptr) : mHwModules(hwModules), mAvailableOutputDevices(availableOutputDevices), mAvailableInputDevices(availableInputDevices), mDefaultOutputDevices(defaultOutputDevices), mVolumeCurves(volumes), mIsSpeakerDrcEnabled(isSpeakerDrcEnabled) {} void setVolumes(const VolumeCurvesCollection &volumes) { if (mVolumeCurves != nullptr) { *mVolumeCurves = volumes; mVolumeCurves->setDefaultCurves(); } } void setHwModules(const HwModuleCollection &hwModules) { mHwModules = hwModules; Loading Loading @@ -131,6 +140,7 @@ private: DeviceVector &mAvailableOutputDevices; DeviceVector &mAvailableInputDevices; sp<DeviceDescriptor> &mDefaultOutputDevices; VolumeCurvesCollection *mVolumeCurves; bool &mIsSpeakerDrcEnabled; }; Loading services/audiopolicy/enginedefault/src/Gains.h→services/audiopolicy/common/managerdefinitions/include/Gains.h +1 −6 Original line number Diff line number Diff line Loading @@ -29,12 +29,7 @@ class StreamDescriptor; class Gains { public : static float volIndexToAmpl(device_category deviceCategory, const StreamDescriptor& streamDesc, int indexInUi); static float volIndexToDb(device_category deviceCategory, const StreamDescriptor& streamDesc, static float volIndexToDb(const VolumeCurvePoint *point, int indexMin, int indexMax, int indexInUi); // default volume curve Loading services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.h→services/audiopolicy/common/managerdefinitions/include/IVolumeCurvesCollection.h100755 → 100644 +52 −0 Original line number Diff line number Diff line Loading @@ -16,49 +16,37 @@ #pragma once #include "FormattedSubsystemObject.h" #include "InstanceConfigurableElement.h" #include "MappingContext.h" #include <system/audio.h> #include <Volume.h> #include <AudioPolicyPluginInterface.h> #include <string> #include <utils/Errors.h> class PolicySubsystem; namespace android { class VolumeProfile : public CFormattedSubsystemObject class IVolumeCurvesCollection { private: struct Point public: virtual void clearCurrentVolumeIndex(audio_stream_type_t stream) = 0; virtual void addCurrentVolumeIndex(audio_stream_type_t stream, audio_devices_t device, int index) = 0; virtual bool canBeMuted(audio_stream_type_t stream) = 0; virtual int getVolumeIndexMin(audio_stream_type_t stream) const = 0; virtual int getVolumeIndex(audio_stream_type_t stream, audio_devices_t device) = 0; virtual int getVolumeIndexMax(audio_stream_type_t stream) const = 0; virtual float volIndexToDb(audio_stream_type_t stream, device_category device, int indexInUi) const = 0; virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax) = 0; virtual void initializeVolumeCurves(bool /*isSpeakerDrcEnabled*/) {} virtual void switchVolumeCurve(audio_stream_type_t src, audio_stream_type_t dst) = 0; virtual void restoreOriginVolumeCurve(audio_stream_type_t stream) { int index; /** Volume is using FixedPointParameter until float parameters are available. */ int16_t dbAttenuation; } __attribute__((packed)); switchVolumeCurve(stream, stream); } public: VolumeProfile(const std::string &mappingValue, CInstanceConfigurableElement *instanceConfigurableElement, const CMappingContext &context); virtual status_t dump(int fd) const = 0; protected: virtual bool receiveFromHW(std::string &error); virtual bool sendToHW(std::string &error); private: const PolicySubsystem *mPolicySubsystem; /**< Route subsytem plugin. */ /** * Interface to communicate with Audio Policy Engine. */ android::AudioPolicyPluginInterface *mPolicyPluginInterface; /** * volume profile identifier, which is in fact a stream type to link with audio.h. */ audio_stream_type_t mId; size_t mPoints; device_category mCategory; static const uint32_t gFractional = 8; /**< Beware to align with the structure. */ virtual ~IVolumeCurvesCollection() {} }; }; // namespace android Loading
services/audiopolicy/Android.mk +5 −7 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ LOCAL_C_INCLUDES := \ $(call include-path-for, audio-utils) \ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \ $(TOPDIR)frameworks/av/services/audiopolicy/utilities \ $(TOPDIR)frameworks/av/services/audiopolicy/utilities LOCAL_SHARED_LIBRARIES := \ libcutils \ Loading Loading @@ -56,8 +56,7 @@ ifneq ($(USE_LEGACY_AUDIO_POLICY), 1) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ managerdefault/AudioPolicyManager.cpp \ LOCAL_SRC_FILES:= managerdefault/AudioPolicyManager.cpp LOCAL_SHARED_LIBRARIES := \ libcutils \ Loading @@ -75,8 +74,7 @@ LOCAL_REQUIRED_MODULES := \ parameter-framework.policy \ audio_policy_criteria.conf \ LOCAL_C_INCLUDES += \ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include LOCAL_C_INCLUDES += $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include LOCAL_SHARED_LIBRARIES += libaudiopolicyengineconfigurable Loading @@ -84,7 +82,7 @@ else LOCAL_SHARED_LIBRARIES += libaudiopolicyenginedefault endif endif # ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1) LOCAL_C_INCLUDES += \ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \ Loading Loading @@ -122,7 +120,7 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_C_INCLUDES += \ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface LOCAL_MODULE:= libaudiopolicymanager Loading
services/audiopolicy/common/managerdefinitions/Android.mk +9 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ src/DeviceDescriptor.cpp \ src/AudioGain.cpp \ src/StreamDescriptor.cpp \ src/HwModule.cpp \ src/IOProfile.cpp \ src/AudioPort.cpp \ Loading @@ -20,6 +19,7 @@ LOCAL_SRC_FILES:= \ src/SoundTriggerSession.cpp \ src/SessionRoute.cpp \ src/AudioSourceDescriptor.cpp \ src/VolumeCurve.cpp \ src/TypeConverter.cpp \ src/AudioSession.cpp Loading @@ -35,9 +35,10 @@ LOCAL_C_INCLUDES := \ $(TOPDIR)frameworks/av/services/audiopolicy/utilities \ ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1) LOCAL_SRC_FILES += src/Serializer.cpp LOCAL_STATIC_LIBRARIES := libxml2 LOCAL_STATIC_LIBRARIES += libxml2 LOCAL_SHARED_LIBRARIES += libicuuc Loading @@ -46,7 +47,12 @@ LOCAL_C_INCLUDES += \ $(TOPDIR)external/icu/icu4c/source/common else LOCAL_SRC_FILES += src/ConfigParsingUtils.cpp LOCAL_SRC_FILES += \ src/ConfigParsingUtils.cpp \ src/StreamDescriptor.cpp \ src/Gains.cpp endif #ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1) LOCAL_EXPORT_C_INCLUDE_DIRS := \ Loading
services/audiopolicy/common/managerdefinitions/include/AudioPolicyConfig.h +12 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ #include <AudioPolicyMix.h> #include <EffectDescriptor.h> #include <SoundTriggerSession.h> #include <StreamDescriptor.h> #include <SessionRoute.h> namespace android { Loading @@ -40,14 +39,24 @@ public: DeviceVector &availableOutputDevices, DeviceVector &availableInputDevices, sp<DeviceDescriptor> &defaultOutputDevices, bool &isSpeakerDrcEnabled) bool &isSpeakerDrcEnabled, VolumeCurvesCollection *volumes = nullptr) : mHwModules(hwModules), mAvailableOutputDevices(availableOutputDevices), mAvailableInputDevices(availableInputDevices), mDefaultOutputDevices(defaultOutputDevices), mVolumeCurves(volumes), mIsSpeakerDrcEnabled(isSpeakerDrcEnabled) {} void setVolumes(const VolumeCurvesCollection &volumes) { if (mVolumeCurves != nullptr) { *mVolumeCurves = volumes; mVolumeCurves->setDefaultCurves(); } } void setHwModules(const HwModuleCollection &hwModules) { mHwModules = hwModules; Loading Loading @@ -131,6 +140,7 @@ private: DeviceVector &mAvailableOutputDevices; DeviceVector &mAvailableInputDevices; sp<DeviceDescriptor> &mDefaultOutputDevices; VolumeCurvesCollection *mVolumeCurves; bool &mIsSpeakerDrcEnabled; }; Loading
services/audiopolicy/enginedefault/src/Gains.h→services/audiopolicy/common/managerdefinitions/include/Gains.h +1 −6 Original line number Diff line number Diff line Loading @@ -29,12 +29,7 @@ class StreamDescriptor; class Gains { public : static float volIndexToAmpl(device_category deviceCategory, const StreamDescriptor& streamDesc, int indexInUi); static float volIndexToDb(device_category deviceCategory, const StreamDescriptor& streamDesc, static float volIndexToDb(const VolumeCurvePoint *point, int indexMin, int indexMax, int indexInUi); // default volume curve Loading
services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.h→services/audiopolicy/common/managerdefinitions/include/IVolumeCurvesCollection.h100755 → 100644 +52 −0 Original line number Diff line number Diff line Loading @@ -16,49 +16,37 @@ #pragma once #include "FormattedSubsystemObject.h" #include "InstanceConfigurableElement.h" #include "MappingContext.h" #include <system/audio.h> #include <Volume.h> #include <AudioPolicyPluginInterface.h> #include <string> #include <utils/Errors.h> class PolicySubsystem; namespace android { class VolumeProfile : public CFormattedSubsystemObject class IVolumeCurvesCollection { private: struct Point public: virtual void clearCurrentVolumeIndex(audio_stream_type_t stream) = 0; virtual void addCurrentVolumeIndex(audio_stream_type_t stream, audio_devices_t device, int index) = 0; virtual bool canBeMuted(audio_stream_type_t stream) = 0; virtual int getVolumeIndexMin(audio_stream_type_t stream) const = 0; virtual int getVolumeIndex(audio_stream_type_t stream, audio_devices_t device) = 0; virtual int getVolumeIndexMax(audio_stream_type_t stream) const = 0; virtual float volIndexToDb(audio_stream_type_t stream, device_category device, int indexInUi) const = 0; virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax) = 0; virtual void initializeVolumeCurves(bool /*isSpeakerDrcEnabled*/) {} virtual void switchVolumeCurve(audio_stream_type_t src, audio_stream_type_t dst) = 0; virtual void restoreOriginVolumeCurve(audio_stream_type_t stream) { int index; /** Volume is using FixedPointParameter until float parameters are available. */ int16_t dbAttenuation; } __attribute__((packed)); switchVolumeCurve(stream, stream); } public: VolumeProfile(const std::string &mappingValue, CInstanceConfigurableElement *instanceConfigurableElement, const CMappingContext &context); virtual status_t dump(int fd) const = 0; protected: virtual bool receiveFromHW(std::string &error); virtual bool sendToHW(std::string &error); private: const PolicySubsystem *mPolicySubsystem; /**< Route subsytem plugin. */ /** * Interface to communicate with Audio Policy Engine. */ android::AudioPolicyPluginInterface *mPolicyPluginInterface; /** * volume profile identifier, which is in fact a stream type to link with audio.h. */ audio_stream_type_t mId; size_t mPoints; device_category mCategory; static const uint32_t gFractional = 8; /**< Beware to align with the structure. */ virtual ~IVolumeCurvesCollection() {} }; }; // namespace android