Loading media/libaudiofoundation/AudioContainers.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -119,4 +119,15 @@ std::string dumpDeviceTypes(const DeviceTypeSet &deviceTypes) { return ss.str(); } std::string dumpMixerBehaviors(const MixerBehaviorSet& mixerBehaviors) { std::stringstream ss; for (auto it = mixerBehaviors.begin(); it != mixerBehaviors.end(); ++it) { if (it != mixerBehaviors.begin()) { ss << ", "; } ss << (*it); } return ss.str(); } } // namespace android media/libaudiofoundation/include/media/AudioContainers.h +2 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,8 @@ bool deviceTypesToString(const DeviceTypeSet& deviceTypes, std::string &str); std::string dumpDeviceTypes(const DeviceTypeSet& deviceTypes); std::string dumpMixerBehaviors(const MixerBehaviorSet& mixerBehaviors); /** * Return human readable string for device types. */ Loading services/audiopolicy/common/managerdefinitions/include/IOProfile.h +5 −7 Original line number Diff line number Diff line Loading @@ -63,13 +63,7 @@ public: if (getRole() == AUDIO_PORT_ROLE_SINK && (flags & AUDIO_INPUT_FLAG_MMAP_NOIRQ) != 0) { maxActiveCount = 0; } if (getRole() == AUDIO_PORT_ROLE_SOURCE) { mMixerBehaviors.clear(); mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_DEFAULT); if (mFlags.output & AUDIO_OUTPUT_FLAG_BIT_PERFECT) { mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_BIT_PERFECT); } } refreshMixerBehaviors(); } const MixerBehaviorSet& getMixerBehaviors() const { Loading Loading @@ -222,6 +216,8 @@ public: void toSupportedMixerAttributes(std::vector<audio_mixer_attributes_t>* mixerAttributes) const; status_t readFromParcelable(const media::AudioPortFw& parcelable); // Number of streams currently opened for this profile. uint32_t curOpenCount; // Number of streams currently active for this profile. This is not the number of active clients Loading @@ -229,6 +225,8 @@ public: uint32_t curActiveCount; private: void refreshMixerBehaviors(); DeviceVector mSupportedDevices; // supported devices: this input/output can be routed from/to MixerBehaviorSet mMixerBehaviors; Loading services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,24 @@ void IOProfile::toSupportedMixerAttributes( } } void IOProfile::refreshMixerBehaviors() { if (getRole() == AUDIO_PORT_ROLE_SOURCE) { mMixerBehaviors.clear(); mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_DEFAULT); if (mFlags.output & AUDIO_OUTPUT_FLAG_BIT_PERFECT) { mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_BIT_PERFECT); } } } status_t IOProfile::readFromParcelable(const media::AudioPortFw &parcelable) { status_t status = AudioPort::readFromParcelable(parcelable); if (status == OK) { refreshMixerBehaviors(); } return status; } void IOProfile::dump(String8 *dst, int spaces) const { String8 extraInfo; Loading @@ -195,6 +213,10 @@ void IOProfile::dump(String8 *dst, int spaces) const spaces - 2, "", maxActiveCount, curActiveCount); dst->appendFormat("%*s- recommendedMuteDurationMs: %u ms\n", spaces - 2, "", recommendedMuteDurationMs); if (hasDynamicAudioProfile() && !mMixerBehaviors.empty()) { dst->appendFormat("%*s- mixerBehaviors: %s\n", spaces - 2, "", dumpMixerBehaviors(mMixerBehaviors).c_str()); } } void IOProfile::log() Loading Loading
media/libaudiofoundation/AudioContainers.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -119,4 +119,15 @@ std::string dumpDeviceTypes(const DeviceTypeSet &deviceTypes) { return ss.str(); } std::string dumpMixerBehaviors(const MixerBehaviorSet& mixerBehaviors) { std::stringstream ss; for (auto it = mixerBehaviors.begin(); it != mixerBehaviors.end(); ++it) { if (it != mixerBehaviors.begin()) { ss << ", "; } ss << (*it); } return ss.str(); } } // namespace android
media/libaudiofoundation/include/media/AudioContainers.h +2 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,8 @@ bool deviceTypesToString(const DeviceTypeSet& deviceTypes, std::string &str); std::string dumpDeviceTypes(const DeviceTypeSet& deviceTypes); std::string dumpMixerBehaviors(const MixerBehaviorSet& mixerBehaviors); /** * Return human readable string for device types. */ Loading
services/audiopolicy/common/managerdefinitions/include/IOProfile.h +5 −7 Original line number Diff line number Diff line Loading @@ -63,13 +63,7 @@ public: if (getRole() == AUDIO_PORT_ROLE_SINK && (flags & AUDIO_INPUT_FLAG_MMAP_NOIRQ) != 0) { maxActiveCount = 0; } if (getRole() == AUDIO_PORT_ROLE_SOURCE) { mMixerBehaviors.clear(); mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_DEFAULT); if (mFlags.output & AUDIO_OUTPUT_FLAG_BIT_PERFECT) { mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_BIT_PERFECT); } } refreshMixerBehaviors(); } const MixerBehaviorSet& getMixerBehaviors() const { Loading Loading @@ -222,6 +216,8 @@ public: void toSupportedMixerAttributes(std::vector<audio_mixer_attributes_t>* mixerAttributes) const; status_t readFromParcelable(const media::AudioPortFw& parcelable); // Number of streams currently opened for this profile. uint32_t curOpenCount; // Number of streams currently active for this profile. This is not the number of active clients Loading @@ -229,6 +225,8 @@ public: uint32_t curActiveCount; private: void refreshMixerBehaviors(); DeviceVector mSupportedDevices; // supported devices: this input/output can be routed from/to MixerBehaviorSet mMixerBehaviors; Loading
services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,24 @@ void IOProfile::toSupportedMixerAttributes( } } void IOProfile::refreshMixerBehaviors() { if (getRole() == AUDIO_PORT_ROLE_SOURCE) { mMixerBehaviors.clear(); mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_DEFAULT); if (mFlags.output & AUDIO_OUTPUT_FLAG_BIT_PERFECT) { mMixerBehaviors.insert(AUDIO_MIXER_BEHAVIOR_BIT_PERFECT); } } } status_t IOProfile::readFromParcelable(const media::AudioPortFw &parcelable) { status_t status = AudioPort::readFromParcelable(parcelable); if (status == OK) { refreshMixerBehaviors(); } return status; } void IOProfile::dump(String8 *dst, int spaces) const { String8 extraInfo; Loading @@ -195,6 +213,10 @@ void IOProfile::dump(String8 *dst, int spaces) const spaces - 2, "", maxActiveCount, curActiveCount); dst->appendFormat("%*s- recommendedMuteDurationMs: %u ms\n", spaces - 2, "", recommendedMuteDurationMs); if (hasDynamicAudioProfile() && !mMixerBehaviors.empty()) { dst->appendFormat("%*s- mixerBehaviors: %s\n", spaces - 2, "", dumpMixerBehaviors(mMixerBehaviors).c_str()); } } void IOProfile::log() Loading