Fix build failures when video fullscreen and picture-in-picture is disabled
authorpeng.liu6@apple.com <peng.liu6@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Apr 2020 04:06:11 +0000 (04:06 +0000)
committerpeng.liu6@apple.com <peng.liu6@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Apr 2020 04:06:11 +0000 (04:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=210777

Reviewed by Eric Carlson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".

* Configurations/FeatureDefines.xcconfig:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
(WebCore::VideoLayerManagerObjC::setVideoLayer):
(WebCore::VideoLayerManagerObjC::requiresTextTrackRepresentation const):
(WebCore::VideoLayerManagerObjC::syncTextTrackBounds):
(WebCore::VideoLayerManagerObjC::setTextTrackRepresentation):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".

* Configurations/FeatureDefines.xcconfig:
* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::setVideoFullscreenGravity):
(WebKit::RemoteMediaPlayerProxy::updateVideoFullscreenInlineImage):
(WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
(WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
(WebKit::RemoteMediaPlayerProxy::setBufferingPolicy):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
(WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::prepareForPlayback):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/PlatformEnable.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@260412 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/ChangeLog
Source/WTF/wtf/PlatformEnable.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm
Source/WebKit/ChangeLog
Source/WebKit/Configurations/FeatureDefines.xcconfig
Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm
Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
Tools/ChangeLog
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig

index 0524f56..73da29d 100644 (file)
@@ -1,3 +1,12 @@
+2020-04-20  Peng Liu  <peng.liu6@apple.com>
+
+        Fix build failures when video fullscreen and picture-in-picture is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=210777
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2020-04-20  Ross Kirsling  <ross.kirsling@sony.com>
 
         Intl classes shouldn't need an m_initialized* field
index a74b4a6..50318a4 100644 (file)
@@ -372,7 +372,10 @@ ENABLE_VARIATION_FONTS = ENABLE_VARIATION_FONTS;
 
 ENABLE_VIDEO = ENABLE_VIDEO;
 
-ENABLE_VIDEO_PRESENTATION_MODE = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE = $(ENABLE_VIDEO_PRESENTATION_MODE_$(WK_PLATFORM_NAME));
+ENABLE_VIDEO_PRESENTATION_MODE_iphoneos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_watchos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx = ENABLE_VIDEO_PRESENTATION_MODE;
 
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 
index f976f4e..8acc38c 100644 (file)
@@ -1,3 +1,12 @@
+2020-04-20  Peng Liu  <peng.liu6@apple.com>
+
+        Fix build failures when video fullscreen and picture-in-picture is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=210777
+
+        Reviewed by Eric Carlson.
+
+        * wtf/PlatformEnable.h:
+
 2020-04-20  Yusuke Suzuki  <ysuzuki@apple.com>
 
         Add document about WTF malloc-related macros
index dcf5110..ad6ff0e 100644 (file)
 #define ENABLE_FULLSCREEN_API 0
 #endif
 
-#if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || PLATFORM(MAC)
+#if ((PLATFORM(IOS) || PLATFORM(WATCHOS)) && HAVE(AVKIT)) || PLATFORM(MAC)
+#if !defined(ENABLE_VIDEO_PRESENTATION_MODE)
 #define ENABLE_VIDEO_PRESENTATION_MODE 1
-#else
-#define ENABLE_VIDEO_PRESENTATION_MODE 0
+#endif
 #endif
 
 #if !defined(ENABLE_GAMEPAD)
index 2d0de2c..3f6b74a 100644 (file)
@@ -1,3 +1,22 @@
+2020-04-20  Peng Liu  <peng.liu6@apple.com>
+
+        Fix build failures when video fullscreen and picture-in-picture is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=210777
+
+        Reviewed by Eric Carlson.
+
+        Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".
+
+        * Configurations/FeatureDefines.xcconfig:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
+        * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
+        * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
+        (WebCore::VideoLayerManagerObjC::setVideoLayer):
+        (WebCore::VideoLayerManagerObjC::requiresTextTrackRepresentation const):
+        (WebCore::VideoLayerManagerObjC::syncTextTrackBounds):
+        (WebCore::VideoLayerManagerObjC::setTextTrackRepresentation):
+
 2020-04-20  Nikos Mouchtaris  <nmouchtaris@apple.com>
 
         WK2 Quicklook for attachments
index a74b4a6..50318a4 100644 (file)
@@ -372,7 +372,10 @@ ENABLE_VARIATION_FONTS = ENABLE_VARIATION_FONTS;
 
 ENABLE_VIDEO = ENABLE_VIDEO;
 
-ENABLE_VIDEO_PRESENTATION_MODE = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE = $(ENABLE_VIDEO_PRESENTATION_MODE_$(WK_PLATFORM_NAME));
+ENABLE_VIDEO_PRESENTATION_MODE_iphoneos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_watchos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx = ENABLE_VIDEO_PRESENTATION_MODE;
 
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 
index e422f1b..50ec279 100644 (file)
@@ -1,3 +1,12 @@
+2020-04-20  Peng Liu  <peng.liu6@apple.com>
+
+        Fix build failures when video fullscreen and picture-in-picture is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=210777
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2020-04-20  Darin Adler  <darin@apple.com>
 
         Use #import instead of #include in Objective-C and don't use #pragma once
index a74b4a6..50318a4 100644 (file)
@@ -372,7 +372,10 @@ ENABLE_VARIATION_FONTS = ENABLE_VARIATION_FONTS;
 
 ENABLE_VIDEO = ENABLE_VIDEO;
 
-ENABLE_VIDEO_PRESENTATION_MODE = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE = $(ENABLE_VIDEO_PRESENTATION_MODE_$(WK_PLATFORM_NAME));
+ENABLE_VIDEO_PRESENTATION_MODE_iphoneos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_watchos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx = ENABLE_VIDEO_PRESENTATION_MODE;
 
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 
index 65f2b70..41b6efa 100644 (file)
@@ -1805,10 +1805,12 @@ void MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity()
     if (!m_videoLayer)
         return;
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     // Do not attempt to change the video gravity while in full screen mode.
     // See setVideoFullscreenGravity().
     if (m_videoLayerManager->videoFullscreenLayer())
         return;
+#endif
 
     [CATransaction begin];
     [CATransaction setDisableActions:YES];    
index e303217..84d56bc 100644 (file)
@@ -46,13 +46,16 @@ public:
     VideoLayerManagerObjC(const Logger&, const void*);
 
     PlatformLayer *videoInlineLayer() const { return m_videoInlineLayer.get(); }
+    void setVideoLayer(PlatformLayer *, IntSize contentSize);
+
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     PlatformLayer *videoFullscreenLayer() const { return m_videoFullscreenLayer.get(); }
     FloatRect videoFullscreenFrame() const { return m_videoFullscreenFrame; }
-
-    void setVideoLayer(PlatformLayer *, IntSize contentSize);
     void setVideoFullscreenLayer(PlatformLayer *, WTF::Function<void()>&& completionHandler, NativeImagePtr);
     void updateVideoFullscreenInlineImage(NativeImagePtr);
     void setVideoFullscreenFrame(FloatRect);
+#endif
+
     void didDestroyVideoLayer();
 
     bool requiresTextTrackRepresentation() const;
@@ -70,10 +73,12 @@ private:
 
     RetainPtr<PlatformLayer> m_textTrackRepresentationLayer;
     RetainPtr<WebVideoContainerLayer> m_videoInlineLayer;
+    FloatRect m_videoInlineFrame;
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     RetainPtr<PlatformLayer> m_videoFullscreenLayer;
-    RetainPtr<PlatformLayer> m_videoLayer;
     FloatRect m_videoFullscreenFrame;
-    FloatRect m_videoInlineFrame;
+#endif
+    RetainPtr<PlatformLayer> m_videoLayer;
 };
 
 }
