Title: [195412] trunk/Source
Revision
195412
Author
adac...@apple.com
Date
2016-01-21 10:25:02 -0800 (Thu, 21 Jan 2016)

Log Message

Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
https://bugs.webkit.org/show_bug.cgi?id=153218

Reviewed by Eric Carlson.

Source/_javascript_Core:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests. Code refactoring.

* Configurations/FeatureDefines.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
Move WebVideoFullscreenInterface.h from ios to cocoa.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
The declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
so include that header instead. Guard the supportsPictureInPicture() call with PLATFORM(COCOA)
as that method is only defined in Cocoa.
* platform/cocoa/WebVideoFullscreenInterface.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterface.h.
Also move the declaration of supportsPictureInPicture() here.
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
Implementations of methods related to the video fullscreen layer are now guarded by
PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) instead.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
Declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
* platform/mac/WebVideoFullscreenInterfaceMac.mm: Added.
(WebCore::supportsPictureInPicture):
Return false for now.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/Platform.h:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (195411 => 195412)


--- trunk/Source/_javascript_Core/ChangeLog	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adac...@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2016-01-21  Per Arne Vollan  <pe...@outlook.com>
 
         [B3][CMake] Add missing source file.

Modified: trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig (195411 => 195412)


--- trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2016-01-21 18:25:02 UTC (rev 195412)
@@ -170,6 +170,10 @@
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;

Modified: trunk/Source/WTF/ChangeLog (195411 => 195412)


--- trunk/Source/WTF/ChangeLog	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WTF/ChangeLog	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adac...@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * wtf/Platform.h:
+
 2016-01-19  Filip Pizlo  <fpi...@apple.com>
 
         B3 should have basic path specialization

Modified: trunk/Source/WTF/wtf/Platform.h (195411 => 195412)


--- trunk/Source/WTF/wtf/Platform.h	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WTF/wtf/Platform.h	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1136,7 +1136,7 @@
 #define USE_MEDIATOOLBOX 1
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
 #define ENABLE_VIDEO_PRESENTATION_MODE 1
 #endif
 

Modified: trunk/Source/WebCore/ChangeLog (195411 => 195412)


--- trunk/Source/WebCore/ChangeLog	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/ChangeLog	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1,3 +1,33 @@
+2016-01-19  Ada Chan  <adac...@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        No new tests. Code refactoring.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * WebCore.xcodeproj/project.pbxproj:
+        Move WebVideoFullscreenInterface.h from ios to cocoa.
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
+        The declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
+        so include that header instead. Guard the supportsPictureInPicture() call with PLATFORM(COCOA)
+        as that method is only defined in Cocoa.
+        * platform/cocoa/WebVideoFullscreenInterface.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterface.h.
+        Also move the declaration of supportsPictureInPicture() here.
+        * platform/graphics/MediaPlayer.cpp:
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        Implementations of methods related to the video fullscreen layer are now guarded by
+        PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) instead.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
+        Declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
+        * platform/mac/WebVideoFullscreenInterfaceMac.mm: Added.
+        (WebCore::supportsPictureInPicture):
+        Return false for now.
+
 2016-01-21  Said Abou-Hallawa  <sabouhall...@apple.com>
 
         A crash reproducible in Path::isEmpty() under RenderSVGShape::paint()

Modified: trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig (195411 => 195412)


--- trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2016-01-21 18:25:02 UTC (rev 195412)
@@ -170,6 +170,10 @@
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (195411 => 195412)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1470,7 +1470,6 @@
 		3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		3F42B31E1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */; };
 		3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		3FBC4AEC1898810E0046EE38 /* WebVideoFullscreenInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */; };
 		3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */; };
@@ -2253,6 +2252,8 @@
 		51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB5503113E3E9100821176 /* JSCloseEvent.cpp */; };
 		51FB67DB1AE6B82B00D06C5A /* ContentExtensionStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */; };
 		51FB67DC1AE6B82F00D06C5A /* ContentExtensionStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		52131E591C4F15350033F802 /* WebVideoFullscreenInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		52131E5B1C4F15760033F802 /* WebVideoFullscreenInterfaceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */; };
 		521D46F611AEC98100514613 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 521D46F511AEC98100514613 /* KillRingMac.mm */; };
 		521D46F811AEC9B100514613 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 521D46F711AEC9B100514613 /* KillRing.h */; };
 		52B6C9C215E3F4DF00690B05 /* DOMNamedFlowCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */; };
@@ -8845,7 +8846,6 @@
 		3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenControllerAVKit.h; sourceTree = "<group>"; };
 		3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenControllerAVKit.mm; sourceTree = "<group>"; };
 		3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenModel.h; sourceTree = "<group>"; };
-		3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterface.h; sourceTree = "<group>"; };
 		3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenInterfaceAVKit.mm; sourceTree = "<group>"; };
 		3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterfaceAVKit.h; sourceTree = "<group>"; };
 		3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSViewportRule.cpp; sourceTree = "<group>"; };
