Bug 225785

Summary: Clean up UserMediaCaptureManagerProxy.cpp
Product: WebKit Reporter: Peng Liu <peng.liu6>
Component: MediaAssignee: youenn fablet <youennf>
Status: NEW ---    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, hta, jer.noble, philipj, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Peng Liu 2021-05-13 16:08:19 PDT
In UserMediaCaptureManagerProxy.cpp

void audioUnitWillStart() final
{
    // FIXME: WebProcess might want to set the category/bufferSize itself, in which case we should remove that code.
    auto bufferSize = AudioSession::sharedSession().sampleRate() / 50;
    if (AudioSession::sharedSession().preferredBufferSize() > bufferSize)
        AudioSession::sharedSession().setPreferredBufferSize(bufferSize);
    AudioSession::sharedSession().setCategory(AudioSession::PlayAndRecord, RouteSharingPolicy::Default);
}

Probably we need to remove this code section now?
Comment 1 Peng Liu 2021-05-13 16:09:15 PDT
Assign to Youenn to take a look. :-)
Comment 2 youenn fablet 2021-05-17 08:05:28 PDT
Created attachment 428828 [details]
Patch
Comment 3 youenn fablet 2021-05-18 01:13:32 PDT
Created attachment 428918 [details]
Patch
Comment 4 youenn fablet 2021-05-18 01:56:08 PDT
Hum, in case of GPUProcess crash, we would need to ensure the audio session category is set before restarting audio capture.
There is no such guarantee right now.
Comment 5 Radar WebKit Bug Importer 2021-05-20 16:09:20 PDT
<rdar://problem/78282244>