Title: [187055] branches/safari-601.1-branch/Source/WebCore

Diff

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187054 => 187055)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-21 02:00:56 UTC (rev 187054)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-21 04:36:27 UTC (rev 187055)
@@ -1,3 +1,32 @@
+2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r186854. rdar://problem/21840147
+
+    2015-07-15  Eric Carlson  <eric.carl...@apple.com>
+
+            [Mac] AirPlay route is not always set automatically
+            https://bugs.webkit.org/show_bug.cgi?id=146969
+
+            Reviewed by Jer Noble.
+
+            * Modules/mediasession/WebMediaSessionManager.cpp:
+            (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Return early if there are
+              no clients. Make the first client in the vector automatically play to the target if there
+              is no other match and there is an active route.
+            (WebCore::WebMediaSessionManager::watchdogTimerFired): Call picker.invalidatePlaybackTargets,
+              not stopMonitoringPlaybackTargets.
+
+            * platform/graphics/MediaPlaybackTargetPicker.cpp:
+            (WebCore::MediaPlaybackTargetPicker::invalidatePlaybackTargets): New.
+            * platform/graphics/MediaPlaybackTargetPicker.h:
+
+            * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
+            * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
+            (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Do nothing, AirPlay
+              automatically stops monitoring when appropriate and release the picker also releases
+              the output context, which drops the route.
+            (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): New.
+
 2015-07-16  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r186799. rdar://problem/20542574

Modified: branches/safari-601.1-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp (187054 => 187055)


--- branches/safari-601.1-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp	2015-07-21 02:00:56 UTC (rev 187054)
+++ branches/safari-601.1-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp	2015-07-21 04:36:27 UTC (rev 187055)
@@ -245,6 +245,9 @@
 
 void WebMediaSessionManager::configurePlaybackTargetClients()
 {
+    if (m_clientState.isEmpty())
+        return;
+
     size_t indexOfClientThatRequestedPicker = notFound;
     size_t indexOfLastClientToRequestPicker = notFound;
     size_t indexOfClientWillPlayToTarget = notFound;
@@ -269,6 +272,8 @@
         indexOfClientWillPlayToTarget = indexOfClientThatRequestedPicker;
     if (indexOfClientWillPlayToTarget == notFound && indexOfLastClientToRequestPicker != notFound)
         indexOfClientWillPlayToTarget = indexOfLastClientToRequestPicker;
+    if (indexOfClientWillPlayToTarget == notFound && haveActiveRoute)
+        indexOfClientWillPlayToTarget = 0;
 
     LOG(Media, "WebMediaSessionManager::configurePlaybackTargetClients - indexOfClientWillPlayToTarget = %zu", indexOfClientWillPlayToTarget);
 
@@ -288,7 +293,6 @@
 
     if (haveActiveRoute && indexOfClientWillPlayToTarget != notFound) {
         auto& state = m_clientState[indexOfClientWillPlayToTarget];
-
         if (!flagsAreSet(state->flags, MediaProducer::IsPlayingToExternalDevice))
             state->client.setShouldPlayToPlaybackTarget(state->contextId, true);
     }
@@ -410,7 +414,7 @@
     if (!m_playbackTarget)
         return;
 
-    targetPicker().stopMonitoringPlaybackTargets();
+    targetPicker().invalidatePlaybackTargets();
 }
 
 } // namespace WebCore

Modified: branches/safari-601.1-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp (187054 => 187055)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp	2015-07-21 02:00:56 UTC (rev 187054)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp	2015-07-21 04:36:27 UTC (rev 187055)
@@ -55,6 +55,11 @@
     ASSERT_NOT_REACHED();
 }
 
+void MediaPlaybackTargetPicker::invalidatePlaybackTargets()
+{
+    ASSERT_NOT_REACHED();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(WIRELESS_PLAYBACK_TARGET)

Modified: branches/safari-601.1-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h (187054 => 187055)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h	2015-07-21 02:00:56 UTC (rev 187054)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h	2015-07-21 04:36:27 UTC (rev 187055)
@@ -53,6 +53,7 @@
     virtual void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute);
     virtual void startingMonitoringPlaybackTargets();
     virtual void stopMonitoringPlaybackTargets();
+    virtual void invalidatePlaybackTargets();
 
 protected:
     explicit MediaPlaybackTargetPicker(Client&);

Modified: branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h (187054 => 187055)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h	2015-07-21 02:00:56 UTC (rev 187054)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h	2015-07-21 04:36:27 UTC (rev 187055)
@@ -44,10 +44,11 @@
 
     WEBCORE_EXPORT static std::unique_ptr<MediaPlaybackTargetPickerMac> create(MediaPlaybackTargetPicker::Client&);
 
-    virtual void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute) override;
-    virtual void startingMonitoringPlaybackTargets() override;
-    virtual void stopMonitoringPlaybackTargets() override;
-    
+    void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute) override;
+    void startingMonitoringPlaybackTargets() override;
+    void stopMonitoringPlaybackTargets() override;
+    void invalidatePlaybackTargets() override;
+
     void availableDevicesDidChange();
     void currentDeviceDidChange();
 

Modified: branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm (187054 => 187055)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm	2015-07-21 02:00:56 UTC (rev 187054)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm	2015-07-21 04:36:27 UTC (rev 187055)
@@ -188,7 +188,13 @@
 void MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets()
 {
     LOG(Media, "MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets");
+    // Nothing to do, AirPlay takes care of this automatically.
+}
 
+void MediaPlaybackTargetPickerMac::invalidatePlaybackTargets()
+{
+    LOG(Media, "MediaPlaybackTargetPickerMac::invalidatePlaybackTargets");
+
     if (m_outputDeviceMenuController) {
         [m_outputDeviceMenuController removeObserver:m_outputDeviceMenuControllerDelegate.get() forKeyPath:externalOutputDeviceAvailableKeyName];
         [m_outputDeviceMenuController removeObserver:m_outputDeviceMenuControllerDelegate.get() forKeyPath:externalOutputDevicePickedKeyName];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to