@@ -9716,6 +9716,8 @@
 		51FB5503113E3E9100821176 /* JSCloseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCloseEvent.cpp; sourceTree = "<group>"; };
 		51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionStyleSheet.cpp; sourceTree = "<group>"; };
 		51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionStyleSheet.h; sourceTree = "<group>"; };
+		52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterface.h; sourceTree = "<group>"; };
+		52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenInterfaceMac.mm; sourceTree = "<group>"; };
 		521D46F511AEC98100514613 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = "<group>"; };
 		521D46F711AEC9B100514613 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
 		52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMNamedFlowCollection.cpp; sourceTree = "<group>"; };
@@ -17640,6 +17642,7 @@
 				CD8203071395AB6A00F956C6 /* WebVideoFullscreenController.mm */,
 				CD8203081395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h */,
 				CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */,
+				52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */,
 				CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */,
 				CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */,
 				9380F47709A11ACC001FDB34 /* WidgetMac.mm */,
@@ -19711,7 +19714,6 @@
 				C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */,
 				3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */,
 				3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */,
-				3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */,
 				3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */,
 				3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */,
 				3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */,
@@ -19752,6 +19754,7 @@
 				46DB7D561B20FE3C005651B2 /* VNodeTrackerCocoa.cpp */,
 				CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */,
 				CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */,
+				52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */,
 			);
 			path = cocoa;
 			sourceTree = "<group>";
@@ -28161,7 +28164,7 @@
 				CD82030A1395AB6A00F956C6 /* WebVideoFullscreenController.h in Headers */,
 				3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */,
 				CD82030C1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h in Headers */,
-				3FBC4AEC1898810E0046EE38 /* WebVideoFullscreenInterface.h in Headers */,
+				52131E591C4F15350033F802 /* WebVideoFullscreenInterface.h in Headers */,
 				3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */,
 				3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */,
 				65FD466519B596F0001E2B4D /* WebVideoFullscreenModelVideoElement.h in Headers */,
@@ -31572,6 +31575,7 @@
 				3F42B31E1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm in Sources */,
 				CD82030D1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm in Sources */,
 				3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */,
+				52131E5B1C4F15760033F802 /* WebVideoFullscreenInterfaceMac.mm in Sources */,
 				65FD466619B596F6001E2B4D /* WebVideoFullscreenModelVideoElement.mm in Sources */,
 				F12171F516A8CED2000053CA /* WebVTTElement.cpp in Sources */,
 				5D21A80213ECE5DF00BB7064 /* WebVTTParser.cpp in Sources */,

Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (195411 => 195412)


--- trunk/Source/WebCore/html/HTMLVideoElement.cpp	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp	2016-01-21 18:25:02 UTC (rev 195412)
@@ -45,7 +45,7 @@
 #include <wtf/NeverDestroyed.h>
 
 #if ENABLE(VIDEO_PRESENTATION_MODE)
