Skip to content

Commit

Permalink
[Media] Rename videoInlineSize to videoLayerSize
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260567
rdar://114296677

Reviewed by Jer Noble.

Renamed videoInlineSize to videoLayerSize. The latter better reflects its value as the content size
of MediaPlayerPrivate's video layer and avoids confusion with the concept of an inline video element.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::videoLayerSize const):
(WebCore::HTMLMediaElement::setVideoLayerSizeFenced):
(WebCore::HTMLMediaElement::videoInlineSize const): Deleted.
(WebCore::HTMLMediaElement::setVideoInlineSizeFenced): Deleted.
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::setVideoSizeFenced):
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::videoLayerSize const):
(WebCore::MediaPlayer::setVideoLayerSizeFenced):
(WebCore::MediaPlayer::videoInlineSize const): Deleted.
(WebCore::MediaPlayer::setVideoInlineSizeFenced): Deleted.
* Source/WebCore/platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerVideoLayerSize const):
(WebCore::MediaPlayerClient::mediaPlayerVideoInlineSize const): Deleted.
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::videoLayerSize const):
(WebCore::MediaPlayerPrivateInterface::setVideoLayerSizeFenced):
(WebCore::MediaPlayerPrivateInterface::videoInlineSize const): Deleted.
(WebCore::MediaPlayerPrivateInterface::setVideoInlineSizeFenced): Deleted.
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldEnsureLayer const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoLayerSizeFenced):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoInlineSizeFenced): Deleted.
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoLayerSizeFenced):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoInlineSizeFenced): Deleted.
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxyConfiguration.serialization.in:
* Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
(WebKit::RemoteMediaPlayerProxy::setVideoLayerSizeIfPossible):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
(WebKit::RemoteMediaPlayerProxy::setVideoLayerSizeFenced):
(WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeIfPossible): Deleted.
(WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced): Deleted.
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::platformLayer const):
(WebKit::MediaPlayerPrivateRemote::setVideoLayerSizeFenced):
(WebKit::MediaPlayerPrivateRemote::setVideoInlineSizeFenced): Deleted.
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):
* Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
(WebKit::MediaPlayerPrivateRemote::layerHostingContextIdChanged):
* Source/WebKit/WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm:
(-[WKVideoLayerRemote resolveBounds]):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::layerDidEnterContext):
* Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):

Canonical link: https://commits.webkit.org/267188@main
  • Loading branch information
aestes committed Aug 23, 2023
1 parent e53448e commit f7ea432
Show file tree
Hide file tree
Showing 23 changed files with 53 additions and 53 deletions.
12 changes: 6 additions & 6 deletions Source/WebCore/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8553,19 +8553,19 @@ FloatSize HTMLMediaElement::naturalSize()
return { };
}

FloatSize HTMLMediaElement::videoInlineSize() const
FloatSize HTMLMediaElement::videoLayerSize() const
{
return m_videoInlineSize;
return m_videoLayerSize;
}

void HTMLMediaElement::setVideoInlineSizeFenced(const FloatSize& size, WTF::MachSendRight&& fence)
void HTMLMediaElement::setVideoLayerSizeFenced(const FloatSize& size, WTF::MachSendRight&& fence)
{
if (m_videoInlineSize == size)
if (m_videoLayerSize == size)
return;

m_videoInlineSize = size;
m_videoLayerSize = size;
if (m_player)
m_player->setVideoInlineSizeFenced(size, WTFMove(fence));
m_player->setVideoLayerSizeFenced(size, WTFMove(fence));
}

#if ENABLE(WIRELESS_PLAYBACK_TARGET)
Expand Down
8 changes: 4 additions & 4 deletions Source/WebCore/html/HTMLMediaElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,9 @@ class HTMLMediaElement
WEBCORE_EXPORT LayerHostingContextID layerHostingContextID();
WEBCORE_EXPORT WebCore::FloatSize naturalSize();

FloatSize mediaPlayerVideoInlineSize() const override { return videoInlineSize(); }
WEBCORE_EXPORT WebCore::FloatSize videoInlineSize() const;
void setVideoInlineSizeFenced(const FloatSize&, WTF::MachSendRight&&);
FloatSize mediaPlayerVideoLayerSize() const override { return videoLayerSize(); }
WEBCORE_EXPORT WebCore::FloatSize videoLayerSize() const;
void setVideoLayerSizeFenced(const FloatSize&, WTF::MachSendRight&&);
void updateMediaState();

