Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93c7ece1 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10825434 from 8bb76cf2 to udc-qpr1-release

Change-Id: I58254fb6a54d8cac265d7862eefe7055a3da36e8
parents 56f733f3 8bb76cf2
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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.
 */
+2 −2
Original line number Diff line number Diff line
@@ -836,7 +836,7 @@ status_t StreamOutHalAidl::filterAndUpdateOffloadMetadata(AudioParameter &parame
                parameters, String8(AudioParameter::keyOffloadCodecDelaySamples),
                [&](int value) {
                    // The legacy keys are misnamed, the value is in frames.
                    return value > 0 ? mOffloadMetadata.delayFrames = value, OK : BAD_VALUE;
                    return value >= 0 ? mOffloadMetadata.delayFrames = value, OK : BAD_VALUE;
                }))) {
        updateMetadata = true;
    }
@@ -844,7 +844,7 @@ status_t StreamOutHalAidl::filterAndUpdateOffloadMetadata(AudioParameter &parame
                parameters, String8(AudioParameter::keyOffloadCodecPaddingSamples),
                [&](int value) {
                    // The legacy keys are misnamed, the value is in frames.
                    return value > 0 ? mOffloadMetadata.paddingFrames = value, OK : BAD_VALUE;
                    return value >= 0 ? mOffloadMetadata.paddingFrames = value, OK : BAD_VALUE;
                }))) {
        updateMetadata = true;
    }
+5 −7
Original line number Diff line number Diff line
@@ -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 {
@@ -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
@@ -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;
+22 −0
Original line number Diff line number Diff line
@@ -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;
@@ -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()