Changeset 175976 in webkit
- Timestamp:
- Nov 11, 2014, 2:03:15 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
html/HTMLMediaElement.cpp (modified) (3 diffs)
-
platform/audio/ios/MediaSessionManagerIOS.mm (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r175975 r175976 1 2014-11-11 Eric Carlson <eric.carlson@apple.com> 2 3 [iOS] cleanup wireless route monitoring 4 https://bugs.webkit.org/show_bug.cgi?id=138614 5 6 Reviewed by Jer Noble. 7 8 * html/HTMLMediaElement.cpp: 9 (WebCore::HTMLMediaElement::clearMediaPlayer): Add logging. 10 (WebCore::HTMLMediaElement::removeEventListener): Ditto. 11 (WebCore::HTMLMediaElement::createMediaPlayer): Ditto. 12 13 * platform/audio/ios/MediaSessionManagerIOS.mm: 14 (WebCore::MediaSessionManageriOS::resetRestrictions): Add logging. 15 (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Ditto. 16 (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto. 17 (-[WebMediaSessionHelper initWithCallback:]): Ditto. 18 (-[WebMediaSessionHelper dealloc]): Always deallocate volume view and routing controller 19 on the main thread. 20 (-[WebMediaSessionHelper clearCallback]): Add logging. 21 (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Ditto. 22 (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Always call routing controller on 23 the main thread. 24 (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Ditto. 25 (-[WebMediaSessionHelper interruption:]): Add logging. 26 (-[WebMediaSessionHelper applicationWillEnterForeground:]): Ditto. 27 (-[WebMediaSessionHelper applicationDidBecomeActive:]): Ditto. 28 (-[WebMediaSessionHelper applicationWillResignActive:]): Ditto. 29 (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Ditto. 30 1 31 2014-11-11 Myles C. Maxfield <mmaxfield@apple.com> 2 32 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r175777 r175976 4652 4652 void HTMLMediaElement::clearMediaPlayer(int flags) 4653 4653 { 4654 LOG(Media, "HTMLMediaElement::clearMediaPlayer(%p) - flags = %x", this, (unsigned)flags); 4655 4654 4656 #if USE(PLATFORM_TEXT_TRACK_MENU) 4655 4657 if (platformTextTrackMenu()) { … … 4856 4858 4857 4859 bool didRemoveLastAvailabilityChangedListener = !hasEventListeners(eventNames().webkitplaybacktargetavailabilitychangedEvent); 4860 LOG(Media, "HTMLMediaElement::removeEventListener(%p) - removed last listener = %s", this, boolString(didRemoveLastAvailabilityChangedListener)); 4858 4861 if (didRemoveLastAvailabilityChangedListener) 4859 4862 m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false); … … 5358 5361 void HTMLMediaElement::createMediaPlayer() 5359 5362 { 5363 LOG(Media, "HTMLMediaElement::createMediaPlayer(%p)", this); 5364 5360 5365 #if ENABLE(WEB_AUDIO) 5361 5366 if (m_audioSourceNode) -
trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
r175777 r175976 127 127 void MediaSessionManageriOS::resetRestrictions() 128 128 { 129 LOG(Media, "MediaSessionManageriOS::resetRestrictions"); 130 129 131 MediaSessionManager::resetRestrictions(); 130 132 … … 167 169 } 168 170 171 LOG(Media, "MediaSessionManageriOS::configureWireLessTargetMonitoring - requiresMonitoring = %s", requiresMonitoring ? "true" : "false"); 172 169 173 if (requiresMonitoring) 170 174 [m_objcObserver startMonitoringAirPlayRoutes]; … … 188 192 void MediaSessionManageriOS::updateNowPlayingInfo() 189 193 { 194 LOG(Media, "MediaSessionManageriOS::updateNowPlayingInfo"); 195 190 196 MPNowPlayingInfoCenter *nowPlaying = (MPNowPlayingInfoCenter *)[getMPNowPlayingInfoCenterClass() defaultCenter]; 191 197 const MediaSession* currentSession = this->currentSession(); … … 225 231 - (id)initWithCallback:(MediaSessionManageriOS*)callback 226 232 { 233 LOG(Media, "-[WebMediaSessionHelper initWithCallback]"); 234 227 235 if (!(self = [super init])) 228 236 return nil; … … 250 258 - (void)dealloc 251 259 { 260 LOG(Media, "-[WebMediaSessionHelper dealloc]"); 261 262 if (!isMainThread()) { 263 auto volumeView = WTF::move(_volumeView); 264 auto routingController = WTF::move(_airPlayPresenceRoutingController); 265 266 callOnMainThread([volumeView, routingController] () mutable { 267 LOG(Media, "-[WebMediaSessionHelper dealloc] - dipatched to MainThread"); 268 269 volumeView.clear(); 270 271 if (!routingController) 272 return; 273 274 [routingController setDiscoveryMode:MPRouteDiscoveryModeDisabled]; 275 routingController.clear(); 276 }); 277 } 278 252 279 [[NSNotificationCenter defaultCenter] removeObserver:self]; 253 280 [super dealloc]; … … 256 283 - (void)clearCallback 257 284 { 285 LOG(Media, "-[WebMediaSessionHelper clearCallback]"); 258 286 _callback = nil; 259 287 } … … 261 289 - (BOOL)hasWirelessTargetsAvailable 262 290 { 291 LOG(Media, "-[WebMediaSessionHelper hasWirelessTargetsAvailable]"); 263 292 return [_volumeView areWirelessRoutesAvailable]; 264 293 } … … 269 298 return; 270 299 271 _airPlayPresenceRoutingController = adoptNS([[getMPAVRoutingControllerClass() alloc] initWithName:@"WebCore - HTML media element checking for AirPlay route presence"]); 272 [_airPlayPresenceRoutingController setDiscoveryMode:MPRouteDiscoveryModePresence]; 300 LOG(Media, "-[WebMediaSessionHelper startMonitoringAirPlayRoutes]"); 301 302 RetainPtr<WebMediaSessionHelper> strongSelf = self; 303 callOnMainThread([strongSelf] () { 304 LOG(Media, "-[WebMediaSessionHelper startMonitoringAirPlayRoutes] - dipatched to MainThread"); 305 306 if (strongSelf->_airPlayPresenceRoutingController) 307 return; 308 309 strongSelf->_airPlayPresenceRoutingController = adoptNS([[getMPAVRoutingControllerClass() alloc] initWithName:@"WebCore - HTML media element checking for AirPlay route presence"]); 310 [strongSelf->_airPlayPresenceRoutingController setDiscoveryMode:MPRouteDiscoveryModePresence]; 311 }); 273 312 } 274 313 … … 278 317 return; 279 318 280 [_airPlayPresenceRoutingController setDiscoveryMode:MPRouteDiscoveryModeDisabled]; 281 _airPlayPresenceRoutingController = nil; 319 LOG(Media, "-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]"); 320 321 RetainPtr<WebMediaSessionHelper> strongSelf = self; 322 callOnMainThread([strongSelf] () { 323 LOG(Media, "-[WebMediaSessionHelper stopMonitoringAirPlayRoutes] - dipatched to MainThread"); 324 325 if (!strongSelf->_airPlayPresenceRoutingController) 326 return; 327 328 [strongSelf->_airPlayPresenceRoutingController setDiscoveryMode:MPRouteDiscoveryModeDisabled]; 329 strongSelf->_airPlayPresenceRoutingController = nil; 330 }); 282 331 } 283 332 … … 289 338 NSUInteger type = [[[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey] unsignedIntegerValue]; 290 339 MediaSession::EndInterruptionFlags flags = MediaSession::NoFlags; 340 341 LOG(Media, "-[WebMediaSessionHelper interruption] - type = %i", (int)type); 291 342 292 343 if (type == AVAudioSessionInterruptionTypeEnded && [[[notification userInfo] objectForKey:AVAudioSessionInterruptionOptionKey] unsignedIntegerValue] == AVAudioSessionInterruptionOptionShouldResume) … … 312 363 return; 313 364 365 LOG(Media, "-[WebMediaSessionHelper applicationWillEnterForeground]"); 366 314 367 WebThreadRun(^{ 315 368 if (!_callback) … … 327 380 return; 328 381 382 LOG(Media, "-[WebMediaSessionHelper applicationDidBecomeActive]"); 383 329 384 WebThreadRun(^{ 330 385 if (!_callback) … … 341 396 if (!_callback) 342 397 return; 343 398 399 LOG(Media, "-[WebMediaSessionHelper applicationWillResignActive]"); 400 344 401 WebThreadRun(^{ 345 402 if (!_callback) … … 357 414 return; 358 415 416 LOG(Media, "-[WebMediaSessionHelper wirelessRoutesAvailableDidChange]"); 417 359 418 WebThreadRun(^{ 360 419 if (!_callback)
Note:
See TracChangeset
for help on using the changeset viewer.