index 72c483d..9e85aef 100644 (file)
@@ -66,15 +66,20 @@ void VideoLayerManagerObjC::setVideoLayer(PlatformLayer *videoLayer, IntSize con
     if ([videoLayer isKindOfClass:PAL::getAVPlayerLayerClass()])
         [m_videoInlineLayer setPlayerLayer:(AVPlayerLayer *)videoLayer];
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     if (m_videoFullscreenLayer) {
         [m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())];
         [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0];
-    } else {
+    } else
+#endif
+    {
         [m_videoInlineLayer insertSublayer:m_videoLayer.get() atIndex:0];
         [m_videoLayer setFrame:m_videoInlineLayer.get().bounds];
     }
 }
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
+
 void VideoLayerManagerObjC::updateVideoFullscreenInlineImage(NativeImagePtr image)
 {
     if (m_videoInlineLayer)
@@ -140,6 +145,8 @@ void VideoLayerManagerObjC::setVideoFullscreenFrame(FloatRect videoFullscreenFra
     syncTextTrackBounds();
 }
 
+#endif
+
 void VideoLayerManagerObjC::didDestroyVideoLayer()
 {
     ALWAYS_LOG(LOGIDENTIFIER);
@@ -152,11 +159,16 @@ void VideoLayerManagerObjC::didDestroyVideoLayer()
 
 bool VideoLayerManagerObjC::requiresTextTrackRepresentation() const
 {
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     return m_videoFullscreenLayer;
+#else
+    return false;
+#endif
 }
 
 void VideoLayerManagerObjC::syncTextTrackBounds()
 {
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     if (!m_videoFullscreenLayer || !m_textTrackRepresentationLayer)
         return;
 
@@ -169,10 +181,14 @@ void VideoLayerManagerObjC::syncTextTrackBounds()
     [m_textTrackRepresentationLayer setFrame:m_videoFullscreenFrame];
 
     [CATransaction commit];
+#endif
 }
 
 void VideoLayerManagerObjC::setTextTrackRepresentation(TextTrackRepresentation* representation)
 {
+#if !ENABLE(VIDEO_PRESENTATION_MODE)
+    UNUSED_PARAM(representation);
+#else
     ALWAYS_LOG(LOGIDENTIFIER);
 
     PlatformLayer* representationLayer = representation ? representation->platformLayer() : nil;
@@ -195,6 +211,7 @@ void VideoLayerManagerObjC::setTextTrackRepresentation(TextTrackRepresentation*
     }
 
     [CATransaction commit];
+#endif
 }
 
 WTFLogChannel& VideoLayerManagerObjC::logChannel() const
index ab620a9..a233fba 100644 (file)
@@ -1,3 +1,26 @@
+2020-04-20  Peng Liu  <peng.liu6@apple.com>
+
+        Fix build failures when video fullscreen and picture-in-picture is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=210777
+
+        Reviewed by Eric Carlson.
+
+        Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".
+
+        * Configurations/FeatureDefines.xcconfig:
+        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenGravity):
+        (WebKit::RemoteMediaPlayerProxy::updateVideoFullscreenInlineImage):
+        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
+        (WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
+        (WebKit::RemoteMediaPlayerProxy::setBufferingPolicy):
+        * GPUProcess/media/RemoteMediaPlayerProxy.h:
+        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+        * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
+        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
+        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
+        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
+
 2020-04-20  Alex Christensen  <achristensen@webkit.org>
 
         SPI clients using fastServerTrustEvaluationEnabled need SPI to inform them of modern TLS negotiation
index a74b4a6..50318a4 100644 (file)
@@ -372,7 +372,10 @@ ENABLE_VARIATION_FONTS = ENABLE_VARIATION_FONTS;
 
 ENABLE_VIDEO = ENABLE_VIDEO;
 
-ENABLE_VIDEO_PRESENTATION_MODE = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE = $(ENABLE_VIDEO_PRESENTATION_MODE_$(WK_PLATFORM_NAME));
+ENABLE_VIDEO_PRESENTATION_MODE_iphoneos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_watchos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx = ENABLE_VIDEO_PRESENTATION_MODE;
 
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 
index 38debd4..82942e0 100644 (file)
@@ -201,12 +201,12 @@ void RemoteMediaPlayerProxy::setShouldMaintainAspectRatio(bool maintainRatio)
     m_player->setShouldMaintainAspectRatio(maintainRatio);
 }
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
 void RemoteMediaPlayerProxy::setVideoFullscreenGravity(WebCore::MediaPlayerEnums::VideoGravity gravity)
 {
-#if ENABLE(VIDEO_PRESENTATION_MODE)
     m_player->setVideoFullscreenGravity(gravity);
-#endif
 }
+#endif
 
 void RemoteMediaPlayerProxy::acceleratedRenderingStateChanged(bool renderingCanBeAccelerated)
 {
@@ -244,30 +244,27 @@ void RemoteMediaPlayerProxy::removeResource(RemoteMediaResourceIdentifier remote
 }
 
 // MediaPlayerClient
+#if ENABLE(VIDEO_PRESENTATION_MODE)
 void RemoteMediaPlayerProxy::updateVideoFullscreenInlineImage()
 {
-#if ENABLE(VIDEO_PRESENTATION_MODE)
     m_player->updateVideoFullscreenInlineImage();
-#endif
 }
 
 void RemoteMediaPlayerProxy::setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode mode)
 {
-#if ENABLE(VIDEO_PRESENTATION_MODE)
     m_player->setVideoFullscreenMode(mode);
-#endif
-}
 
-void RemoteMediaPlayerProxy::setBufferingPolicy(MediaPlayer::BufferingPolicy policy)
-{
-    m_player->setBufferingPolicy(policy);
 }
 
 void RemoteMediaPlayerProxy::videoFullscreenStandbyChanged()
 {
-#if ENABLE(VIDEO_PRESENTATION_MODE)
     m_player->videoFullscreenStandbyChanged();
+}
 #endif
+
+void RemoteMediaPlayerProxy::setBufferingPolicy(MediaPlayer::BufferingPolicy policy)
+{
+    m_player->setBufferingPolicy(policy);
 }
 
 #if PLATFORM(IOS_FAMILY)
@@ -677,6 +674,7 @@ double RemoteMediaPlayerProxy::mediaPlayerRequestedPlaybackRate() const
     return 0;
 }
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
 MediaPlayerEnums::VideoFullscreenMode RemoteMediaPlayerProxy::mediaPlayerFullscreenMode() const
 {
     notImplemented();
@@ -688,6 +686,7 @@ bool RemoteMediaPlayerProxy::mediaPlayerIsVideoFullscreenStandby() const
     notImplemented();
     return false;
 }
