Loading media/codec2/hidl/1.0/vts/functional/video/VtsHalMediaC2V1_0TargetVideoEncTest.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -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, ¶ms); while (1) { if (nFrames == 0) break; uint32_t flags = 0; Loading Loading @@ -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); Loading services/audiopolicy/enginedefault/src/Engine.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -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, Loading services/audiopolicy/managerdefault/AudioPolicyManager.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
media/codec2/hidl/1.0/vts/functional/video/VtsHalMediaC2V1_0TargetVideoEncTest.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -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, ¶ms); while (1) { if (nFrames == 0) break; uint32_t flags = 0; Loading Loading @@ -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); Loading
services/audiopolicy/enginedefault/src/Engine.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -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, Loading
services/audiopolicy/managerdefault/AudioPolicyManager.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -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 Loading