Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 110a4711d4eb0f4aa339e1460b0164965b0c5431
      
https://github.com/WebKit/WebKit/commit/110a4711d4eb0f4aa339e1460b0164965b0c5431
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2026-03-25 (Wed, 25 Mar 2026)

  Changed paths:
    M Source/WebCore/platform/MediaStrategy.cpp
    M Source/WebCore/platform/MediaStrategy.h
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.h
    M Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp

  Log Message:
  -----------
  MediaPlayer::supportsType unnecessarily queries the GPUP for all non-cache 
queries
https://bugs.webkit.org/show_bug.cgi?id=310690
rdar://173296040

Reviewed by Jer Noble.

When the MediaPlayerPrivateMediaSourceAVFObjC runs in the web content process
we still have several MediaPlayerFactory, in particular we have a 
MediaPlayerRemoteFactory
created for allowing the MediaPlayerPrivateAVFObjC to run in the GPU process.
When calling MediaPlayer::supportsType bestMediaEngineForSupportParameters
will iterate over all MediaPlayerRemoteFactory existing and query the GPUP via a
sync IPC call if the content is supported which it won't be as MediaSource
isn't supported.

To guard against this unnecessary check, we now provide alongside the
related PlatformMediaDecodingType and so we can skip unusable MediaPlayerFactory
for the current query.

Covered by existing tests. No change in JS observable behaviours.

* Source/WebCore/platform/MediaStrategy.cpp: When a new MediaPlayer is marked 
to be
usable in the content process, it changes which MediaPlayerRemoteFactory is
to be registered. Force rescan.
(WebCore::MediaStrategy::enableRemoteRenderer):
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::WTF_REQUIRES_LOCK):
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs): We no longer needs
to have a special case for MediaStream, this is now handled upstream.
(WebKit::RemoteMediaPlayerManager::setUseGPUProcess):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to