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

Commit 6582ea99 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7574892 from 74dcdac0 to sc-release

Change-Id: I37d97de8574e9259e1f4b6254a0c26cee7fe27d4
parents df6b5dd3 74dcdac0
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -334,6 +334,12 @@ void encodeNFrames(const std::shared_ptr<android::Codec2Client::Component>& comp
    int bytesCount = nWidth * nHeight * 3 >> 1;
    int32_t timestampIncr = ENCODER_TIMESTAMP_INCREMENT;
    c2_status_t err = C2_OK;

    // Query component's memory usage flags
    std::vector<std::unique_ptr<C2Param>> params;
    C2StreamUsageTuning::input compUsage(0u, 0u);
    component->query({&compUsage}, {}, C2_DONT_BLOCK, &params);

    while (1) {
        if (nFrames == 0) break;
        uint32_t flags = 0;
@@ -384,7 +390,8 @@ void encodeNFrames(const std::shared_ptr<android::Codec2Client::Component>& comp
        }
        std::shared_ptr<C2GraphicBlock> block;
        err = graphicPool->fetchGraphicBlock(nWidth, nHeight, HAL_PIXEL_FORMAT_YV12,
                                             {C2MemoryUsage::CPU_READ, C2MemoryUsage::CPU_WRITE},
                                             {C2MemoryUsage::CPU_READ | compUsage.value,
                                                 C2MemoryUsage::CPU_WRITE | compUsage.value},
                                             &block);
        if (err != C2_OK) {
            fprintf(stderr, "fetchGraphicBlock failed : %d\n", err);
+4 −2
Original line number Diff line number Diff line
@@ -393,12 +393,14 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
                || outputs.isActiveLocally(
                    toVolumeSource(AUDIO_STREAM_ACCESSIBILITY),
                    SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY);
        // - for STRATEGY_SONIFICATION:

        bool ringActiveLocally = outputs.isActiveLocally(toVolumeSource(AUDIO_STREAM_RING), 0);
        // - for STRATEGY_SONIFICATION and ringtone active:
        // if SPEAKER was selected, and SPEAKER_SAFE is available, use SPEAKER_SAFE instead
        // - for STRATEGY_SONIFICATION_RESPECTFUL:
        // if no media is playing on the device, check for mandatory use of "safe" speaker
        // when media would have played on speaker, and the safe speaker path is available
        if (strategy == STRATEGY_SONIFICATION
        if (strategy == STRATEGY_SONIFICATION || ringActiveLocally
            || (strategy == STRATEGY_SONIFICATION_RESPECTFUL && !mediaActiveLocally)) {
            devices.replaceDevicesByType(
                    AUDIO_DEVICE_OUT_SPEAKER,
+1 −2
Original line number Diff line number Diff line
@@ -5849,12 +5849,11 @@ DeviceVector AudioPolicyManager::getNewOutputDevices(const sp<SwAudioOutputDescr
        // With low-latency playing on speaker, music on WFD, when the first low-latency
        // output is stopped, getNewOutputDevices checks for a product strategy
        // from the list, as STRATEGY_SONIFICATION comes prior to STRATEGY_MEDIA.
        // If an ALARM, RING or ENFORCED_AUDIBLE stream is supported by the product strategy,
        // If an ALARM or ENFORCED_AUDIBLE stream is supported by the product strategy,
        // devices are returned for STRATEGY_SONIFICATION without checking whether the
        // stream is associated to the output descriptor.
        if (doGetOutputDevicesForVoice() || outputDesc->isStrategyActive(productStrategy) ||
               ((hasStreamActive(AUDIO_STREAM_ALARM) ||
                hasStreamActive(AUDIO_STREAM_RING) ||
                hasStreamActive(AUDIO_STREAM_ENFORCED_AUDIBLE)) &&
                mOutputs.isStrategyActiveOnSameModule(productStrategy, outputDesc))) {
            // Retrieval of devices for voice DL is done on primary output profile, cannot