+#endif
 
 bool RemoteMediaPlayerProxy::mediaPlayerShouldDisableSleep() const
 {
index d0a7ac1..cffc6e8 100644 (file)
@@ -82,13 +82,14 @@ public:
     MediaPlayerPrivateRemoteIdentifier idendifier() const { return m_id; }
     void invalidate();
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     void updateVideoFullscreenInlineImage();
     void setVideoFullscreenMode(WebCore::MediaPlayer::VideoFullscreenMode);
+    void videoFullscreenStandbyChanged();
+#endif
 
     void setBufferingPolicy(WebCore::MediaPlayer::BufferingPolicy);
 
-    void videoFullscreenStandbyChanged();
-
 #if PLATFORM(IOS_FAMILY)
     void accessLog(CompletionHandler<void(String)>&&);
     void errorLog(CompletionHandler<void(String)>&&);
@@ -122,9 +123,11 @@ public:
 
     void setVisible(bool);
     void setShouldMaintainAspectRatio(bool);
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     void enterFullscreen(CompletionHandler<void()>&&);
     void exitFullscreen(CompletionHandler<void()>&&);
     void setVideoFullscreenGravity(WebCore::MediaPlayerEnums::VideoGravity);
+#endif
     void acceleratedRenderingStateChanged(bool);
     void setShouldDisableSleep(bool);
     void setRate(double);
@@ -135,8 +138,10 @@ public:
 
 #if PLATFORM(COCOA)
     void setVideoInlineSizeFenced(const WebCore::IntSize&, const WTF::MachSendRight&);
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     void setVideoFullscreenFrameFenced(const WebCore::FloatRect&, const WTF::MachSendRight&);
 #endif
+#endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     void setWirelessVideoPlaybackDisabled(bool);
@@ -252,8 +257,10 @@ private:
     String mediaPlayerSourceApplicationIdentifier() const final;
 
     double mediaPlayerRequestedPlaybackRate() const final;
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     WebCore::MediaPlayerEnums::VideoFullscreenMode mediaPlayerFullscreenMode() const final;
     bool mediaPlayerIsVideoFullscreenStandby() const final;
+#endif
     Vector<String> mediaPlayerPreferredAudioCharacteristics() const final;
 
     bool mediaPlayerShouldDisableSleep() const final;
@@ -279,7 +286,9 @@ private:
     Ref<IPC::Connection> m_webProcessConnection;
     RefPtr<WebCore::MediaPlayer> m_player;
     std::unique_ptr<LayerHostingContext> m_inlineLayerHostingContext;
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     std::unique_ptr<LayerHostingContext> m_fullscreenLayerHostingContext;
+#endif
     RemoteMediaPlayerManagerProxy& m_manager;
     WebCore::MediaPlayerEnums::MediaEngineIdentifier m_engineIdentifier;
     Vector<WebCore::ContentType> m_typesRequiringHardwareSupport;
index b022f56..68f1897 100644 (file)
@@ -47,14 +47,18 @@ messages -> RemoteMediaPlayerProxy NotRefCounted {
     PrepareForRendering()
     SetVisible(bool visible)
     SetShouldMaintainAspectRatio(bool maintainAspectRatio)
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     SetVideoFullscreenGravity(enum:uint8_t WebCore::MediaPlayerEnums::VideoGravity gravity)
+#endif
     AcceleratedRenderingStateChanged(bool canBeAccelerated)
     SetShouldDisableSleep(bool disable)
     SetRate(double rate)
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     UpdateVideoFullscreenInlineImage()
     SetVideoFullscreenMode(WebCore::MediaPlayer::VideoFullscreenMode mode)
     VideoFullscreenStandbyChanged()
+#endif
 
     SetBufferingPolicy(WebCore::MediaPlayer::BufferingPolicy policy)
 
@@ -64,11 +68,15 @@ messages -> RemoteMediaPlayerProxy NotRefCounted {
 
 #if PLATFORM(COCOA)
     SetVideoInlineSizeFenced(WebCore::IntSize size, MachSendRight machSendRight)
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     SetVideoFullscreenFrameFenced(WebCore::FloatRect rect, MachSendRight machSendRight)
 #endif
+#endif
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     EnterFullscreen() -> () Async
     ExitFullscreen() -> () Async
+#endif
 
     # Paint
     # PaintCurrentFrameInContext
index 17c2deb..d9824e8 100644 (file)
@@ -45,9 +45,11 @@ void RemoteMediaPlayerProxy::prepareForPlayback(bool privateMode, WebCore::Media
     m_videoContentScale = videoContentScale;
     if (!m_inlineLayerHostingContext)
         m_inlineLayerHostingContext = LayerHostingContext::createForExternalHostingProcess();
+#if ENABLE(VIDEO_PRESENTATION_MODE)
     if (!m_fullscreenLayerHostingContext)
         m_fullscreenLayerHostingContext = LayerHostingContext::createForExternalHostingProcess();
     completionHandler(m_inlineLayerHostingContext->contextID(), m_fullscreenLayerHostingContext->contextID());
+#endif
 }
 
 void RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable()
@@ -72,6 +74,7 @@ void RemoteMediaPlayerProxy::setVideoInlineSizeFenced(const WebCore::IntSize& si
     [CATransaction commit];
 }
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
 void RemoteMediaPlayerProxy::enterFullscreen(CompletionHandler<void()>&& completionHandler)
 {
     auto videoFullscreenLayer = m_player->createVideoFullscreenLayer();
@@ -93,6 +96,7 @@ void RemoteMediaPlayerProxy::setVideoFullscreenFrameFenced(const WebCore::FloatR
     m_fullscreenLayerHostingContext->setFencePort(machSendRight.sendRight());
     m_player->setVideoFullscreenFrame(rect);
 }
+#endif
 
 } // namespace WebKit
 
index c4e765e..f255d63 100644 (file)
@@ -129,8 +129,9 @@ void MediaPlayerPrivateRemote::prepareForPlayback(bool privateMode, MediaPlayer:
             return;
 
         m_videoInlineLayer = createVideoLayerRemote(this, inlineLayerHostingContextId.value());
-
+#if ENABLE(VIDEO_PRESENTATION_MODE)
         m_fullscreenLayerHostingContextId = fullscreenLayerHostingContextId;
+#endif
     }, m_id);
 }
 
index 8d5e343..bceb68c 100644 (file)
@@ -1,3 +1,12 @@
+2020-04-20  Peng Liu  <peng.liu6@apple.com>
+
+        Fix build failures when video fullscreen and picture-in-picture is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=210777
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2020-04-20  Darin Adler  <darin@apple.com>
 
         Use #import instead of #include in Objective-C and don't use #pragma once
index a74b4a6..50318a4 100644 (file)
@@ -372,7 +372,10 @@ ENABLE_VARIATION_FONTS = ENABLE_VARIATION_FONTS;
 
 ENABLE_VIDEO = ENABLE_VIDEO;
 
-ENABLE_VIDEO_PRESENTATION_MODE = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE = $(ENABLE_VIDEO_PRESENTATION_MODE_$(WK_PLATFORM_NAME));
+ENABLE_VIDEO_PRESENTATION_MODE_iphoneos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_watchos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx = ENABLE_VIDEO_PRESENTATION_MODE;
 
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 
index 726851d..06a1fff 100644 (file)
@@ -1,3 +1,12 @@
+2020-04-20  Peng Liu  <peng.liu6@apple.com>
+
+        Fix build failures when video fullscreen and picture-in-picture is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=210777
+
+        Reviewed by Eric Carlson.
+
+        * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
+
 2020-04-20  Alex Christensen  <achristensen@webkit.org>
 
         SPI clients using fastServerTrustEvaluationEnabled need SPI to inform them of modern TLS negotiation
index a74b4a6..50318a4 100644 (file)
@@ -372,7 +372,10 @@ ENABLE_VARIATION_FONTS = ENABLE_VARIATION_FONTS;
 
 ENABLE_VIDEO = ENABLE_VIDEO;
 
-ENABLE_VIDEO_PRESENTATION_MODE = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE = $(ENABLE_VIDEO_PRESENTATION_MODE_$(WK_PLATFORM_NAME));
+ENABLE_VIDEO_PRESENTATION_MODE_iphoneos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_watchos = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx = ENABLE_VIDEO_PRESENTATION_MODE;
 
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;