[webkit-changes] [WebKit/WebKit] 8f70e6: mediaSession API not showing artwork
Jean-Yves Avenard
noreply at github.com
Sun Nov 13 20:28:30 PST 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8f70e6bf626c81bc10c03d25657cb533df32a3c4
https://github.com/WebKit/WebKit/commit/8f70e6bf626c81bc10c03d25657cb533df32a3c4
Author: Jean-Yves Avenard <jya at apple.com>
Date: 2022-11-13 (Sun, 13 Nov 2022)
Changed paths:
M Source/WebCore/Modules/mediasession/MediaMetadata.cpp
M Source/WebCore/html/MediaElementSession.cpp
M Source/WebCore/platform/NowPlayingManager.cpp
M Source/WebCore/platform/NowPlayingManager.h
M Source/WebCore/platform/audio/NowPlayingInfo.h
M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm
M Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp
M Source/WebCore/platform/mac/MediaRemoteSoftLink.h
M Source/WebCore/platform/mac/MediaRemoteSoftLink.mm
M Source/WebKit/Scripts/process-entitlements.sh
M Tools/TestWebKitAPI/Tests/WebCore/NowPlayingInfoTests.cpp
Log Message:
-----------
mediaSession API not showing artwork
https://bugs.webkit.org/show_bug.cgi?id=247043
rdar://101597398
Reviewed by Eric Carlson
When we send an artwork image to MediaRemote, recent versions now check if the dimensions of
that image are valid by calling CGImageSourceCreateWithData with the provided image
and looking at the dimensions. However, in the GPU process, CoreGraphic's decoders are disabled by default and the creation of the CGImage fails.
Adopt new MediaRemote entitlement: com.apple.mediaremote.external-artwork-validation
which will skip this check provided the dimensions are also provided to MediaRemote via the kMRMediaRemoteNowPlayingInfoArtworkDataWidth and kMRMediaRemoteNowPlayingInfoArtworkDataHeight key.
Additionally, we will now properly decode the image in the content process to
ensure its validity. This is automatically done by the RefPtr<Image> IPC encoder.
We then reencode that decoded image into a TIFF as MediaRemote does require a valid comppressed image.
Manually tested by temporarily removing the CG's decoders restriction until a version with the MediaRemote fix is available.
* Source/WebCore/Modules/mediasession/MediaMetadata.cpp:
(WebCore::ArtworkImageLoader::notifyFinished):
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::nowPlayingInfo const):
* Source/WebCore/platform/NowPlayingManager.cpp:
(WebCore::NowPlayingManager::setNowPlayingInfo):
(WebCore::NowPlayingManager::setNowPlayingInfoPrivate):
* Source/WebCore/platform/NowPlayingManager.h:
* Source/WebCore/platform/audio/NowPlayingInfo.h:
(WebCore::NowPlayingInfoArtwork::encode const):
(WebCore::NowPlayingInfoArtwork::decode):
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::setNowPlayingInfo):
* Source/WebCore/platform/mac/MediaRemoteSoftLink.h:
* Source/WebCore/platform/mac/MediaRemoteSoftLink.mm:
* Source/WebKit/Scripts/process-entitlements.sh:
* Tools/TestWebKitAPI/Tests/WebCore/NowPlayingInfoTests.cpp:
(TestWebKitAPI::testEmptyArtwork):
Canonical link: https://commits.webkit.org/256627@main
More information about the webkit-changes
mailing list