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

Commit 014605a5 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Gerrit Code Review
Browse files

Merge "Pass direct flags to r submix IO profile for compressed audio mix" into main

parents c1319769 80551869
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -89,10 +89,12 @@ public:
    status_t addProfile(const sp<IOProfile> &profile);

    status_t addOutputProfile(const std::string& name, const audio_config_t *config,
            audio_devices_t device, const String8& address);
            audio_devices_t device, const String8& address,
            audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE);
    status_t removeOutputProfile(const std::string& name);
    status_t addInputProfile(const std::string& name, const audio_config_t *config,
            audio_devices_t device, const String8& address);
            audio_devices_t device, const String8& address,
            audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE);
    status_t removeInputProfile(const std::string& name);

    audio_module_handle_t getHandle() const { return mHandle; }
+6 −3
Original line number Diff line number Diff line
@@ -59,12 +59,13 @@ std::string HwModule::getTagForDevice(audio_devices_t device, const String8 &add
}

status_t HwModule::addOutputProfile(const std::string& name, const audio_config_t *config,
                                    audio_devices_t device, const String8& address)
                                    audio_devices_t device, const String8& address,
                                    audio_output_flags_t flags)
{
    sp<IOProfile> profile = new OutputProfile(name);

    profile->addAudioProfile(new AudioProfile(config->format, config->channel_mask,
                                              config->sample_rate));
    profile->setFlags(flags);

    sp<DeviceDescriptor> devDesc =
            new DeviceDescriptor(device, getTagForDevice(device), address.c_str());
@@ -128,11 +129,13 @@ status_t HwModule::removeOutputProfile(const std::string& name)
}

status_t HwModule::addInputProfile(const std::string& name, const audio_config_t *config,
                                   audio_devices_t device, const String8& address)
                                   audio_devices_t device, const String8& address,
                                   audio_input_flags_t flags)
{
    sp<IOProfile> profile = new InputProfile(name);
    profile->addAudioProfile(new AudioProfile(config->format, config->channel_mask,
                                              config->sample_rate));
    profile->setFlags(flags);

    sp<DeviceDescriptor> devDesc =
            new DeviceDescriptor(device, getTagForDevice(device), address.c_str());
+6 −2
Original line number Diff line number Diff line
@@ -3638,9 +3638,13 @@ status_t AudioPolicyManager::registerPolicyMixes(const Vector<AudioMix>& mixes)
            outputConfig.channel_mask = AUDIO_CHANNEL_OUT_STEREO;
            inputConfig.channel_mask = AUDIO_CHANNEL_IN_STEREO;
            rSubmixModule->addOutputProfile(address.c_str(), &outputConfig,
                    AUDIO_DEVICE_OUT_REMOTE_SUBMIX, address);
                    AUDIO_DEVICE_OUT_REMOTE_SUBMIX, address,
                    audio_is_linear_pcm(outputConfig.format)
                        ? AUDIO_OUTPUT_FLAG_NONE : AUDIO_OUTPUT_FLAG_DIRECT);
            rSubmixModule->addInputProfile(address.c_str(), &inputConfig,
                    AUDIO_DEVICE_IN_REMOTE_SUBMIX, address);
                    AUDIO_DEVICE_IN_REMOTE_SUBMIX, address,
                    audio_is_linear_pcm(inputConfig.format)
                        ? AUDIO_INPUT_FLAG_NONE : AUDIO_INPUT_FLAG_DIRECT);

            if ((res = setDeviceConnectionStateInt(deviceTypeToMakeAvailable,
                    AUDIO_POLICY_DEVICE_STATE_AVAILABLE,