Loading media/libaudioclient/AudioAttributes.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ status_t AudioAttributes::readFromParcel(const Parcel *parcel) strcpy(mAttributes.tags, ""); } mStreamType = static_cast<audio_stream_type_t>(parcel->readInt32()); mGroupId = parcel->readUint32(); mGroupId = static_cast<volume_group_t>(parcel->readUint32()); return NO_ERROR; } Loading @@ -60,7 +60,7 @@ status_t AudioAttributes::writeToParcel(Parcel *parcel) const parcel->writeUtf8AsUtf16(mAttributes.tags); } parcel->writeInt32(static_cast<int32_t>(mStreamType)); parcel->writeUint32(mGroupId); parcel->writeUint32(static_cast<uint32_t>(mGroupId)); return NO_ERROR; } Loading media/libaudioclient/include/media/AudioAttributes.h +4 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #pragma once #include <media/AudioCommonTypes.h> #include <system/audio.h> #include <system/audio_policy.h> #include <binder/Parcelable.h> Loading @@ -28,7 +29,7 @@ class AudioAttributes : public Parcelable public: AudioAttributes() = default; AudioAttributes(const audio_attributes_t &attributes) : mAttributes(attributes) {} AudioAttributes(uint32_t groupId, AudioAttributes(volume_group_t groupId, audio_stream_type_t stream, const audio_attributes_t &attributes) : mAttributes(attributes), mStreamType(stream), mGroupId(groupId) {} Loading @@ -39,7 +40,7 @@ public: status_t writeToParcel(Parcel *parcel) const override; audio_stream_type_t getStreamType() const { return mStreamType; } uint32_t getGroupId() const { return mGroupId; } volume_group_t getGroupId() const { return mGroupId; } private: audio_attributes_t mAttributes = AUDIO_ATTRIBUTES_INITIALIZER; Loading @@ -53,7 +54,7 @@ private: * @brief mGroupId: for future volume management, define groups within a strategy that follows * the same curves of volume (extension of stream types to manage volume) */ uint32_t mGroupId = 0; volume_group_t mGroupId = VOLUME_GROUP_NONE; }; } // namespace android media/libaudioclient/include/media/AudioCommonTypes.h +5 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ enum product_strategy_t : uint32_t; const product_strategy_t PRODUCT_STRATEGY_NONE = static_cast<product_strategy_t>(-1); using AttributesVector = std::vector<audio_attributes_t>; using StreamTypes = std::vector<audio_stream_type_t>; using StreamTypeVector = std::vector<audio_stream_type_t>; constexpr bool operator==(const audio_attributes_t &lhs, const audio_attributes_t &rhs) { Loading @@ -38,5 +38,9 @@ constexpr bool operator!=(const audio_attributes_t &lhs, const audio_attributes_ { return !(lhs==rhs); } enum volume_group_t : uint32_t; static const volume_group_t VOLUME_GROUP_NONE = static_cast<volume_group_t>(-1); } // namespace android services/audiopolicy/common/include/Volume.h +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <math.h> namespace android { /** * VolumeSource is the discriminent for volume management on an output. * It used to be the stream type by legacy, it may be host volume group or a volume curves if Loading services/audiopolicy/common/managerdefinitions/include/IVolumeCurves.h +2 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ public: virtual float volIndexToDb(device_category device, int indexInUi) const = 0; virtual bool hasVolumeIndexForDevice(audio_devices_t device) const = 0; virtual status_t initVolume(int indexMin, int indexMax) = 0; virtual std::vector<audio_attributes_t> getAttributes() const = 0; virtual std::vector<audio_stream_type_t> getStreamTypes() const = 0; virtual void dump(String8 *dst, int spaces = 0, bool curvePoints = false) const = 0; }; Loading Loading
media/libaudioclient/AudioAttributes.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ status_t AudioAttributes::readFromParcel(const Parcel *parcel) strcpy(mAttributes.tags, ""); } mStreamType = static_cast<audio_stream_type_t>(parcel->readInt32()); mGroupId = parcel->readUint32(); mGroupId = static_cast<volume_group_t>(parcel->readUint32()); return NO_ERROR; } Loading @@ -60,7 +60,7 @@ status_t AudioAttributes::writeToParcel(Parcel *parcel) const parcel->writeUtf8AsUtf16(mAttributes.tags); } parcel->writeInt32(static_cast<int32_t>(mStreamType)); parcel->writeUint32(mGroupId); parcel->writeUint32(static_cast<uint32_t>(mGroupId)); return NO_ERROR; } Loading
media/libaudioclient/include/media/AudioAttributes.h +4 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #pragma once #include <media/AudioCommonTypes.h> #include <system/audio.h> #include <system/audio_policy.h> #include <binder/Parcelable.h> Loading @@ -28,7 +29,7 @@ class AudioAttributes : public Parcelable public: AudioAttributes() = default; AudioAttributes(const audio_attributes_t &attributes) : mAttributes(attributes) {} AudioAttributes(uint32_t groupId, AudioAttributes(volume_group_t groupId, audio_stream_type_t stream, const audio_attributes_t &attributes) : mAttributes(attributes), mStreamType(stream), mGroupId(groupId) {} Loading @@ -39,7 +40,7 @@ public: status_t writeToParcel(Parcel *parcel) const override; audio_stream_type_t getStreamType() const { return mStreamType; } uint32_t getGroupId() const { return mGroupId; } volume_group_t getGroupId() const { return mGroupId; } private: audio_attributes_t mAttributes = AUDIO_ATTRIBUTES_INITIALIZER; Loading @@ -53,7 +54,7 @@ private: * @brief mGroupId: for future volume management, define groups within a strategy that follows * the same curves of volume (extension of stream types to manage volume) */ uint32_t mGroupId = 0; volume_group_t mGroupId = VOLUME_GROUP_NONE; }; } // namespace android
media/libaudioclient/include/media/AudioCommonTypes.h +5 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ enum product_strategy_t : uint32_t; const product_strategy_t PRODUCT_STRATEGY_NONE = static_cast<product_strategy_t>(-1); using AttributesVector = std::vector<audio_attributes_t>; using StreamTypes = std::vector<audio_stream_type_t>; using StreamTypeVector = std::vector<audio_stream_type_t>; constexpr bool operator==(const audio_attributes_t &lhs, const audio_attributes_t &rhs) { Loading @@ -38,5 +38,9 @@ constexpr bool operator!=(const audio_attributes_t &lhs, const audio_attributes_ { return !(lhs==rhs); } enum volume_group_t : uint32_t; static const volume_group_t VOLUME_GROUP_NONE = static_cast<volume_group_t>(-1); } // namespace android
services/audiopolicy/common/include/Volume.h +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <math.h> namespace android { /** * VolumeSource is the discriminent for volume management on an output. * It used to be the stream type by legacy, it may be host volume group or a volume curves if Loading
services/audiopolicy/common/managerdefinitions/include/IVolumeCurves.h +2 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ public: virtual float volIndexToDb(device_category device, int indexInUi) const = 0; virtual bool hasVolumeIndexForDevice(audio_devices_t device) const = 0; virtual status_t initVolume(int indexMin, int indexMax) = 0; virtual std::vector<audio_attributes_t> getAttributes() const = 0; virtual std::vector<audio_stream_type_t> getStreamTypes() const = 0; virtual void dump(String8 *dst, int spaces = 0, bool curvePoints = false) const = 0; }; Loading