Changeset 195068 in webkit
- Timestamp:
- Jan 14, 2016 11:19:34 AM (8 years ago)
- Location:
- branches/safari-601-branch
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-601-branch/LayoutTests/ChangeLog
r195067 r195068 1 2016-01-14 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r194672. rdar://problem/24154288 4 5 2016-01-06 Eric Carlson <eric.carlson@apple.com> 6 7 AirPlay route availability event not always sent 8 https://bugs.webkit.org/show_bug.cgi?id=152802 9 10 Reviewed by Jer Noble. 11 12 * media/airplay-target-availability-expected.txt: Added. 13 * media/airplay-target-availability.html: Added. 14 * platform/mac/TestExpectations: Skip new test on Yosemite. 15 * platform/efl/TestExpectations: Skip new test. 16 * platform/gtk/TestExpectations: Ditto. 17 * platform/win/TestExpectations: Ditto. 18 1 19 2016-01-14 Matthew Hanson <matthew_hanson@apple.com> 2 20 -
branches/safari-601-branch/LayoutTests/platform/efl/TestExpectations
r193578 r195068 2302 2302 # This test uses an MPEG-4 video 2303 2303 media/video-seek-to-current-time.html [ Skip ] 2304 2305 # WIRELESS_PLAYBACK_TARGET not enabled. 2306 media/airplay-target-availability.html -
branches/safari-601-branch/LayoutTests/platform/gtk/TestExpectations
r188393 r195068 2404 2404 # This test uses an MPEG-4 video 2405 2405 media/video-seek-to-current-time.html [ Skip ] 2406 2407 # WIRELESS_PLAYBACK_TARGET not enabled. 2408 media/airplay-target-availability.html -
branches/safari-601-branch/LayoutTests/platform/mac/TestExpectations
r195067 r195068 1382 1382 [ Yosemite ElCapitan ] css3/font-variant-small-caps-synthesis-coverage.html [ ImageOnlyFailure ] 1383 1383 [ Yosemite ElCapitan ] css3/font-variant-petite-caps-synthesis-coverage.html [ ImageOnlyFailure ] 1384 1385 # WIRELESS_PLAYBACK_TARGET not enabled on Yosemite. 1386 [ Yosemite ] media/airplay-target-availability.html -
branches/safari-601-branch/LayoutTests/platform/win/TestExpectations
r194288 r195068 3141 3141 # This test uses an MPEG-4 video 3142 3142 media/video-seek-to-current-time.html [ Skip ] 3143 3144 # WIRELESS_PLAYBACK_TARGET not enabled. 3145 media/airplay-target-availability.html -
branches/safari-601-branch/Source/WebCore/ChangeLog
r195067 r195068 1 2016-01-14 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r194672. rdar://problem/24154288 4 5 2016-01-06 Eric Carlson <eric.carlson@apple.com> 6 7 AirPlay route availability event not always sent 8 https://bugs.webkit.org/show_bug.cgi?id=152802 9 10 Reviewed by Jer Noble. 11 12 Test: media/airplay-target-availability.html 13 14 * Modules/mediasession/WebMediaSessionManager.cpp: 15 (WebCore::mediaProducerStateString): Log the new flags. 16 (WebCore::WebMediaSessionManager::clientStateDidChange): Schedule a client reconfiguration if 17 the 'requires monitoring', 'has listener', or 'has audio or video' flags have changed. 18 (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): Start monitoring if 19 at least one client has a listener and at least one has audio/video. 20 21 * html/HTMLMediaElement.cpp: 22 (WebCore::HTMLMediaElement::mediaState): Set new flags. 23 * html/HTMLMediaElement.h: 24 25 * page/MediaProducer.h: Define new flags. Add new state enum. 26 27 * platform/graphics/MediaPlaybackTargetContext.h: Initial state is "Unknown". 28 29 * platform/mock/MediaPlaybackTargetMock.h: 30 * platform/mock/MediaPlaybackTargetPickerMock.cpp: 31 (WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable): Enums not bitfields. 32 (WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets): Ditto. Don't make 33 device change callback if the device state is "Unknown". 34 (WebCore::MediaPlaybackTargetPickerMock::setState): Ditto. 35 * platform/mock/MediaPlaybackTargetPickerMock.h: 36 37 * testing/Internals.cpp: 38 (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Support new state. 39 1 40 2016-01-14 Matthew Hanson <matthew_hanson@apple.com> 2 41 -
branches/safari-601-branch/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
r195067 r195068 75 75 if (flags & MediaProducer::IsPlayingToExternalDevice) 76 76 string.append("IsPlayingToExternalDevice + "); 77 if (flags & MediaProducer::HasPlaybackTargetAvailabilityListener) 78 string.append("HasPlaybackTargetAvailabilityListener + "); 77 79 if (flags & MediaProducer::RequiresPlaybackTargetMonitoring) 78 80 string.append("RequiresPlaybackTargetMonitoring + "); … … 81 83 if (flags & MediaProducer::DidPlayToEnd) 82 84 string.append("DidPlayToEnd + "); 85 if (flags & MediaProducer::HasAudioOrVideo) 86 string.append("HasAudioOrVideo + "); 83 87 if (string.isEmpty()) 84 88 string.append("IsNotPlaying"); … … 210 214 211 215 changedClientState->flags = newFlags; 212 if (!flagsAreSet(oldFlags, MediaProducer::RequiresPlaybackTargetMonitoring) && flagsAreSet(newFlags, MediaProducer::RequiresPlaybackTargetMonitoring)) 216 217 MediaProducer::MediaStateFlags updateConfigurationFlags = MediaProducer::RequiresPlaybackTargetMonitoring | MediaProducer::HasPlaybackTargetAvailabilityListener | MediaProducer::HasAudioOrVideo; 218 if (!flagsAreSet(oldFlags, updateConfigurationFlags) && flagsAreSet(newFlags, updateConfigurationFlags)) 213 219 scheduleDelayedTask(TargetMonitoringConfigurationTask); 214 220 … … 232 238 } 233 239 234 // Do not takebegin playing to the device unless playback has just started.240 // Do not begin playing to the device unless playback has just started. 235 241 if (!flagsAreSet(newFlags, MediaProducer::IsPlayingVideo) || flagsAreSet(oldFlags, MediaProducer::IsPlayingVideo)) 236 242 return; … … 340 346 { 341 347 bool monitoringRequired = false; 348 bool hasAvailabilityListener = false; 349 bool haveClientWithMedia = false; 342 350 for (auto& state : m_clientState) { 343 351 if (state->flags & MediaProducer::RequiresPlaybackTargetMonitoring) { … … 345 353 break; 346 354 } 355 if (state->flags & MediaProducer::HasPlaybackTargetAvailabilityListener) 356 hasAvailabilityListener = true; 357 if (state->flags & MediaProducer::HasAudioOrVideo) 358 haveClientWithMedia = true; 347 359 } 348 360 349 361 LOG(Media, "WebMediaSessionManager::configurePlaybackTargetMonitoring - monitoringRequired = %i", (int)monitoringRequired); 350 362 351 if (monitoringRequired )363 if (monitoringRequired || (hasAvailabilityListener && haveClientWithMedia)) 352 364 targetPicker().startingMonitoringPlaybackTargets(); 353 365 else -
branches/safari-601-branch/Source/WebCore/html/HTMLMediaElement.cpp
r188424 r195068 6435 6435 MediaProducer::MediaStateFlags HTMLMediaElement::mediaState() const 6436 6436 { 6437 6438 6437 MediaStateFlags state = IsNotPlaying; 6439 6438 … … 6444 6443 state |= IsPlayingToExternalDevice; 6445 6444 6446 if (m_player && m_hasPlaybackTargetAvailabilityListeners && !m_mediaSession->wirelessVideoPlaybackDisabled(*this)) 6447 state |= RequiresPlaybackTargetMonitoring; 6445 if (m_hasPlaybackTargetAvailabilityListeners) { 6446 state |= HasPlaybackTargetAvailabilityListener; 6447 if (!m_mediaSession->wirelessVideoPlaybackDisabled(*this)) 6448 state |= RequiresPlaybackTargetMonitoring; 6449 } 6448 6450 6449 6451 bool requireUserGesture = m_mediaSession->hasBehaviorRestriction(MediaElementSession::RequireUserGestureToAutoplayToExternalDevice); 6450 6452 if (m_readyState >= HAVE_METADATA && !requireUserGesture && !m_failedToPlayToWirelessTarget) 6451 6453 state |= ExternalDeviceAutoPlayCandidate; 6454 6455 if (hasActiveVideo || hasAudio) 6456 state |= HasAudioOrVideo; 6452 6457 6453 6458 if (hasActiveVideo && endedPlayback()) -
branches/safari-601-branch/Source/WebCore/html/HTMLMediaElement.h
r188393 r195068 746 746 }; 747 747 void updateMediaState(UpdateMediaState updateState = UpdateMediaState::Synchronously); 748 bool hasPlaybackTargetAvailabilityListeners() const { return m_hasPlaybackTargetAvailabilityListeners; } 748 749 #endif 749 750 -
branches/safari-601-branch/Source/WebCore/page/MediaProducer.h
r186361 r195068 39 39 ExternalDeviceAutoPlayCandidate = 1 << 4, 40 40 DidPlayToEnd = 1 << 5, 41 HasPlaybackTargetAvailabilityListener = 1 << 9, 42 HasAudioOrVideo = 1 << 10, 41 43 }; 42 44 typedef unsigned MediaStateFlags; -
branches/safari-601-branch/Source/WebCore/platform/graphics/MediaPlaybackTargetContext.h
r195067 r195068 49 49 50 50 enum ContextState { 51 Unavailable = 0, 52 OutputDeviceAvailable = 1 << 0, 51 Unknown = 0, 52 OutputDeviceUnavailable = 1, 53 OutputDeviceAvailable = 2, 53 54 }; 54 55 typedef unsigned State; … … 98 99 AVOutputContext *m_outputContext { nullptr }; 99 100 String m_name; 100 State m_state { Un available};101 State m_state { Unknown }; 101 102 }; 102 103 -
branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetMock.h
r195067 r195068 56 56 57 57 String m_name; 58 MediaPlaybackTargetContext::State m_state { MediaPlaybackTargetContext::Un available};58 MediaPlaybackTargetContext::State m_state { MediaPlaybackTargetContext::Unknown }; 59 59 mutable MediaPlaybackTargetContext m_context; 60 60 }; -
branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp
r195067 r195068 61 61 { 62 62 LOG(Media, "MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable"); 63 return m_state &MediaPlaybackTargetContext::OutputDeviceAvailable;63 return m_state == MediaPlaybackTargetContext::OutputDeviceAvailable; 64 64 } 65 65 … … 91 91 LOG(Media, "MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets"); 92 92 93 if (m_state &MediaPlaybackTargetContext::OutputDeviceAvailable)93 if (m_state == MediaPlaybackTargetContext::OutputDeviceAvailable) 94 94 availableDevicesDidChange(); 95 95 96 if (!m_deviceName.isEmpty() )96 if (!m_deviceName.isEmpty() && m_state != MediaPlaybackTargetContext::Unknown) 97 97 currentDeviceDidChange(); 98 98 } … … 106 106 { 107 107 LOG(Media, "MediaPlaybackTargetPickerMock::invalidatePlaybackTargets"); 108 setState( WTF::emptyString(), MediaPlaybackTargetContext::Unavailable);108 setState(emptyString(), MediaPlaybackTargetContext::Unknown); 109 109 } 110 110 … … 113 113 LOG(Media, "MediaPlaybackTargetPickerMock::setState - name = %s, state = 0x%x", deviceName.utf8().data(), (unsigned)state); 114 114 115 if (deviceName != m_deviceName ) {115 if (deviceName != m_deviceName && state != MediaPlaybackTargetContext::Unknown) { 116 116 m_deviceName = deviceName; 117 117 currentDeviceDidChange(); -
branches/safari-601-branch/Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h
r195067 r195068 59 59 String m_deviceName; 60 60 RunLoop::Timer<MediaPlaybackTargetPickerMock> m_timer; 61 MediaPlaybackTargetContext::State m_state { MediaPlaybackTargetContext::Un available};61 MediaPlaybackTargetContext::State m_state { MediaPlaybackTargetContext::Unknown }; 62 62 bool m_showingMenu { false }; 63 63 }; -
branches/safari-601-branch/Source/WebCore/testing/Internals.cpp
r195067 r195068 2819 2819 ASSERT(page); 2820 2820 2821 MediaPlaybackTargetContext::State state = MediaPlaybackTargetContext::Un available;2821 MediaPlaybackTargetContext::State state = MediaPlaybackTargetContext::Unknown; 2822 2822 2823 2823 if (equalIgnoringCase(deviceState, "DeviceAvailable")) 2824 2824 state = MediaPlaybackTargetContext::OutputDeviceAvailable; 2825 else if (equalIgnoringCase(deviceState, "DeviceUnavailable")) 2826 state = MediaPlaybackTargetContext::OutputDeviceUnavailable; 2827 else if (equalIgnoringCase(deviceState, "Unknown")) 2828 state = MediaPlaybackTargetContext::Unknown; 2825 2829 else { 2826 2830 ec = INVALID_ACCESS_ERR;
Note: See TracChangeset
for help on using the changeset viewer.