protected:
Expand Down Expand Up @@ -1322,7 +1322,7 @@ class HTMLMediaElement
bool m_userPrefersExtendedDescriptions { false };
bool m_changingSynthesisState { false };

FloatSize m_videoInlineSize { };
FloatSize m_videoLayerSize { };

#if !RELEASE_LOG_DISABLED
RefPtr<Logger> m_logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
return;

INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER, size);
m_videoElement->setVideoInlineSizeFenced(size, WTFMove(fence));
m_videoElement->setVideoLayerSizeFenced(size, WTFMove(fence));
m_videoElement->setVideoFullscreenFrame({ { }, size });

}
Expand Down
8 changes: 4 additions & 4 deletions Source/WebCore/platform/graphics/MediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,14 +918,14 @@ bool MediaPlayer::isVideoFullscreenStandby() const

#endif

FloatSize MediaPlayer::videoInlineSize() const
FloatSize MediaPlayer::videoLayerSize() const
{
return client().mediaPlayerVideoInlineSize();
return client().mediaPlayerVideoLayerSize();
}

void MediaPlayer::setVideoInlineSizeFenced(const FloatSize& size, WTF::MachSendRight&& fence)
void MediaPlayer::setVideoLayerSizeFenced(const FloatSize& size, WTF::MachSendRight&& fence)
{
m_private->setVideoInlineSizeFenced(size, WTFMove(fence));
m_private->setVideoLayerSizeFenced(size, WTFMove(fence));
}