-#include "WebVideoFullscreenInterfaceAVKit.h"
+#include "WebVideoFullscreenInterface.h"
 #endif
 
 namespace WebCore {
@@ -373,9 +373,15 @@
     if (mode == presentationModeFullscreen())
         return mediaSession().fullscreenPermitted(*this) && supportsFullscreen();
 
-    if (mode == presentationModePictureInPicture())
-        return supportsPictureInPicture() && mediaSession().allowsPictureInPicture(*this) && supportsFullscreen();
+    if (mode == presentationModePictureInPicture()) {
+#if PLATFORM(COCOA)
+        if (!supportsPictureInPicture())
+            return false;
+#endif
 
+        return mediaSession().allowsPictureInPicture(*this) && supportsFullscreen();
+    }
+
     if (mode == presentationModeInline())
         return !mediaSession().requiresFullscreenForVideoPlayback(*this);
 

Copied: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h (from rev 195411, trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h) (0 => 195412)


--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h	2016-01-21 18:25:02 UTC (rev 195412)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebVideoFullscreenInterface_h
+#define WebVideoFullscreenInterface_h
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+
+#include <wtf/Vector.h>
+
+namespace WTF {
+class String;
+}
+
+namespace WebCore {
+
+bool supportsPictureInPicture();
+
+#if PLATFORM(IOS)
+class TimeRanges;
+
+class WebVideoFullscreenInterface {
+public:
+    enum ExternalPlaybackTargetType { TargetTypeNone, TargetTypeAirPlay, TargetTypeTVOut };
+    
+    virtual ~WebVideoFullscreenInterface() { };
+    virtual void resetMediaState() = 0;
+    virtual void setDuration(double) = 0;
+    virtual void setCurrentTime(double currentTime, double anchorTime) = 0;
+    virtual void setBufferedTime(double) = 0;
+    virtual void setRate(bool isPlaying, float playbackRate) = 0;
+    virtual void setVideoDimensions(bool hasVideo, float width, float height) = 0;
+    virtual void setSeekableRanges(const TimeRanges&) = 0;
+    virtual void setCanPlayFastReverse(bool) = 0;
+    virtual void setAudioMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) = 0;
+    virtual void setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) = 0;
+    virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) = 0;
+    virtual void setWirelessVideoPlaybackDisabled(bool) = 0;
+};
+#endif
+
+}
+
+#endif
+#endif

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (195411 => 195412)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2016-01-21 18:25:02 UTC (rev 195412)
@@ -643,7 +643,7 @@
     return m_private->platformLayer();
 }
     
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 void MediaPlayer::setVideoFullscreenLayer(PlatformLayer* layer)
 {
     m_private->setVideoFullscreenLayer(layer);
@@ -668,7 +668,9 @@
 {
     return m_client.mediaPlayerFullscreenMode();
 }
+#endif
 
+#if PLATFORM(IOS)
 NSArray* MediaPlayer::timedMetadata() const
 {
     return m_private->timedMetadata();

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (195411 => 195412)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2016-01-21 18:25:02 UTC (rev 195412)
@@ -308,14 +308,17 @@
     bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const;
     PlatformMedia platformMedia() const;
     PlatformLayer* platformLayer() const;
-#if PLATFORM(IOS)
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     void setVideoFullscreenLayer(PlatformLayer*);
     void setVideoFullscreenFrame(FloatRect);
     using MediaPlayerEnums::VideoGravity;
     void setVideoFullscreenGravity(VideoGravity);
     void setVideoFullscreenMode(VideoFullscreenMode);
     VideoFullscreenMode fullscreenMode() const;
+#endif
 
+#if PLATFORM(IOS)
     NSArray *timedMetadata() const;
     String accessLog() const;
     String errorLog() const;

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (195411 => 195412)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2016-01-21 18:25:02 UTC (rev 195412)
@@ -57,12 +57,15 @@
     virtual void prepareToPlay() { }
     virtual PlatformMedia platformMedia() const { return NoPlatformMedia; }
     virtual PlatformLayer* platformLayer() const { return 0; }
-#if PLATFORM(IOS)
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     virtual void setVideoFullscreenLayer(PlatformLayer*) { }
     virtual void setVideoFullscreenFrame(FloatRect) { }
     virtual void setVideoFullscreenGravity(MediaPlayer::VideoGravity) { }
     virtual void setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode) { }
+#endif
 
+#if PLATFORM(IOS)
     virtual NSArray *timedMetadata() const { return 0; }
     virtual String accessLog() const { return emptyString(); }
     virtual String errorLog() const { return emptyString(); }

Deleted: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h (195411 => 195412)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef WebVideoFullscreenInterface_h
-#define WebVideoFullscreenInterface_h
-
-#if PLATFORM(IOS)
-
-#include <wtf/Vector.h>
-
-namespace WTF {
-class String;
-}
-
-namespace WebCore {
-    
-class TimeRanges;
-
-class WebVideoFullscreenInterface {
-public:
-    enum ExternalPlaybackTargetType { TargetTypeNone, TargetTypeAirPlay, TargetTypeTVOut };
-    
-    virtual ~WebVideoFullscreenInterface() { };
-    virtual void resetMediaState() = 0;
-    virtual void setDuration(double) = 0;
-    virtual void setCurrentTime(double currentTime, double anchorTime) = 0;
-    virtual void setBufferedTime(double bufferedTime) = 0;
-    virtual void setRate(bool isPlaying, float playbackRate) = 0;
-    virtual void setVideoDimensions(bool hasVideo, float width, float height) = 0;
-    virtual void setSeekableRanges(const TimeRanges&) = 0;
-    virtual void setCanPlayFastReverse(bool) = 0;
-    virtual void setAudioMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) = 0;
-    virtual void setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) = 0;
-    virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) = 0;
-    virtual void setWirelessVideoPlaybackDisabled(bool) = 0;
-};
-
-}
-
-#endif
-#endif

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (195411 => 195412)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2016-01-21 18:25:02 UTC (rev 195412)
@@ -161,8 +161,6 @@
     void doEnterFullscreen();
 };
 
-bool supportsPictureInPicture();
-
 }
 
 #endif

Added: trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm (0 => 195412)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm	                        (rev 0)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm	2016-01-21 18:25:02 UTC (rev 195412)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WebVideoFullscreenInterface.h"
+
+#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+
+bool WebCore::supportsPictureInPicture()
+{
+    return false;
+}
+
+#endif

Modified: trunk/Source/WebKit/mac/ChangeLog (195411 => 195412)


--- trunk/Source/WebKit/mac/ChangeLog	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adac...@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2016-01-19  Beth Dakin  <bda...@apple.com>
 
         32-bit build fix.

Modified: trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig (195411 => 195412)


--- trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig	2016-01-21 18:25:02 UTC (rev 195412)
@@ -170,6 +170,10 @@
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;

Modified: trunk/Source/WebKit2/ChangeLog (195411 => 195412)


--- trunk/Source/WebKit2/ChangeLog	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebKit2/ChangeLog	2016-01-21 18:25:02 UTC (rev 195412)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adac...@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2016-01-20  Alex Christensen  <achristen...@webkit.org>
 
         Fix CMake build after r195300.

Modified: trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig (195411 => 195412)


--- trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig	2016-01-21 17:50:26 UTC (rev 195411)
+++ trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig	2016-01-21 18:25:02 UTC (rev 195412)
@@ -170,6 +170,10 @@
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to