Title: [208833] trunk/Source/WebCore
Revision
208833
Author
[email protected]
Date
2016-11-16 17:26:33 -0800 (Wed, 16 Nov 2016)

Log Message

Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
https://bugs.webkit.org/show_bug.cgi?id=164845

Reviewed by Wenson Hsieh.

Fix builds after r208802 by wrapping code inside USE(APPLE_INTERNAL_SDK).

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208832 => 208833)


--- trunk/Source/WebCore/ChangeLog	2016-11-17 01:15:43 UTC (rev 208832)
+++ trunk/Source/WebCore/ChangeLog	2016-11-17 01:26:33 UTC (rev 208833)
@@ -1,3 +1,20 @@
+2016-11-16  Ryosuke Niwa  <[email protected]>
+
+        Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=164845
+
+        Reviewed by Wenson Hsieh.
+
+        Fix builds after r208802 by wrapping code inside USE(APPLE_INTERNAL_SDK).
+
+        * platform/mac/WebPlaybackControlsManager.h:
+        * platform/mac/WebPlaybackControlsManager.mm:
+        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
+        (WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
+        (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
+        (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
+        (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
+
 2016-11-16  Chris Dumez  <[email protected]>
 
         ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary

Modified: trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.h (208832 => 208833)


--- trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.h	2016-11-17 01:15:43 UTC (rev 208832)
+++ trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.h	2016-11-17 01:26:33 UTC (rev 208833)
@@ -46,11 +46,12 @@
     RetainPtr<NSArray> _seekableTimeRanges;
     BOOL _hasEnabledAudio;
     BOOL _hasEnabledVideo;
+#if USE(APPLE_INTERNAL_SDK)
     RetainPtr<NSArray<AVFunctionBarMediaSelectionOption *>> _audioFunctionBarMediaSelectionOptions;
     RetainPtr<AVFunctionBarMediaSelectionOption> _currentAudioFunctionBarMediaSelectionOption;
     RetainPtr<NSArray<AVFunctionBarMediaSelectionOption *>> _legibleFunctionBarMediaSelectionOptions;
     RetainPtr<AVFunctionBarMediaSelectionOption> _currentLegibleFunctionBarMediaSelectionOption;
-
+#endif
     float _rate;
     BOOL _playing;
     BOOL _canTogglePlayback;
@@ -71,6 +72,7 @@
 
 @property (nonatomic) float rate;
 
+#if USE(APPLE_INTERNAL_SDK)
 - (AVFunctionBarMediaSelectionOption *)currentAudioFunctionBarMediaSelectionOption;
 - (void)setCurrentAudioFunctionBarMediaSelectionOption:(AVFunctionBarMediaSelectionOption *)option;
 - (AVFunctionBarMediaSelectionOption *)currentLegibleFunctionBarMediaSelectionOption;
@@ -77,6 +79,7 @@
 - (void)setCurrentLegibleFunctionBarMediaSelectionOption:(AVFunctionBarMediaSelectionOption *)option;
 - (void)setAudioMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;
 - (void)setLegibleMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;
+#endif
 @end
 
 #endif // ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)

Modified: trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm (208832 => 208833)


--- trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm	2016-11-17 01:15:43 UTC (rev 208832)
+++ trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm	2016-11-17 01:26:33 UTC (rev 208833)
@@ -90,6 +90,7 @@
 {
 }
 
+#if USE(APPLE_INTERNAL_SDK)
 - (void)generateFunctionBarThumbnailsForTimes:(NSArray<NSNumber *> *)thumbnailTimes size:(NSSize)size completionHandler:(void (^)(NSArray<AVThumbnail *> *thumbnails, NSError *error))completionHandler
 {
     UNUSED_PARAM(thumbnailTimes);
@@ -102,6 +103,7 @@
     UNUSED_PARAM(numberOfSamples);
     completionHandler(@[ ], nil);
 }
+#endif
 
 -(BOOL)canBeginFunctionBarScrubbing
 {
@@ -121,6 +123,7 @@
     _webPlaybackSessionInterfaceMac->endScrubbing();
 }
 
+#if USE(APPLE_INTERNAL_SDK)
 - (NSArray<AVFunctionBarMediaSelectionOption *> *)audioFunctionBarMediaSelectionOptions
 {
     return _audioFunctionBarMediaSelectionOptions.get();
@@ -206,7 +209,7 @@
     if (selectedIndex < [webOptions count])
         [self setCurrentLegibleFunctionBarMediaSelectionOption:[webOptions objectAtIndex:selectedIndex]];
 }
-
+#endif
 - (WebCore::WebPlaybackSessionInterfaceMac*)webPlaybackSessionInterfaceMac
 {
     return _webPlaybackSessionInterfaceMac.get();

Modified: trunk/Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm (208832 => 208833)


--- trunk/Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm	2016-11-17 01:15:43 UTC (rev 208832)
+++ trunk/Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm	2016-11-17 01:26:33 UTC (rev 208833)
@@ -131,7 +131,7 @@
 
 void WebPlaybackSessionInterfaceMac::seekableRangesChanged(const TimeRanges& timeRanges)
 {
-#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
+#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) && USE(APPLE_INTERNAL_SDK)
     [playBackControlsManager() setSeekableTimeRanges:timeRangesToArray(timeRanges).get()];
 #else
     UNUSED_PARAM(timeRanges);
@@ -140,7 +140,7 @@
 
 void WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged(const Vector<WTF::String>& options, uint64_t selectedIndex)
 {
-#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
+#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) && USE(APPLE_INTERNAL_SDK)
     [playBackControlsManager() setAudioMediaSelectionOptions:options withSelectedIndex:static_cast<NSUInteger>(selectedIndex)];
 #else
     UNUSED_PARAM(options);
@@ -150,7 +150,7 @@
 
 void WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged(const Vector<WTF::String>& options, uint64_t selectedIndex)
 {
-#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
+#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) && USE(APPLE_INTERNAL_SDK)
     [playBackControlsManager() setLegibleMediaSelectionOptions:options withSelectedIndex:static_cast<NSUInteger>(selectedIndex)];
 #else
     UNUSED_PARAM(options);
@@ -198,8 +198,10 @@
     manager.seekableTimeRanges = timeRangesToArray(m_playbackSessionModel->seekableRanges()).get();
     manager.canTogglePlayback = YES;
     manager.playing = m_playbackSessionModel->isPlaying();
+#if USE(APPLE_INTERNAL_SDK)
     [manager setAudioMediaSelectionOptions:m_playbackSessionModel->audioMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->audioMediaSelectedIndex())];
     [manager setLegibleMediaSelectionOptions:m_playbackSessionModel->legibleMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->legibleMediaSelectedIndex())];
+#endif
 }
 
 void WebPlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming(double currentTime, double anchorTime, double playbackRate, bool isPlaying)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to