#if PLATFORM(IOS_FAMILY)
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/platform/graphics/MediaPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class MediaPlayerClient {

virtual bool mediaPlayerShouldDisableHDR() const { return false; }

virtual FloatSize mediaPlayerVideoInlineSize() const { return { }; }
virtual FloatSize mediaPlayerVideoLayerSize() const { return { }; }

#if !RELEASE_LOG_DISABLED
virtual const void* mediaPlayerLogIdentifier() { return nullptr; }
Expand Down Expand Up @@ -350,8 +350,8 @@ class WEBCORE_EXPORT MediaPlayer : public MediaPlayerEnums, public ThreadSafeRef
using LayerHostingContextIDCallback = CompletionHandler<void(LayerHostingContextID)>;
void requestHostingContextID(LayerHostingContextIDCallback&&);
LayerHostingContextID hostingContextID() const;
FloatSize videoInlineSize() const;
void setVideoInlineSizeFenced(const FloatSize&, WTF::MachSendRight&&);
FloatSize videoLayerSize() const;
void setVideoLayerSizeFenced(const FloatSize&, WTF::MachSendRight&&);

#if PLATFORM(IOS_FAMILY)
NSArray *timedMetadata() const;
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class MediaPlayerPrivateInterface {
using LayerHostingContextIDCallback = CompletionHandler<void(LayerHostingContextID)>;
virtual void requestHostingContextID(LayerHostingContextIDCallback&& completionHandler) { completionHandler({ }); }
virtual LayerHostingContextID hostingContextID() const { return 0; }
virtual FloatSize videoInlineSize() const { return { }; }
virtual void setVideoInlineSizeFenced(const FloatSize&, WTF::MachSendRight&&) { }
virtual FloatSize videoLayerSize() const { return { }; }
virtual void setVideoLayerSizeFenced(const FloatSize&, WTF::MachSendRight&&) { }

#if PLATFORM(IOS_FAMILY)
virtual NSArray *timedMetadata() const { return nil; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ static WallTime toSystemClockTime(NSDate *date)
[m_videoLayer addObserver:m_objcObserver.get() forKeyPath:@"readyForDisplay" options:NSKeyValueObservingOptionNew context:(void *)MediaPlayerAVFoundationObservationContextAVPlayerLayer];
updateVideoLayerGravity();
[m_videoLayer setContentsScale:player->playerContentsScale()];
m_videoLayerManager->setVideoLayer(m_videoLayer.get(), player->videoInlineSize());
m_videoLayerManager->setVideoLayer(m_videoLayer.get(), player->presentationSize());

#if PLATFORM(IOS_FAMILY) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
if ([m_videoLayer respondsToSelector:@selector(setPIPModeEnabled:)])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ ALLOW_NEW_API_WITHOUT_GUARDS_END
void notifyActiveSourceBuffersChanged() override;

void setPresentationSize(const IntSize&) final;
void setVideoInlineSizeFenced(const FloatSize&, WTF::MachSendRight&&) final;
void setVideoLayerSizeFenced(const FloatSize&, WTF::MachSendRight&&) final;

void updateDisplayLayerAndDecompressionSession();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const f
return false;
if (m_sampleBufferDisplayLayer)
return !CGRectIsEmpty([m_sampleBufferDisplayLayer bounds]);
if (player && !player->videoInlineSize().isEmpty())
if (player && !player->videoLayerSize().isEmpty())
return true;
if (player && !player->playerContentBoxRect().isEmpty())
return true;
Expand All @@ -823,7 +823,7 @@ void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const f
updateDisplayLayerAndDecompressionSession();
}

void MediaPlayerPrivateMediaSourceAVFObjC::setVideoInlineSizeFenced(const FloatSize& newSize, WTF::MachSendRight&&)
void MediaPlayerPrivateMediaSourceAVFObjC::setVideoLayerSizeFenced(const FloatSize& newSize, WTF::MachSendRight&&)
{
if (!m_sampleBufferDisplayLayer && !newSize.isEmpty())
updateDisplayLayerAndDecompressionSession();
Expand Down Expand Up @@ -952,7 +952,7 @@ void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const f
if (m_mediaSourcePrivate)
m_mediaSourcePrivate->setVideoLayer(m_sampleBufferDisplayLayer.get());
if (player) {
m_videoLayerManager->setVideoLayer(m_sampleBufferDisplayLayer.get(), player->videoInlineSize());
m_videoLayerManager->setVideoLayer(m_sampleBufferDisplayLayer.get(), player->presentationSize());
player->renderingModeChanged();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class MediaPlayerPrivateMediaStreamAVFObjC final
MediaStreamTrackPrivate* activeVideoTrack() const;

LayerHostingContextID hostingContextID() const final;
void setVideoInlineSizeFenced(const FloatSize&, WTF::MachSendRight&&) final;
void setVideoLayerSizeFenced(const FloatSize&, WTF::MachSendRight&&) final;

ThreadSafeWeakPtr<MediaPlayer> m_player;
RefPtr<MediaStreamPrivate> m_mediaStreamPrivate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const f
if (!player)
return;

auto size = IntSize { player->videoInlineSize() } ;
auto size = IntSize { player->videoLayerSize() };
if (size.isEmpty())
size = player->presentationSize();
if (size.isEmpty() || m_intrinsicSize.isEmpty())
Expand Down Expand Up @@ -1189,7 +1189,7 @@ static inline CGAffineTransform videoTransformationMatrix(VideoFrame& videoFrame
return m_sampleBufferDisplayLayer ? m_sampleBufferDisplayLayer->hostingContextID() : 0;
}

void MediaPlayerPrivateMediaStreamAVFObjC::setVideoInlineSizeFenced(const FloatSize& size, WTF::MachSendRight&& fence)
void MediaPlayerPrivateMediaStreamAVFObjC::setVideoLayerSizeFenced(const FloatSize& size, WTF::MachSendRight&& fence)
{
if (!m_sampleBufferDisplayLayer || size.isEmpty())
return;
Expand Down
6 changes: 3 additions & 3 deletions Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class RemoteMediaPlayerProxy final
void setPresentationSize(const WebCore::IntSize&);

#if PLATFORM(COCOA)
void setVideoInlineSizeFenced(const WebCore::FloatSize&, WTF::MachSendRight&&);
void setVideoLayerSizeFenced(const WebCore::FloatSize&, WTF::MachSendRight&&);
#endif

#if ENABLE(WIRELESS_PLAYBACK_TARGET)
Expand Down Expand Up @@ -345,8 +345,8 @@ class RemoteMediaPlayerProxy final
void currentTimeChanged(const MediaTime&);

#if PLATFORM(COCOA)
WebCore::FloatSize mediaPlayerVideoInlineSize() const final { return m_configuration.videoInlineSize; }
void setVideoInlineSizeIfPossible(const WebCore::FloatSize&);
WebCore::FloatSize mediaPlayerVideoLayerSize() const final { return m_configuration.videoLayerSize; }
void setVideoLayerSizeIfPossible(const WebCore::FloatSize&);
void nativeImageForCurrentTime(CompletionHandler<void(std::optional<WTF::MachSendRight>&&, WebCore::DestinationColorSpace)>&&);
void colorSpace(CompletionHandler<void(WebCore::DestinationColorSpace)>&&);
#if !HAVE(AVSAMPLEBUFFERDISPLAYLAYER_COPYDISPLAYEDPIXELBUFFER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ messages -> RemoteMediaPlayerProxy {
SetPresentationSize(WebCore::IntSize size)

#if PLATFORM(COCOA)
SetVideoInlineSizeFenced(WebCore::FloatSize size, MachSendRight machSendRight)
SetVideoLayerSizeFenced(WebCore::FloatSize size, MachSendRight machSendRight)
#endif

#if ENABLE(WIRELESS_PLAYBACK_TARGET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct RemoteMediaPlayerProxyConfiguration {
#endif
WebCore::SecurityOriginData documentSecurityOrigin;
WebCore::IntSize presentationSize { };
WebCore::FloatSize videoInlineSize { };
WebCore::FloatSize videoLayerSize { };
uint64_t logIdentifier { 0 };
bool shouldUsePersistentCache { false };
bool isVideo { false };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct WebKit::RemoteMediaPlayerProxyConfiguration {
#endif
WebCore::SecurityOriginData documentSecurityOrigin;
WebCore::IntSize presentationSize;
WebCore::FloatSize videoInlineSize;
WebCore::FloatSize videoLayerSize;
uint64_t logIdentifier;
bool shouldUsePersistentCache;
bool isVideo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

namespace WebKit {

void RemoteMediaPlayerProxy::setVideoInlineSizeIfPossible(const WebCore::FloatSize& size)
void RemoteMediaPlayerProxy::setVideoLayerSizeIfPossible(const WebCore::FloatSize& size)
{
if (!m_inlineLayerHostingContext || !m_inlineLayerHostingContext->rootLayer() || size.isEmpty())
return;
Expand All @@ -56,7 +56,7 @@
void RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable()
{
ALWAYS_LOG(LOGIDENTIFIER);
setVideoInlineSizeIfPossible(m_configuration.videoInlineSize);
setVideoLayerSizeIfPossible(m_configuration.videoLayerSize);
m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::FirstVideoFrameAvailable(), m_id);
}

Expand Down Expand Up @@ -92,16 +92,16 @@
m_layerHostingContextIDRequests.append(WTFMove(completionHandler));
}

void RemoteMediaPlayerProxy::setVideoInlineSizeFenced(const WebCore::FloatSize& size, WTF::MachSendRight&& machSendRight)
void RemoteMediaPlayerProxy::setVideoLayerSizeFenced(const WebCore::FloatSize& size, WTF::MachSendRight&& machSendRight)
{
ALWAYS_LOG(LOGIDENTIFIER, size.width(), "x", size.height());
if (m_inlineLayerHostingContext)
m_inlineLayerHostingContext->setFencePort(machSendRight.sendRight());

m_configuration.videoInlineSize = size;
setVideoInlineSizeIfPossible(size);
m_configuration.videoLayerSize = size;
setVideoLayerSizeIfPossible(size);

m_player->setVideoInlineSizeFenced(size, WTFMove(machSendRight));
m_player->setVideoLayerSizeFenced(size, WTFMove(machSendRight));
}

void RemoteMediaPlayerProxy::mediaPlayerOnNewVideoFrameMetadata(VideoFrameMetadata&& metadata, RetainPtr<CVPixelBufferRef>&& buffer)
Expand Down
10 changes: 5 additions & 5 deletions Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,8 @@ PlatformLayer* MediaPlayerPrivateRemote::platformLayer() const
{
#if PLATFORM(COCOA)
if (!m_videoLayer && m_layerHostingContextID) {
m_videoLayer = createVideoLayerRemote(const_cast<MediaPlayerPrivateRemote*>(this), m_layerHostingContextID, m_videoFullscreenGravity, expandedIntSize(m_videoInlineSize));
m_videoLayerManager->setVideoLayer(m_videoLayer.get(), expandedIntSize(m_videoInlineSize));
m_videoLayer = createVideoLayerRemote(const_cast<MediaPlayerPrivateRemote*>(this), m_layerHostingContextID, m_videoFullscreenGravity, expandedIntSize(m_videoLayerSize));
m_videoLayerManager->setVideoLayer(m_videoLayer.get(), expandedIntSize(m_videoLayerSize));
}
return m_videoLayerManager->videoInlineLayer();
#else
Expand Down Expand Up @@ -989,10 +989,10 @@ void MediaPlayerPrivateRemote::setPresentationSize(const IntSize& size)
}

#if PLATFORM(COCOA)
void MediaPlayerPrivateRemote::setVideoInlineSizeFenced(const FloatSize& size, WTF::MachSendRight&& machSendRight)
void MediaPlayerPrivateRemote::setVideoLayerSizeFenced(const FloatSize& size, WTF::MachSendRight&& machSendRight)
{
connection().send(Messages::RemoteMediaPlayerProxy::SetVideoInlineSizeFenced(size, WTFMove(machSendRight)), m_id);
m_videoInlineSize = size;
connection().send(Messages::RemoteMediaPlayerProxy::SetVideoLayerSizeFenced(size, WTFMove(machSendRight)), m_id);
m_videoLayerSize = size;
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class MediaPlayerPrivateRemote final
void renderingModeChanged();
#if PLATFORM(COCOA)
void layerHostingContextIdChanged(std::optional<WebKit::LayerHostingContextID>&&, const WebCore::IntSize&);
WebCore::FloatSize videoInlineSize() const final { return m_videoInlineSize; }
void setVideoInlineSizeFenced(const WebCore::FloatSize&, WTF::MachSendRight&&) final;
WebCore::FloatSize videoLayerSize() const final { return m_videoLayerSize; }
void setVideoLayerSizeFenced(const WebCore::FloatSize&, WTF::MachSendRight&&) final;
#endif

void currentTimeChanged(const MediaTime&, const MonotonicTime&, bool);
Expand Down Expand Up @@ -484,7 +484,7 @@ class MediaPlayerPrivateRemote final

Vector<LayerHostingContextIDCallback> m_layerHostingContextIDRequests;
LayerHostingContextID m_layerHostingContextID { 0 };
WebCore::FloatSize m_videoInlineSize;
WebCore::FloatSize m_videoLayerSize;
std::optional<WebCore::VideoFrameMetadata> m_videoFrameMetadata;
bool m_isGatheringVideoFrameMetadata { false };
#if PLATFORM(COCOA) && !HAVE(AVSAMPLEBUFFERDISPLAYLAYER_COPYDISPLAYEDPIXELBUFFER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ std::unique_ptr<MediaPlayerPrivateInterface> RemoteMediaPlayerManager::createRem
proxyConfiguration.documentSecurityOrigin = documentSecurityOrigin;

proxyConfiguration.presentationSize = player->presentationSize();
proxyConfiguration.videoInlineSize = player->videoInlineSize();
proxyConfiguration.videoLayerSize = player->videoLayerSize();

proxyConfiguration.allowedMediaContainerTypes = player->allowedMediaContainerTypes();
proxyConfiguration.allowedMediaCodecTypes = player->allowedMediaCodecTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
return;
}
setLayerHostingContextID(inlineLayerHostingContextId.value());
m_videoInlineSize = presentationSize;
m_videoLayerSize = presentationSize;
}

} // namespace WebKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ - (void)resolveBounds
self.videoLayerFrame = self.bounds;
if (auto* mediaPlayerPrivateRemote = self.mediaPlayerPrivateRemote) {
MachSendRight fenceSendRight = MachSendRight::adopt([_context createFencePort]);
mediaPlayerPrivateRemote->setVideoInlineSizeFenced(WebCore::FloatSize(self.videoLayerFrame.size), WTFMove(fenceSendRight));
mediaPlayerPrivateRemote->setVideoLayerSizeFenced(WebCore::FloatSize(self.videoLayerFrame.size), WTFMove(fenceSendRight));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
ASSERT(!creationProperties.videoElementData);
creationProperties.videoElementData = RemoteLayerTreeTransaction::LayerCreationProperties::VideoElementData {
videoElement.identifier(),
videoElement.videoInlineSize(),
videoElement.videoLayerSize(),
videoElement.naturalSize()
};

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static FloatRect inlineVideoFrame(HTMLVideoElement& element)
auto videoRect = inlineVideoFrame(videoElement);
FloatRect videoLayerFrame = FloatRect(0, 0, videoRect.width(), videoRect.height());

FloatSize initialSize = videoElement.videoInlineSize();
FloatSize initialSize = videoElement.videoLayerSize();

#if PLATFORM(IOS) || PLATFORM(VISION)
if (allowLayeredFullscreenVideos)
Expand Down

0 comments on commit f7ea432

Please sign in to comment.