Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6cee2aec2971066e4cee5fe286a55dbe5af6ad7c
      
https://github.com/WebKit/WebKit/commit/6cee2aec2971066e4cee5fe286a55dbe5af6ad7c
  Author: Youenn Fablet <[email protected]>
  Date:   2023-03-21 (Tue, 21 Mar 2023)

  Changed paths:
    A 
LayoutTests/fast/mediastream/audio-session-category-capture-audio-context-expected.txt
    A 
LayoutTests/fast/mediastream/audio-session-category-capture-audio-context.html
    M Source/WebCore/Modules/webaudio/AudioContext.cpp
    M Source/WebCore/Modules/webaudio/AudioContext.h
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/platform/audio/PlatformMediaSession.cpp
    M Source/WebCore/platform/audio/PlatformMediaSession.h
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm

  Log Message:
  -----------
  Not audible AudioContext prevents the audio session category to change from 
play-and-record after stopping capture
https://bugs.webkit.org/show_bug.cgi?id=253951
rdar://problem/106744687

Reviewed by Jer Noble.

We made PlayAndRecord audio session category sticky until audio playing ends.
This ensures that stopping microphone capture will not change the audio level 
on iOS.
This works well for HTMLMediaElement but not for AudioContext.
Some AudioContexts are used for analysis and are not producing any audio.
We should not delay changing the audio session category if those analytic 
AudioContexts are running.

For that reason, we introduce PlatformMediaSessionClient::isAudible() to 
introduce this.
It is somehow similar to canProduceAudio except it does not impact with 
interruptions.
We might want to merge both in a follow-up.

* 
LayoutTests/fast/mediastream/audio-session-category-capture-audio-context-expected.txt:
 Added.
* 
LayoutTests/fast/mediastream/audio-session-category-capture-audio-context.html: 
Added.
* Source/WebCore/Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::mediaState const):
(WebCore::AudioContext::isAudible const):
* Source/WebCore/Modules/webaudio/AudioContext.h:
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::isAudible const):
* Source/WebCore/platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSessionClient::isAudible const):
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateSessionState):

Canonical link: https://commits.webkit.org/261908@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to