Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 953542b2c76daf6335ccb9521b578c62cf2fd220
      
https://github.com/WebKit/WebKit/commit/953542b2c76daf6335ccb9521b578c62cf2fd220
  Author: Andy Estes <[email protected]>
  Date:   2026-06-17 (Wed, 17 Jun 2026)

  Changed paths:
    M Source/WebCore/platform/audio/ios/MediaDeviceRoute.mm

  Log Message:
  -----------
  [iOS] Implement an alternative data source for MediaDeviceRoute
https://bugs.webkit.org/show_bug.cgi?id=317255
rdar://175647939

Reviewed by Jer Noble.

MediaDeviceRouteController can now vend one of two types as a data source for 
MediaDeviceRoute: an
AVMediaSource or an AVPlaybackControl. Eventually we will only use an 
AVPlaybackControl, but during
the migration we need to tolerate either type. To accomplish this, introduced a 
separate
AVPlaybackControl property on WebMediaSourceObserver that is mutually exclusive 
with the
AVMediaSource property (i.e., if one is set, the other becomes nil). Observers 
are registered on
the non-null object.

Since both types share many properties in common, refactored the observation 
macros so that there
is a list of common properties as well as lists of unique properties on each 
type. Some properties
have different names for the same conceptual property (e.g., playbackError and 
error). In those
cases the observation is hand-coded to call the appropriate 
MediaDeviceRouteClient callback.

No new tests. For layout tests we currently vend an AVMediaSource-conforming 
object, but in a
follow-on change it will become an AVPlaybackControl-conforming object.

* Source/WebCore/platform/audio/ios/MediaDeviceRoute.mm:
(-[WebMediaSourceObserver setMediaSource:]):
(-[WebMediaSourceObserver playbackControl]):
(-[WebMediaSourceObserver setPlaybackControl:]):
(-[WebMediaSourceObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebMediaSourceObserver dealloc]):
(WebCore::MediaDeviceRoute::playbackError const):
(WebCore::MediaDeviceRoute::currentPlaybackPosition const):
(WebCore::MediaDeviceRoute::setCurrentPlaybackPosition):

Canonical link: https://commits.webkit.org/315421@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to