<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[244627] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/244627">244627</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2019-04-24 16:56:07 -0700 (Wed, 24 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
https://bugs.webkit.org/show_bug.cgi?id=197171
<rdar://problem/47454979>

Reviewed by Youenn Fablet.

Source/WebCore:

Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithValueInContext):
(WebCore::jsValueWithAVMetadataItemInContext):
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::category const):
(WebCore::AudioSession::routeSharingPolicy const):
(WebCore::AudioSession::routingContextUID const):
(WebCore::AudioSession::sampleRate const):
(WebCore::AudioSession::bufferSize const):
(WebCore::AudioSession::numberOfOutputChannels const):
(WebCore::AudioSession::tryToSetActiveInternal):
(WebCore::AudioSession::preferredBufferSize const):
(WebCore::AudioSession::setPreferredBufferSize):
* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper initWithCallback:]):
(-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
(WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
(WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
(WebCore::AVTrackPrivateAVFObjCImpl::label const):
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::createMix):
* platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
(WebCore::AVFoundationMIMETypeCache::canDecodeType):
(WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::isAvailable):
(WebCore::CDMSessionAVContentKeySession::releaseKeys):
(WebCore::CDMSessionAVContentKeySession::update):
(WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
(WebCore::CDMSessionAVContentKeySession::contentKeySession):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::releaseKeys):
(WebCore::CDMSessionAVStreamSession::update):
(WebCore::CDMSessionAVStreamSession::setStreamSession):
(WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::imageDecoderAssetOptions):
(WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
(WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
(WebCore::ImageDecoderAVFObjC::readSamples):
(SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
(WebCore::InbandTextTrackPrivateAVFObjC::label const):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
(WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::devicePicker):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::assetCacheForPath):
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
(WebCore::determineChangedTracksFromNewTracksAndOldItems):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
(WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
(WebCore::exernalDeviceDisplayNameForPlayer):
(WebCore::metadataType):
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
(-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
(WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
(WebCore::PlatformCALayerCocoa::clone const):
(WebCore::PlatformCALayerCocoa::avPlayerLayer const):
* platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
(WebCore::validateHEVCParameters):
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(getAVSpeechUtteranceDefaultSpeechRate):
(getAVSpeechUtteranceMaximumSpeechRate):
(-[WebSpeechSynthesisWrapper speakUtterance:]):
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
(SOFT_LINK_CONSTANT): Deleted.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer init]):
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer setVideoGravity:]):
(-[WebAVPlayerLayer videoRect]):
(WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithValueInContext):
(WebCore::jsValueWithAVMetadataItemInContext):
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::getAVFormatIDKeyWithFallback):
(WebCore::getAVNumberOfChannelsKeyWithFallback):
(WebCore::getAVSampleRateKeyWithFallback):
(WebCore::getAVEncoderBitRateKeyWithFallback):
(WebCore::MediaRecorderPrivateWriter::create):
(WebCore::MediaRecorderPrivateWriter::setVideoInput):
(WebCore::MediaRecorderPrivateWriter::setAudioInput):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/VideoPreset.h:
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
(-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
(-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::deviceIsAvailable):
(WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
(WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
(WebCore::AVCaptureDeviceManager::isAvailable):
(WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoPreset::create):
(WebCore::AVVideoPreset::AVVideoPreset):
(WebCore::AVVideoCaptureSource::create):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::capabilities):
(WebCore::sensorOrientationFromVideoOutput):
(WebCore::AVVideoCaptureSource::setupSession):
(WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::AVVideoCaptureSource::generatePresets):
(-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/cocoa/AVFoundationSoftLink.h: Added.
* pal/cocoa/AVFoundationSoftLink.mm: Added.

Source/WebKit:

* Shared/ios/WebIconUtilities.mm:
(WebKit::iconForVideoFile):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::clone const):

Source/WebKitLegacy/mac:

* WebView/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController setVideoElement:]):
(-[WebVideoFullscreenController windowDidExitFullscreen]):
(SOFT_LINK_CLASS): Deleted.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm: Added.
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm</a></li>
<li><a href="#trunkSourceWebCorePALChangeLog">trunk/Source/WebCore/PAL/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALPALxcodeprojprojectpbxproj">trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosAudioSessionIOSmm">trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm">trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationAVTrackPrivateAVFObjCImplmm">trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationAudioSourceProviderAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlaybackTargetMacmm">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaSelectionGroupAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcAVFoundationMIMETypeCachemm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMInstanceFairPlayStreamingAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVContentKeySessionmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVStreamSessionmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcImageDecoderAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcInbandTextTrackPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcInbandTextTrackPrivateLegacyAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlaybackTargetPickerMacmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSampleAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaHEVCUtilitiesCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformSpeechSynthesizerIOSmm">trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosVideoFullscreenInterfaceAVKitmm">trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacSerializedPlatformRepresentationMacmm">trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediarecordercocoaMediaRecorderPrivateWriterCocoamm">trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeVideoSourceh">trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamVideoPreseth">trunk/Source/WebCore/platform/mediastream/VideoPreset.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamiosAVAudioSessionCaptureDeviceManagermm">trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamiosCoreAudioCaptureSourceIOSmm">trunk/Source/WebCore/platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagermm">trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm">trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMacmm">trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharediosWebIconUtilitiesmm">trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm</a></li>
<li><a href="#trunkSourceWebKitSharedmacWebCoreArgumentCodersMacmm">trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaUIDelegatemm">trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageRemoteLayerTreePlatformCALayerRemoteCustommm">trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebViewWebVideoFullscreenControllermm">trunk/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenController.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorePALpalcocoaAVFoundationSoftLinkh">trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h</a></li>
<li><a href="#trunkSourceWebCorePALpalcocoaAVFoundationSoftLinkmm">trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCorecocoaAVFoundationSoftLinkTestmm">trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/ChangeLog      2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -1,3 +1,184 @@
</span><ins>+2019-04-24  Eric Carlson  <eric.carlson@apple.com>
+
+        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
+        https://bugs.webkit.org/show_bug.cgi?id=197171
+        <rdar://problem/47454979>
+
+        Reviewed by Youenn Fablet.
+
+        Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
+
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::jsValueWithValueInContext):
+        (WebCore::jsValueWithAVMetadataItemInContext):
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/audio/ios/AudioSessionIOS.mm:
+        (WebCore::AudioSession::setCategory):
+        (WebCore::AudioSession::category const):
+        (WebCore::AudioSession::routeSharingPolicy const):
+        (WebCore::AudioSession::routingContextUID const):
+        (WebCore::AudioSession::sampleRate const):
+        (WebCore::AudioSession::bufferSize const):
+        (WebCore::AudioSession::numberOfOutputChannels const):
+        (WebCore::AudioSession::tryToSetActiveInternal):
+        (WebCore::AudioSession::preferredBufferSize const):
+        (WebCore::AudioSession::setPreferredBufferSize):
+        * platform/audio/ios/MediaSessionManagerIOS.mm:
+        (-[WebMediaSessionHelper initWithCallback:]):
+        (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
+        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
+        (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
+        (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
+        (WebCore::AVTrackPrivateAVFObjCImpl::label const):
+        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
+        (WebCore::AudioSourceProviderAVFObjC::createMix):
+        * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
+        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
+        (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
+        * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
+        (WebCore::AVFoundationMIMETypeCache::canDecodeType):
+        (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
+        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
+        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
+        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
+        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
+        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
+        (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
+        (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
+        (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
+        (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
+        (WebCore::CDMSessionAVContentKeySession::isAvailable):
+        (WebCore::CDMSessionAVContentKeySession::releaseKeys):
+        (WebCore::CDMSessionAVContentKeySession::update):
+        (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
+        (WebCore::CDMSessionAVContentKeySession::contentKeySession):
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
+        (WebCore::CDMSessionAVStreamSession::releaseKeys):
+        (WebCore::CDMSessionAVStreamSession::update):
+        (WebCore::CDMSessionAVStreamSession::setStreamSession):
+        (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
+        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
+        (WebCore::imageDecoderAssetOptions):
+        (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
+        (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
+        (WebCore::ImageDecoderAVFObjC::readSamples):
+        (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
+        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
+        (WebCore::InbandTextTrackPrivateAVFObjC::label const):
+        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
+        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
+        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
+        (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::assetCacheForPath):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
+        (WebCore::determineChangedTracksFromNewTracksAndOldItems):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
+        (WebCore::exernalDeviceDisplayNameForPlayer):
+        (WebCore::metadataType):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
+        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
+        (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
+        (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
+        (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
+        (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
+        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
+        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
+        (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
+        (WebCore::PlatformCALayerCocoa::clone const):
+        (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
+        * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
+        (WebCore::validateHEVCParameters):
+        * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+        (getAVSpeechUtteranceDefaultSpeechRate):
+        (getAVSpeechUtteranceMaximumSpeechRate):
+        (-[WebSpeechSynthesisWrapper speakUtterance:]):
+        (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
+        (SOFT_LINK_CONSTANT): Deleted.
+        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+        (-[WebAVPlayerLayer init]):
+        (-[WebAVPlayerLayer layoutSublayers]):
+        (-[WebAVPlayerLayer setVideoGravity:]):
+        (-[WebAVPlayerLayer videoRect]):
+        (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
+        * platform/mac/SerializedPlatformRepresentationMac.mm:
+        (WebCore::jsValueWithValueInContext):
+        (WebCore::jsValueWithAVMetadataItemInContext):
+        * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
+        (WebCore::getAVFormatIDKeyWithFallback):
+        (WebCore::getAVNumberOfChannelsKeyWithFallback):
+        (WebCore::getAVSampleRateKeyWithFallback):
+        (WebCore::getAVEncoderBitRateKeyWithFallback):
+        (WebCore::MediaRecorderPrivateWriter::create):
+        (WebCore::MediaRecorderPrivateWriter::setVideoInput):
+        (WebCore::MediaRecorderPrivateWriter::setAudioInput):
+        * platform/mediastream/RealtimeVideoSource.h:
+        * platform/mediastream/VideoPreset.h:
+        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
+        (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
+        * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
+        (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
+        (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
+        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
+        (WebCore::deviceIsAvailable):
+        (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
+        (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
+        (WebCore::AVCaptureDeviceManager::isAvailable):
+        (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
+        * platform/mediastream/mac/AVVideoCaptureSource.mm:
+        (WebCore::AVVideoPreset::create):
+        (WebCore::AVVideoPreset::AVVideoPreset):
+        (WebCore::AVVideoCaptureSource::create):
+        (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
+        (WebCore::AVVideoCaptureSource::capabilities):
+        (WebCore::sensorOrientationFromVideoOutput):
+        (WebCore::AVVideoCaptureSource::setupSession):
+        (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
+        (WebCore::AVVideoCaptureSource::setupCaptureSession):
+        (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
+        (WebCore::AVVideoCaptureSource::generatePresets):
+        (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
+        (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
+
</ins><span class="cx"> 2019-04-24  Brady Eidson  <beidson@apple.com>
</span><span class="cx"> 
</span><span class="cx">         XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -57,18 +57,14 @@
</span><span class="cx"> #import <wtf/text/Base64.h>
</span><span class="cx"> 
</span><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-typedef AVMetadataItem AVMetadataItemType;
-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
-#define AVMetadataItem getAVMetadataItemClass()
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> using namespace PAL;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx"> static JSValue *jsValueWithValueInContext(id, JSContext *);
</span><del>-static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItemType *, JSContext *);
</del><ins>+static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *, JSContext *);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> static String quickTimePluginReplacementScript()
</span><span class="lines">@@ -329,13 +325,13 @@
</span><span class="cx">         return jsValueWithArrayInContext(value, context);
</span><span class="cx">     else if ([value isKindOfClass:[NSData class]])
</span><span class="cx">         return jsValueWithDataInContext(value, emptyString(), context);
</span><del>-    else if ([value isKindOfClass:[AVMetadataItem class]])
</del><ins>+    else if ([value isKindOfClass:PAL::getAVMetadataItemClass()])
</ins><span class="cx">         return jsValueWithAVMetadataItemInContext(value, context);
</span><span class="cx"> 
</span><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItemType *item, JSContext *context)
</del><ins>+static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSContext *context)
</ins><span class="cx"> {
</span><span class="cx">     NSMutableDictionary* dictionary = [NSMutableDictionary dictionaryWithDictionary:[item extraAttributes]];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorePALChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/ChangeLog (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/ChangeLog       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/PAL/ChangeLog  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-04-24  Eric Carlson  <eric.carlson@apple.com>
+
+        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
+        https://bugs.webkit.org/show_bug.cgi?id=197171
+        <rdar://problem/47454979>
+
+        Reviewed by Youenn Fablet.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/cocoa/AVFoundationSoftLink.h: Added.
+        * pal/cocoa/AVFoundationSoftLink.mm: Added.
+
</ins><span class="cx"> 2019-04-24  Tim Horton  <timothy_horton@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Clean up WKActionSheetAssistant's use of LaunchServices
</span></span></pre></div>
<a id="trunkSourceWebCorePALPALxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj   2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj      2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -21,6 +21,8 @@
</span><span class="cx"> /* End PBXAggregateTarget section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXBuildFile section */
</span><ins>+               077E87B1226A460200A2AFF0 /* AVFoundationSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 077E87AF226A460200A2AFF0 /* AVFoundationSoftLink.mm */; };
+               077E87B2226A460300A2AFF0 /* AVFoundationSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 077E87B0226A460200A2AFF0 /* AVFoundationSoftLink.h */; };
</ins><span class="cx">           0C00CFD41F68CE4600AAC26D /* MediaTimeAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C00CFD21F68CE4600AAC26D /* MediaTimeAVFoundation.h */; };
</span><span class="cx">          0C2D9E731EEF5AF600DBC317 /* ExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2D9E721EEF5AF600DBC317 /* ExportMacros.h */; };
</span><span class="cx">          0C2DA06D1F33CA8400DBC317 /* CFLocaleSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2DA0671F33CA8400DBC317 /* CFLocaleSPI.h */; };
</span><span class="lines">@@ -98,7 +100,6 @@
</span><span class="cx">          0C7785A01F45130F00F4EBB6 /* QuickLookMacSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785871F45130F00F4EBB6 /* QuickLookMacSPI.h */; };
</span><span class="cx">          0C7785A11F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785881F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h */; };
</span><span class="cx">          0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */; };
</span><del>-               7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */; };
</del><span class="cx">           0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0CF99CA61F738436007EE793 /* CoreMediaSoftLink.cpp */; };
</span><span class="cx">          0CF99CA91F738437007EE793 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CF99CA71F738437007EE793 /* CoreMediaSoftLink.h */; };
</span><span class="cx">          1C09D0531E31C44100725F18 /* CryptoDigest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0521E31C44100725F18 /* CryptoDigest.h */; };
</span><span class="lines">@@ -121,6 +122,7 @@
</span><span class="cx">          570AB8F920AF6E3D00B8BE87 /* NSXPCConnectionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F820AF6E3D00B8BE87 /* NSXPCConnectionSPI.h */; };
</span><span class="cx">          63C7EDC721AFAE04006A7B99 /* NSProgressSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 63E369F921AFA83F001C14BC /* NSProgressSPI.h */; };
</span><span class="cx">          7A1656441F97B2B900BA3CE4 /* NSKeyedArchiverSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */; };
</span><ins>+               7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */; };
</ins><span class="cx">           7A3A6A8020CADB4700317AAE /* NSImageSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A3A6A7F20CADB4600317AAE /* NSImageSPI.h */; };
</span><span class="cx">          A10265891F56747A00B4C844 /* HIToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265881F56747A00B4C844 /* HIToolboxSPI.h */; };
</span><span class="cx">          A102658E1F567E9D00B4C844 /* HIServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A102658D1F567E9D00B4C844 /* HIServicesSPI.h */; };
</span><span class="lines">@@ -175,6 +177,8 @@
</span><span class="cx"> /* End PBXContainerItemProxy section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXFileReference section */
</span><ins>+               077E87AF226A460200A2AFF0 /* AVFoundationSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVFoundationSoftLink.mm; sourceTree = "<group>"; };
+               077E87B0226A460200A2AFF0 /* AVFoundationSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVFoundationSoftLink.h; sourceTree = "<group>"; };
</ins><span class="cx">           0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTimeAVFoundation.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0C00CFD21F68CE4600AAC26D /* MediaTimeAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTimeAVFoundation.h; sourceTree = "<group>"; };
</span><span class="cx">          0C2D9E721EEF5AF600DBC317 /* ExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExportMacros.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -182,7 +186,6 @@
</span><span class="cx">          0C2DA0681F33CA8400DBC317 /* CFNetworkConnectionCacheSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkConnectionCacheSPI.h; sourceTree = "<group>"; };
</span><span class="cx">          0C2DA0691F33CA8400DBC317 /* CFNetworkSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkSPI.h; sourceTree = "<group>"; };
</span><span class="cx">          0C2DA06A1F33CA8400DBC317 /* CFUtilitiesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFUtilitiesSPI.h; sourceTree = "<group>"; };
</span><del>-               7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };
</del><span class="cx">           0C2DA06B1F33CA8400DBC317 /* CoreAudioSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudioSPI.h; sourceTree = "<group>"; };
</span><span class="cx">          0C2DA06C1F33CA8400DBC317 /* CoreMediaSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSPI.h; sourceTree = "<group>"; };
</span><span class="cx">          0C2DA11C1F3BE9E000DBC317 /* CoreGraphicsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSPI.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -283,6 +286,7 @@
</span><span class="cx">          570AB8F820AF6E3D00B8BE87 /* NSXPCConnectionSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSXPCConnectionSPI.h; sourceTree = "<group>"; };
</span><span class="cx">          63E369F921AFA83F001C14BC /* NSProgressSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSProgressSPI.h; sourceTree = "<group>"; };
</span><span class="cx">          7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSKeyedArchiverSPI.h; sourceTree = "<group>"; };
</span><ins>+               7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };
</ins><span class="cx">           7A3A6A7F20CADB4600317AAE /* NSImageSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSImageSPI.h; sourceTree = "<group>"; };
</span><span class="cx">          93E5909C1F93BF1E0067F8CF /* UnencodableHandling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UnencodableHandling.h; sourceTree = "<group>"; };
</span><span class="cx">          A10265881F56747A00B4C844 /* HIToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HIToolboxSPI.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -575,6 +579,8 @@
</span><span class="cx">          1C4876DE1F8D831300CCEEBD /* cocoa */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               077E87B0226A460200A2AFF0 /* AVFoundationSoftLink.h */,
+                               077E87AF226A460200A2AFF0 /* AVFoundationSoftLink.mm */,
</ins><span class="cx">                           F44291661FA52705002CC93E /* FileSizeFormatterCocoa.mm */,
</span><span class="cx">                          A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */,
</span><span class="cx">                          A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */,
</span><span class="lines">@@ -672,6 +678,7 @@
</span><span class="cx">                  buildActionMask = 2147483647;
</span><span class="cx">                  files = (
</span><span class="cx">                          2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */,
</span><ins>+                               077E87B2226A460300A2AFF0 /* AVFoundationSoftLink.h in Headers */,
</ins><span class="cx">                           0C7785891F45130F00F4EBB6 /* AVFoundationSPI.h in Headers */,
</span><span class="cx">                          0C2DA13E1F3BEB4900DBC317 /* AVKitSPI.h in Headers */,
</span><span class="cx">                          CDF91113220E4EEC001EA39E /* CelestialSPI.h in Headers */,
</span><span class="lines">@@ -877,6 +884,7 @@
</span><span class="cx">                  isa = PBXSourcesBuildPhase;
</span><span class="cx">                  buildActionMask = 2147483647;
</span><span class="cx">                  files = (
</span><ins>+                               077E87B1226A460200A2AFF0 /* AVFoundationSoftLink.mm in Sources */,
</ins><span class="cx">                           0C5FFF0F1F78D9DA009EFF1A /* ClockCM.mm in Sources */,
</span><span class="cx">                          0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */,
</span><span class="cx">                          1C09D0561E31C46500725F18 /* CryptoDigestCommonCrypto.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalcocoaAVFoundationSoftLinkh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h (0 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h                                (rev 0)
+++ trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -0,0 +1,288 @@
</span><ins>+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(AVFOUNDATION)
+
+#import <AVFoundation/AVFoundation.h>
+#import <pal/spi/mac/AVFoundationSPI.h>
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, AVFoundation)
+
+// Note: We don't define accessor macros for classes (e.g.
+//    #define AVAssetCache PAL::getAVAssetCacheClass()
+// because they make it difficult to use the class name in source code.
+
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetCache)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetImageGenerator)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetReader)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetReaderSampleReferenceOutput)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetResourceLoadingRequest)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetWriter)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetWriterInput)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVCaptureConnection)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVCaptureDevice)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVCaptureDeviceFormat)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVCaptureDeviceInput)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVCaptureOutput)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVCaptureSession)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVCaptureVideoDataOutput)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVContentKeyResponse)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVContentKeySession)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVFrameRateRange)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMediaSelectionGroup)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMediaSelectionOption)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMetadataItem)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMutableAudioMix)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMutableAudioMixInputParameters)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVOutputContext)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPlayer)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPlayerItem)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPlayerItemLegibleOutput)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPlayerItemVideoOutput)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPlayerLayer)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSampleBufferAudioRenderer)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSampleBufferDisplayLayer)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSampleBufferRenderSynchronizer)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVStreamDataParser)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVURLAsset)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVVideoPerformanceMetrics)
+
+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVStreamSession)
+#endif
+
+#if PLATFORM(IOS_FAMILY)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAudioSession)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVPersistableContentKeyRequest)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechSynthesisVoice)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechSynthesizer)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechUtterance)
+#endif
+
+#if HAVE(MEDIA_PLAYER) && !PLATFORM(WATCHOS)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, AVRouteDetector)
+#endif
+
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioTimePitchAlgorithmSpectral, NSString *)
+#define AVAudioTimePitchAlgorithmSpectral PAL::get_AVFoundation_AVAudioTimePitchAlgorithmSpectral()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioTimePitchAlgorithmVarispeed, NSString *)
+#define AVAudioTimePitchAlgorithmVarispeed PAL::get_AVFoundation_AVAudioTimePitchAlgorithmVarispeed()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicVisual, NSString *)
+#define AVMediaCharacteristicVisual PAL::get_AVFoundation_AVMediaCharacteristicVisual()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicAudible, NSString *)
+#define AVMediaCharacteristicAudible PAL::get_AVFoundation_AVMediaCharacteristicAudible()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaTypeClosedCaption, NSString *)
+#define AVMediaTypeClosedCaption PAL::get_AVFoundation_AVMediaTypeClosedCaption()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaTypeVideo, NSString *)
+#define AVMediaTypeVideo PAL::get_AVFoundation_AVMediaTypeVideo()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaTypeMuxed, NSString *)
+#define AVMediaTypeMuxed PAL::get_AVFoundation_AVMediaTypeMuxed()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaTypeAudio, NSString *)
+#define AVMediaTypeAudio PAL::get_AVFoundation_AVMediaTypeAudio()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaTypeMetadata, NSString *)
+#define AVMediaTypeMetadata PAL::get_AVFoundation_AVMediaTypeMetadata()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVURLAssetInheritURIQueryComponentFromReferencingURIKey, NSString *)
+#define AVURLAssetInheritURIQueryComponentFromReferencingURIKey PAL::get_AVFoundation_AVURLAssetInheritURIQueryComponentFromReferencingURIKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAssetImageGeneratorApertureModeCleanAperture, NSString *)
+#define AVAssetImageGeneratorApertureModeCleanAperture PAL::get_AVFoundation_AVAssetImageGeneratorApertureModeCleanAperture()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVURLAssetReferenceRestrictionsKey, NSString *)
+#define AVURLAssetReferenceRestrictionsKey PAL::get_AVFoundation_AVURLAssetReferenceRestrictionsKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVLayerVideoGravityResizeAspect, NSString *)
+#define AVLayerVideoGravityResizeAspect PAL::get_AVFoundation_AVLayerVideoGravityResizeAspect()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVLayerVideoGravityResizeAspectFill, NSString *)
+#define AVLayerVideoGravityResizeAspectFill PAL::get_AVFoundation_AVLayerVideoGravityResizeAspectFill()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVLayerVideoGravityResize, NSString *)
+#define AVLayerVideoGravityResize PAL::get_AVFoundation_AVLayerVideoGravityResize()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVStreamingKeyDeliveryContentKeyType, NSString *)
+#define AVStreamingKeyDeliveryContentKeyType PAL::get_AVFoundation_AVStreamingKeyDeliveryContentKeyType()
+
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVCaptureDeviceWasConnectedNotification, NSString *)
+#define AVCaptureDeviceWasConnectedNotification PAL::get_AVFoundation_AVCaptureDeviceWasConnectedNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVCaptureDeviceWasDisconnectedNotification, NSString *)
+#define AVCaptureDeviceWasDisconnectedNotification PAL::get_AVFoundation_AVCaptureDeviceWasDisconnectedNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVPlayerItemDidPlayToEndTimeNotification, NSString *)
+#define AVPlayerItemDidPlayToEndTimeNotification PAL::get_AVFoundation_AVPlayerItemDidPlayToEndTimeNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVStreamSessionContentProtectionSessionIdentifierChangedNotification, NSString *)
+#define AVStreamSessionContentProtectionSessionIdentifierChangedNotification PAL::get_AVFoundation_AVStreamSessionContentProtectionSessionIdentifierChangedNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVSampleBufferDisplayLayerFailedToDecodeNotification, NSString*)
+#define AVSampleBufferDisplayLayerFailedToDecodeNotification PAL::get_AVFoundation_AVSampleBufferDisplayLayerFailedToDecodeNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVSampleBufferDisplayLayerFailedToDecodeNotificationErrorKey, NSString*)
+#define AVSampleBufferDisplayLayerFailedToDecodeNotificationErrorKey PAL::get_AVFoundation_AVSampleBufferDisplayLayerFailedToDecodeNotificationErrorKey()
+
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicContainsOnlyForcedSubtitles, NSString *)
+#define AVMediaCharacteristicContainsOnlyForcedSubtitles PAL::get_AVFoundation_AVMediaCharacteristicContainsOnlyForcedSubtitles()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicLegible, NSString *)
+#define AVMediaCharacteristicLegible PAL::get_AVFoundation_AVMediaCharacteristicLegible()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly, NSString *)
+#define AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly PAL::get_AVFoundation_AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly()
+
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMetadataCommonKeyTitle, NSString *)
+#define AVMetadataCommonKeyTitle PAL::get_AVFoundation_AVMetadataCommonKeyTitle()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMetadataKeySpaceCommon, NSString *)
+#define AVMetadataKeySpaceCommon PAL::get_AVFoundation_AVMetadataKeySpaceCommon()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaTypeSubtitle, NSString *)
+#define AVMediaTypeSubtitle PAL::get_AVFoundation_AVMediaTypeSubtitle()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicIsMainProgramContent, NSString *)
+#define AVMediaCharacteristicIsMainProgramContent PAL::get_AVFoundation_AVMediaCharacteristicIsMainProgramContent()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicEasyToRead, NSString *)
+#define AVMediaCharacteristicEasyToRead PAL::get_AVFoundation_AVMediaCharacteristicEasyToRead()
+
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVURLAssetOutOfBandMIMETypeKey, NSString *)
+#define AVURLAssetOutOfBandMIMETypeKey PAL::get_AVFoundation_AVURLAssetOutOfBandMIMETypeKey()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVURLAssetUseClientURLLoadingExclusively, NSString *)
+#define AVURLAssetUseClientURLLoadingExclusively PAL::get_AVFoundation_AVURLAssetUseClientURLLoadingExclusively()
+
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVContentKeySystemFairPlayStreaming, NSString*)
+#define AVContentKeySystemFairPlayStreaming PAL::get_AVFoundation_AVContentKeySystemFairPlayStreaming()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVContentKeyRequestProtocolVersionsKey, NSString *)
+#define AVContentKeyRequestProtocolVersionsKey PAL::get_AVFoundation_AVContentKeyRequestProtocolVersionsKey()
+
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVVideoCodecTypeHEVCWithAlpha, NSString *)
+#define AVVideoCodecTypeHEVCWithAlpha PAL::get_AVFoundation_AVVideoCodecTypeHEVCWithAlpha()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVFileTypeMPEG4, NSString *)
+#define AVFileTypeMPEG4 PAL::get_AVFoundation_AVFileTypeMPEG4()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoCodecKey, NSString *)
+#define AVVideoCodecKey PAL::get_AVFoundation_AVVideoCodecKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoCodecH264, NSString *)
+#define AVVideoCodecH264 PAL::get_AVFoundation_AVVideoCodecH264()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoWidthKey, NSString *)
+#define AVVideoWidthKey PAL::get_AVFoundation_AVVideoWidthKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoHeightKey, NSString *)
+#define AVVideoHeightKey PAL::get_AVFoundation_AVVideoHeightKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoExpectedSourceFrameRateKey, NSString *)
+#define AVVideoExpectedSourceFrameRateKey PAL::get_AVFoundation_AVVideoExpectedSourceFrameRateKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoProfileLevelKey, NSString *)
+#define AVVideoProfileLevelKey PAL::get_AVFoundation_AVVideoProfileLevelKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoAverageBitRateKey, NSString *)
+#define AVVideoAverageBitRateKey PAL::get_AVFoundation_AVVideoAverageBitRateKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoMaxKeyFrameIntervalKey, NSString *)
+#define AVVideoMaxKeyFrameIntervalKey PAL::get_AVFoundation_AVVideoMaxKeyFrameIntervalKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoProfileLevelH264MainAutoLevel, NSString *)
+#define AVVideoProfileLevelH264MainAutoLevel PAL::get_AVFoundation_AVVideoProfileLevelH264MainAutoLevel()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVVideoCompressionPropertiesKey, NSString *)
+#define AVVideoCompressionPropertiesKey PAL::get_AVFoundation_AVVideoCompressionPropertiesKey()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVEncoderBitRateKey, NSString *)
+#define AVEncoderBitRateKey PAL::get_AVFoundation_AVEncoderBitRateKey()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVFormatIDKey, NSString *)
+#define AVFormatIDKey PAL::get_AVFoundation_AVFormatIDKey()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVNumberOfChannelsKey, NSString *)
+#define AVNumberOfChannelsKey PAL::get_AVFoundation_AVNumberOfChannelsKey()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVSampleRateKey, NSString *)
+#define AVSampleRateKey PAL::get_AVFoundation_AVSampleRateKey()
+
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVURLAssetCacheKey, NSString *)
+#define AVURLAssetCacheKey PAL::get_AVFoundation_AVURLAssetCacheKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVURLAssetOutOfBandAlternateTracksKey, NSString *)
+#define AVURLAssetOutOfBandAlternateTracksKey PAL::get_AVFoundation_AVURLAssetOutOfBandAlternateTracksKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVURLAssetUsesNoPersistentCacheKey, NSString *)
+#define AVURLAssetUsesNoPersistentCacheKey PAL::get_AVFoundation_AVURLAssetUsesNoPersistentCacheKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVOutOfBandAlternateTrackDisplayNameKey, NSString *)
+#define AVOutOfBandAlternateTrackDisplayNameKey PAL::get_AVFoundation_AVOutOfBandAlternateTrackDisplayNameKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVOutOfBandAlternateTrackExtendedLanguageTagKey, NSString *)
+#define AVOutOfBandAlternateTrackExtendedLanguageTagKey PAL::get_AVFoundation_AVOutOfBandAlternateTrackExtendedLanguageTagKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVOutOfBandAlternateTrackIsDefaultKey, NSString *)
+#define AVOutOfBandAlternateTrackIsDefaultKey PAL::get_AVFoundation_AVOutOfBandAlternateTrackIsDefaultKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVOutOfBandAlternateTrackMediaCharactersticsKey, NSString *)
+#define AVOutOfBandAlternateTrackMediaCharactersticsKey PAL::get_AVFoundation_AVOutOfBandAlternateTrackMediaCharactersticsKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVOutOfBandAlternateTrackIdentifierKey, NSString *)
+#define AVOutOfBandAlternateTrackIdentifierKey PAL::get_AVFoundation_AVOutOfBandAlternateTrackIdentifierKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVOutOfBandAlternateTrackSourceKey, NSString *)
+#define AVOutOfBandAlternateTrackSourceKey PAL::get_AVFoundation_AVOutOfBandAlternateTrackSourceKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicDescribesMusicAndSoundForAccessibility, NSString *)
+#define AVMediaCharacteristicDescribesMusicAndSoundForAccessibility PAL::get_AVFoundation_AVMediaCharacteristicDescribesMusicAndSoundForAccessibility()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicTranscribesSpokenDialogForAccessibility, NSString *)
+#define AVMediaCharacteristicTranscribesSpokenDialogForAccessibility PAL::get_AVFoundation_AVMediaCharacteristicTranscribesSpokenDialogForAccessibility()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicIsAuxiliaryContent, NSString *)
+#define AVMediaCharacteristicIsAuxiliaryContent PAL::get_AVFoundation_AVMediaCharacteristicIsAuxiliaryContent()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMediaCharacteristicDescribesVideoForAccessibility, NSString *)
+#define AVMediaCharacteristicDescribesVideoForAccessibility PAL::get_AVFoundation_AVMediaCharacteristicDescribesVideoForAccessibility()
+
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMetadataKeySpaceQuickTimeUserData, NSString *)
+#define AVMetadataKeySpaceQuickTimeUserData PAL::get_AVFoundation_AVMetadataKeySpaceQuickTimeUserData()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMetadataKeySpaceQuickTimeMetadata, NSString *)
+#define AVMetadataKeySpaceQuickTimeMetadata PAL::get_AVFoundation_AVMetadataKeySpaceQuickTimeMetadata()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMetadataKeySpaceiTunes, NSString *)
+#define AVMetadataKeySpaceiTunes PAL::get_AVFoundation_AVMetadataKeySpaceiTunes()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMetadataKeySpaceID3, NSString *)
+#define AVMetadataKeySpaceID3 PAL::get_AVFoundation_AVMetadataKeySpaceID3()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVMetadataKeySpaceISOUserData, NSString *)
+#define AVMetadataKeySpaceISOUserData PAL::get_AVFoundation_AVMetadataKeySpaceISOUserData()
+
+#if PLATFORM(MAC)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVStreamDataParserContentKeyRequestProtocolVersionsKey, NSString *)
+#define AVStreamDataParserContentKeyRequestProtocolVersionsKey PAL::get_AVFoundation_AVStreamDataParserContentKeyRequestProtocolVersionsKey()
+#endif
+
+#if PLATFORM(IOS_FAMILY)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVURLAssetBoundNetworkInterfaceName, NSString *)
+#define AVURLAssetBoundNetworkInterfaceName PAL::get_AVFoundation_AVURLAssetBoundNetworkInterfaceName()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVURLAssetClientBundleIdentifierKey, NSString *)
+#define AVURLAssetClientBundleIdentifierKey PAL::get_AVFoundation_AVURLAssetClientBundleIdentifierKey()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVURLAssetHTTPCookiesKey, NSString *)
+#define AVURLAssetHTTPCookiesKey PAL::get_AVFoundation_AVURLAssetHTTPCookiesKey()
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, AVFoundation, AVURLAssetRequiresCustomURLLoadingKey, NSString *)
+#define AVURLAssetRequiresCustomURLLoadingKey PAL::get_AVFoundation_AVURLAssetRequiresCustomURLLoadingKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVCaptureSessionRuntimeErrorNotification, NSString *)
+#define AVCaptureSessionRuntimeErrorNotification PAL::get_AVFoundation_AVCaptureSessionRuntimeErrorNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVCaptureSessionWasInterruptedNotification, NSString *)
+#define AVCaptureSessionWasInterruptedNotification PAL::get_AVFoundation_AVCaptureSessionWasInterruptedNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVCaptureSessionInterruptionEndedNotification, NSString *)
+#define AVCaptureSessionInterruptionEndedNotification PAL::get_AVFoundation_AVCaptureSessionInterruptionEndedNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVCaptureSessionInterruptionReasonKey, NSString *)
+#define AVCaptureSessionInterruptionReasonKey PAL::get_AVFoundation_AVCaptureSessionInterruptionReasonKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVCaptureSessionErrorKey, NSString *)
+#define AVCaptureSessionErrorKey PAL::get_AVFoundation_AVCaptureSessionErrorKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionCategoryAmbient, NSString *)
+#define AVAudioSessionCategoryAmbient PAL::get_AVFoundation_AVAudioSessionCategoryAmbient()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionCategorySoloAmbient, NSString *)
+#define AVAudioSessionCategorySoloAmbient PAL::get_AVFoundation_AVAudioSessionCategorySoloAmbient()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionCategoryPlayback, NSString *)
+#define AVAudioSessionCategoryPlayback PAL::get_AVFoundation_AVAudioSessionCategoryPlayback()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionCategoryRecord, NSString *)
+#define AVAudioSessionCategoryRecord PAL::get_AVFoundation_AVAudioSessionCategoryRecord()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionCategoryPlayAndRecord, NSString *)
+#define AVAudioSessionCategoryPlayAndRecord PAL::get_AVFoundation_AVAudioSessionCategoryPlayAndRecord()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionCategoryAudioProcessing, NSString *)
+#define AVAudioSessionCategoryAudioProcessing PAL::get_AVFoundation_AVAudioSessionCategoryAudioProcessing()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionModeDefault, NSString *)
+#define AVAudioSessionModeDefault PAL::get_AVFoundation_AVAudioSessionModeDefault()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionModeVideoChat, NSString *)
+#define AVAudioSessionModeVideoChat PAL::get_AVFoundation_AVAudioSessionModeVideoChat()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionInterruptionNotification, NSString *)
+#define AVAudioSessionInterruptionNotification PAL::get_AVFoundation_AVAudioSessionInterruptionNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionInterruptionTypeKey, NSString *)
+#define AVAudioSessionInterruptionTypeKey PAL::get_AVFoundation_AVAudioSessionInterruptionTypeKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionInterruptionOptionKey, NSString *)
+#define AVAudioSessionInterruptionOptionKey PAL::get_AVFoundation_AVAudioSessionInterruptionOptionKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVRouteDetectorMultipleRoutesDetectedDidChangeNotification, NSString *)
+#define AVRouteDetectorMultipleRoutesDetectedDidChangeNotification PAL::get_AVFoundation_AVRouteDetectorMultipleRoutesDetectedDidChangeNotification()
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, AVFoundation, AVAudioSessionMediaServicesWereResetNotification, NSString *)
+#define AVAudioSessionMediaServicesWereResetNotification PAL::get_AVFoundation_AVAudioSessionMediaServicesWereResetNotification()
+#endif //  PLATFORM(IOS_FAMILY)
+
+#endif // USE(AVFOUNDATION)
</ins></span></pre></div>
<a id="trunkSourceWebCorePALpalcocoaAVFoundationSoftLinkmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm (0 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm                               (rev 0)
+++ trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -0,0 +1,183 @@
</span><ins>+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE, PAL_EXPORT)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#if USE(AVFOUNDATION)
+
+#import <AVFoundation/AVFoundation.h>
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, PAL_EXPORT)
+
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAssetCache, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAssetImageGenerator, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAssetReader, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAssetWriter, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAssetWriterInput, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureConnection, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureDevice, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureDeviceFormat, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureDeviceInput, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureOutput, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureSession, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureVideoDataOutput, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVFrameRateRange, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaSelectionGroup, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaSelectionOption, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataItem, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMutableAudioMix, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMutableAudioMixInputParameters, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVOutputContext, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPlayer, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPlayerItem, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPlayerItemLegibleOutput, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPlayerItemVideoOutput, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPlayerLayer, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAsset, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVAssetReaderSampleReferenceOutput, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVAssetResourceLoadingRequest, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVContentKeyResponse, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVContentKeySession, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferAudioRenderer, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferDisplayLayer, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferRenderSynchronizer, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVStreamDataParser, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVVideoPerformanceMetrics, PAL_EXPORT)
+
+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVStreamSession, PAL_EXPORT)
+#endif
+
+#if PLATFORM(IOS_FAMILY)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSession, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPersistableContentKeyRequest, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSpeechSynthesisVoice, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSpeechSynthesizer, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSpeechUtterance, PAL_EXPORT)
+#endif
+
+#if HAVE(MEDIA_PLAYER) && !PLATFORM(WATCHOS)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVRouteDetector, PAL_EXPORT)
+#endif
+
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAssetImageGeneratorApertureModeCleanAperture, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioTimePitchAlgorithmSpectral, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioTimePitchAlgorithmVarispeed, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureDeviceWasConnectedNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureDeviceWasDisconnectedNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVFileTypeMPEG4, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVLayerVideoGravityResize, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVLayerVideoGravityResizeAspect, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVLayerVideoGravityResizeAspectFill, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicAudible, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicContainsOnlyForcedSubtitles, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicDescribesMusicAndSoundForAccessibility, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicDescribesVideoForAccessibility, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicEasyToRead, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicIsAuxiliaryContent, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicIsMainProgramContent, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicLegible, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicTranscribesSpokenDialogForAccessibility, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaCharacteristicVisual, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaTypeAudio, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaTypeClosedCaption, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaTypeMetadata, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaTypeMuxed, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaTypeSubtitle, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMediaTypeVideo, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataCommonKeyTitle, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataKeySpaceCommon, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataKeySpaceID3, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataKeySpaceISOUserData, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataKeySpaceQuickTimeMetadata, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataKeySpaceQuickTimeUserData, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVMetadataKeySpaceiTunes, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVOutOfBandAlternateTrackDisplayNameKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVOutOfBandAlternateTrackExtendedLanguageTagKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVOutOfBandAlternateTrackIdentifierKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVOutOfBandAlternateTrackIsDefaultKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVOutOfBandAlternateTrackMediaCharactersticsKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVOutOfBandAlternateTrackSourceKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPlayerItemDidPlayToEndTimeNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferDisplayLayerFailedToDecodeNotification, NSString*, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferDisplayLayerFailedToDecodeNotificationErrorKey, NSString*, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVStreamDataParserContentKeyRequestProtocolVersionsKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVStreamSessionContentProtectionSessionIdentifierChangedNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVStreamingKeyDeliveryContentKeyType, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetCacheKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetInheritURIQueryComponentFromReferencingURIKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetOutOfBandAlternateTracksKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetReferenceRestrictionsKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetUsesNoPersistentCacheKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoAverageBitRateKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoCodecH264, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoCodecKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoCompressionPropertiesKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoExpectedSourceFrameRateKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoHeightKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoMaxKeyFrameIntervalKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoProfileLevelH264MainAutoLevel, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoProfileLevelKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoWidthKey, NSString *, PAL_EXPORT)
+
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVContentKeyRequestProtocolVersionsKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVContentKeySystemFairPlayStreaming, NSString*, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVEncoderBitRateKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVFormatIDKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVNumberOfChannelsKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVSampleRateKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetOutOfBandMIMETypeKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetUseClientURLLoadingExclusively, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVVideoCodecTypeHEVCWithAlpha, NSString *, PAL_EXPORT)
+
+#if PLATFORM(IOS_FAMILY)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionCategoryAmbient, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionCategoryAudioProcessing, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionCategoryPlayAndRecord, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionCategoryPlayback, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionCategoryRecord, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionCategorySoloAmbient, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionInterruptionNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionInterruptionOptionKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionInterruptionTypeKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionMediaServicesWereResetNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionModeDefault, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionModeVideoChat, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureSessionErrorKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureSessionInterruptionEndedNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureSessionInterruptionReasonKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureSessionRuntimeErrorNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVCaptureSessionWasInterruptedNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVRouteDetectorMultipleRoutesDetectedDidChangeNotification, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetBoundNetworkInterfaceName, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetClientBundleIdentifierKey, NSString *, PAL_EXPORT)
+
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetHTTPCookiesKey, NSString *, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVURLAssetRequiresCustomURLLoadingKey, NSString *, PAL_EXPORT)
+#endif
+
+#endif // USE(AVFOUNDATION)
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -100,6 +100,7 @@
</span><span class="cx">          0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */; };
</span><span class="cx">          070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E09181875ED93003A1D3C /* PlatformMediaSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          070E81D11BF27656001FDA48 /* VideoTrackPrivateMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E81D01BF27656001FDA48 /* VideoTrackPrivateMediaStream.h */; };
</span><ins>+               CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA79825170A279000D45C55 /* AudioSessionIOS.mm */; };
</ins><span class="cx">           070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */; };
</span><span class="cx">          0719427F1D088F21002AA51D /* AVFoundationMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */; };
</span><span class="cx">          071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 071A9EC0168FB56C002629F9 /* TextTrackCueGeneric.cpp */; };
</span><span class="lines">@@ -4079,7 +4080,6 @@
</span><span class="cx">          CDA29A321CC01A9500901CCF /* PlaybackSessionInterfaceAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA29A2E1CBF73FC00901CCF /* PlaybackSessionInterfaceAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          CDA595932146DEC300A84185 /* HEVCUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA595912146DEC300A84185 /* HEVCUtilities.h */; };
</span><span class="cx">          CDA595982146DF7800A84185 /* HEVCUtilitiesCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA595962146DF7800A84185 /* HEVCUtilitiesCocoa.h */; };
</span><del>-               CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA79825170A279000D45C55 /* AudioSessionIOS.mm */; };
</del><span class="cx">           CDA7982A170A3D0000D45C55 /* AudioSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA79821170A22DC00D45C55 /* AudioSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */; };
</span><span class="cx">          CDAB6D2917C7DE6C00C60B34 /* MediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2717C7DE6C00C60B34 /* MediaControlsHost.h */; };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosAudioSessionIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -34,30 +34,9 @@
</span><span class="cx"> #import <pal/spi/mac/AVFoundationSPI.h>
</span><span class="cx"> #import <wtf/OSObjectPtr.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVAudioSession)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionCategoryAmbient, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionCategorySoloAmbient, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionCategoryPlayback, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionCategoryRecord, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionCategoryPlayAndRecord, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionCategoryAudioProcessing, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionModeDefault, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionModeVideoChat, NSString *)
-
-#define AVAudioSession getAVAudioSessionClass()
-#define AVAudioSessionCategoryAmbient getAVAudioSessionCategoryAmbient()
-#define AVAudioSessionCategorySoloAmbient getAVAudioSessionCategorySoloAmbient()
-#define AVAudioSessionCategoryPlayback getAVAudioSessionCategoryPlayback()
-#define AVAudioSessionCategoryRecord getAVAudioSessionCategoryRecord()
-#define AVAudioSessionCategoryPlayAndRecord getAVAudioSessionCategoryPlayAndRecord()
-#define AVAudioSessionCategoryAudioProcessing getAVAudioSessionCategoryAudioProcessing()
-#define AVAudioSessionModeDefault getAVAudioSessionModeDefault()
-#define AVAudioSessionModeVideoChat getAVAudioSessionModeVideoChat()
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="lines">@@ -145,7 +124,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     NSError *error = nil;
</span><del>-    [[AVAudioSession sharedInstance] setCategory:categoryString mode:categoryMode routeSharingPolicy:static_cast<AVAudioSessionRouteSharingPolicy>(policy) options:options error:&error];
</del><ins>+    [[PAL::getAVAudioSessionClass() sharedInstance] setCategory:categoryString mode:categoryMode routeSharingPolicy:static_cast<AVAudioSessionRouteSharingPolicy>(policy) options:options error:&error];
</ins><span class="cx"> #if !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(IOSMAC)
</span><span class="cx">     ASSERT(!error);
</span><span class="cx"> #endif
</span><span class="lines">@@ -153,7 +132,7 @@
</span><span class="cx"> 
</span><span class="cx"> AudioSession::CategoryType AudioSession::category() const
</span><span class="cx"> {
</span><del>-    NSString *categoryString = [[AVAudioSession sharedInstance] category];
</del><ins>+    NSString *categoryString = [[PAL::getAVAudioSessionClass() sharedInstance] category];
</ins><span class="cx">     if ([categoryString isEqual:AVAudioSessionCategoryAmbient])
</span><span class="cx">         return AmbientSound;
</span><span class="cx">     if ([categoryString isEqual:AVAudioSessionCategorySoloAmbient])
</span><span class="lines">@@ -182,7 +161,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     static_assert(static_cast<size_t>(RouteSharingPolicy::Independent) == static_cast<size_t>(AVAudioSessionRouteSharingPolicyIndependent), "RouteSharingPolicy::Independent is not AVAudioSessionRouteSharingPolicyIndependent as expected");
</span><span class="cx"> 
</span><del>-    AVAudioSessionRouteSharingPolicy policy = [[AVAudioSession sharedInstance] routeSharingPolicy];
</del><ins>+    AVAudioSessionRouteSharingPolicy policy = [[PAL::getAVAudioSessionClass() sharedInstance] routeSharingPolicy];
</ins><span class="cx">     ASSERT(static_cast<RouteSharingPolicy>(policy) <= RouteSharingPolicy::LongFormVideo);
</span><span class="cx">     return static_cast<RouteSharingPolicy>(policy);
</span><span class="cx"> }
</span><span class="lines">@@ -190,7 +169,7 @@
</span><span class="cx"> String AudioSession::routingContextUID() const
</span><span class="cx"> {
</span><span class="cx"> #if !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(IOSMAC) && !PLATFORM(WATCHOS)
</span><del>-    return [[AVAudioSession sharedInstance] routingContextUID];
</del><ins>+    return [[PAL::getAVAudioSessionClass() sharedInstance] routingContextUID];
</ins><span class="cx"> #else
</span><span class="cx">     return emptyString();
</span><span class="cx"> #endif
</span><span class="lines">@@ -212,17 +191,17 @@
</span><span class="cx"> 
</span><span class="cx"> float AudioSession::sampleRate() const
</span><span class="cx"> {
</span><del>-    return [[AVAudioSession sharedInstance] sampleRate];
</del><ins>+    return [[PAL::getAVAudioSessionClass() sharedInstance] sampleRate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t AudioSession::bufferSize() const
</span><span class="cx"> {
</span><del>-    return [[AVAudioSession sharedInstance] IOBufferDuration] * sampleRate();
</del><ins>+    return [[PAL::getAVAudioSessionClass() sharedInstance] IOBufferDuration] * sampleRate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t AudioSession::numberOfOutputChannels() const
</span><span class="cx"> {
</span><del>-    return [[AVAudioSession sharedInstance] outputNumberOfChannels];
</del><ins>+    return [[PAL::getAVAudioSessionClass() sharedInstance] outputNumberOfChannels];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AudioSession::tryToSetActiveInternal(bool active)
</span><span class="lines">@@ -237,7 +216,7 @@
</span><span class="cx">     // returns, so do it synchronously on the same serial queue.
</span><span class="cx">     if (active) {
</span><span class="cx">         dispatch_sync(m_private->m_dispatchQueue.get(), ^{
</span><del>-            [[AVAudioSession sharedInstance] setActive:YES withOptions:0 error:&error];
</del><ins>+            [[PAL::getAVAudioSessionClass() sharedInstance] setActive:YES withOptions:0 error:&error];
</ins><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         return !error;
</span><span class="lines">@@ -244,7 +223,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     dispatch_async(m_private->m_dispatchQueue.get(), ^{
</span><del>-        [[AVAudioSession sharedInstance] setActive:NO withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:&error];
</del><ins>+        [[PAL::getAVAudioSessionClass() sharedInstance] setActive:NO withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:&error];
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -252,7 +231,7 @@
</span><span class="cx"> 
</span><span class="cx"> size_t AudioSession::preferredBufferSize() const
</span><span class="cx"> {
</span><del>-    return [[AVAudioSession sharedInstance] preferredIOBufferDuration] * sampleRate();
</del><ins>+    return [[PAL::getAVAudioSessionClass() sharedInstance] preferredIOBufferDuration] * sampleRate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AudioSession::setPreferredBufferSize(size_t bufferSize)
</span><span class="lines">@@ -259,7 +238,7 @@
</span><span class="cx"> {
</span><span class="cx">     NSError *error = nil;
</span><span class="cx">     float duration = bufferSize / sampleRate();
</span><del>-    [[AVAudioSession sharedInstance] setPreferredIOBufferDuration:duration error:&error];
</del><ins>+    [[PAL::getAVAudioSessionClass() sharedInstance] setPreferredIOBufferDuration:duration error:&error];
</ins><span class="cx">     ASSERT(!error);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -45,13 +45,13 @@
</span><span class="cx"> #import <wtf/RAMSize.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVAudioSession)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionInterruptionNotification, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionInterruptionTypeKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionInterruptionOptionKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVRouteDetectorMultipleRoutesDetectedDidChangeNotification, NSString *)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><ins>+WEBCORE_EXPORT NSString* WebUIApplicationWillResignActiveNotification = @"WebUIApplicationWillResignActiveNotification";
+WEBCORE_EXPORT NSString* WebUIApplicationWillEnterForegroundNotification = @"WebUIApplicationWillEnterForegroundNotification";
+WEBCORE_EXPORT NSString* WebUIApplicationDidBecomeActiveNotification = @"WebUIApplicationDidBecomeActiveNotification";
+WEBCORE_EXPORT NSString* WebUIApplicationDidEnterBackgroundNotification = @"WebUIApplicationDidEnterBackgroundNotification";
+
</ins><span class="cx"> #if HAVE(CELESTIAL)
</span><span class="cx"> SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(Celestial)
</span><span class="cx"> SOFT_LINK_CLASS_OPTIONAL(Celestial, AVSystemController)
</span><span class="lines">@@ -58,20 +58,6 @@
</span><span class="cx"> SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_PIDToInheritApplicationStateFrom, NSString *)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if HAVE(MEDIA_PLAYER) && !PLATFORM(WATCHOS)
-SOFT_LINK_CLASS(AVFoundation, AVRouteDetector)
-#endif
-
-#define AVAudioSession getAVAudioSessionClass()
-#define AVAudioSessionInterruptionNotification getAVAudioSessionInterruptionNotification()
-#define AVAudioSessionInterruptionTypeKey getAVAudioSessionInterruptionTypeKey()
-#define AVAudioSessionInterruptionOptionKey getAVAudioSessionInterruptionOptionKey()
-
-WEBCORE_EXPORT NSString* WebUIApplicationWillResignActiveNotification = @"WebUIApplicationWillResignActiveNotification";
-WEBCORE_EXPORT NSString* WebUIApplicationWillEnterForegroundNotification = @"WebUIApplicationWillEnterForegroundNotification";
-WEBCORE_EXPORT NSString* WebUIApplicationDidBecomeActiveNotification = @"WebUIApplicationDidBecomeActiveNotification";
-WEBCORE_EXPORT NSString* WebUIApplicationDidEnterBackgroundNotification = @"WebUIApplicationDidEnterBackgroundNotification";
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface WebMediaSessionHelper : NSObject {
</span><span class="lines">@@ -217,7 +203,7 @@
</span><span class="cx">     _callback = callback;
</span><span class="cx"> 
</span><span class="cx">     NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
</span><del>-    [center addObserver:self selector:@selector(interruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];
</del><ins>+    [center addObserver:self selector:@selector(interruption:) name:AVAudioSessionInterruptionNotification object:[PAL::getAVAudioSessionClass() sharedInstance]];
</ins><span class="cx"> 
</span><span class="cx">     [center addObserver:self selector:@selector(applicationWillEnterForeground:) name:PAL::get_UIKit_UIApplicationWillEnterForegroundNotification() object:nil];
</span><span class="cx">     [center addObserver:self selector:@selector(applicationWillEnterForeground:) name:WebUIApplicationWillEnterForegroundNotification object:nil];
</span><span class="lines">@@ -300,9 +286,9 @@
</span><span class="cx"> 
</span><span class="cx">         if (protectedSelf->_callback) {
</span><span class="cx">             BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-            protectedSelf->_routeDetector = adoptNS([allocAVRouteDetectorInstance() init]);
</del><ins>+            protectedSelf->_routeDetector = adoptNS([PAL::allocAVRouteDetectorInstance() init]);
</ins><span class="cx">             protectedSelf->_routeDetector.get().routeDetectionEnabled = protectedSelf->_monitoringAirPlayRoutes;
</span><del>-            [[NSNotificationCenter defaultCenter] addObserver:protectedSelf selector:@selector(wirelessRoutesAvailableDidChange:) name:getAVRouteDetectorMultipleRoutesDetectedDidChangeNotification() object:protectedSelf->_routeDetector.get()];
</del><ins>+            [[NSNotificationCenter defaultCenter] addObserver:protectedSelf selector:@selector(wirelessRoutesAvailableDidChange:) name:AVRouteDetectorMultipleRoutesDetectedDidChangeNotification object:protectedSelf->_routeDetector.get()];
</ins><span class="cx">             END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationAVTrackPrivateAVFObjCImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm 2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm    2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -35,38 +35,14 @@
</span><span class="cx"> #import <AVFoundation/AVPlayerItem.h>
</span><span class="cx"> #import <AVFoundation/AVPlayerItemTrack.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
+
</ins><span class="cx"> @class AVMediaSelectionOption;
</span><span class="cx"> @interface AVMediaSelectionOption (WebKitInternal)
</span><span class="cx"> - (id)optionID;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS(AVFoundation, AVAssetTrack)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerItem)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerItemTrack)
-SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionGroup)
-SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionOption)
-SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
-
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMediaCharacteristicIsMainProgramContent, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMediaCharacteristicDescribesVideoForAccessibility, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMediaCharacteristicIsAuxiliaryContent, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMediaCharacteristicTranscribesSpokenDialogForAccessibility, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMetadataCommonKeyTitle, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMetadataKeySpaceCommon, NSString *)
-
-#define AVMetadataItem getAVMetadataItemClass()
-
-#define AVMediaCharacteristicIsMainProgramContent getAVMediaCharacteristicIsMainProgramContent()
-#define AVMediaCharacteristicDescribesVideoForAccessibility getAVMediaCharacteristicDescribesVideoForAccessibility()
-#define AVMediaCharacteristicIsAuxiliaryContent getAVMediaCharacteristicIsAuxiliaryContent()
-#define AVMediaCharacteristicTranscribesSpokenDialogForAccessibility getAVMediaCharacteristicTranscribesSpokenDialogForAccessibility()
-#define AVMetadataCommonKeyTitle getAVMetadataCommonKeyTitle()
-#define AVMetadataKeySpaceCommon getAVMetadataKeySpaceCommon()
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> AVTrackPrivateAVFObjCImpl::AVTrackPrivateAVFObjCImpl(AVPlayerItemTrack* track)
</span><span class="lines">@@ -112,11 +88,11 @@
</span><span class="cx"> AudioTrackPrivate::Kind AVTrackPrivateAVFObjCImpl::audioKind() const
</span><span class="cx"> {
</span><span class="cx">     if (m_assetTrack) {
</span><del>-        if (canLoadAVMediaCharacteristicIsAuxiliaryContent() && [m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</del><ins>+        if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</ins><span class="cx">             return AudioTrackPrivate::Alternative;
</span><del>-        if (canLoadAVMediaCharacteristicDescribesVideoForAccessibility() && [m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</del><ins>+        if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</ins><span class="cx">             return AudioTrackPrivate::Description;
</span><del>-        if (canLoadAVMediaCharacteristicIsMainProgramContent() && [m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</del><ins>+        if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</ins><span class="cx">             return AudioTrackPrivate::Main;
</span><span class="cx">         return AudioTrackPrivate::None;
</span><span class="cx">     }
</span><span class="lines">@@ -123,11 +99,11 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_mediaSelectionOption) {
</span><span class="cx">         AVMediaSelectionOption *option = m_mediaSelectionOption->avMediaSelectionOption();
</span><del>-        if (canLoadAVMediaCharacteristicIsAuxiliaryContent() && [option hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</del><ins>+        if ([option hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</ins><span class="cx">             return AudioTrackPrivate::Alternative;
</span><del>-        if (canLoadAVMediaCharacteristicDescribesVideoForAccessibility() && [option hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</del><ins>+        if ([option hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</ins><span class="cx">             return AudioTrackPrivate::Description;
</span><del>-        if (canLoadAVMediaCharacteristicIsMainProgramContent() && [option hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</del><ins>+        if ([option hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</ins><span class="cx">             return AudioTrackPrivate::Main;
</span><span class="cx">         return AudioTrackPrivate::None;
</span><span class="cx">     }
</span><span class="lines">@@ -139,13 +115,13 @@
</span><span class="cx"> VideoTrackPrivate::Kind AVTrackPrivateAVFObjCImpl::videoKind() const
</span><span class="cx"> {
</span><span class="cx">     if (m_assetTrack) {
</span><del>-        if (canLoadAVMediaCharacteristicDescribesVideoForAccessibility() && [m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</del><ins>+        if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</ins><span class="cx">             return VideoTrackPrivate::Sign;
</span><del>-        if (canLoadAVMediaCharacteristicTranscribesSpokenDialogForAccessibility() && [m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility])
</del><ins>+        if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility])
</ins><span class="cx">             return VideoTrackPrivate::Captions;
</span><del>-        if (canLoadAVMediaCharacteristicIsAuxiliaryContent() && [m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</del><ins>+        if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</ins><span class="cx">             return VideoTrackPrivate::Alternative;
</span><del>-        if (canLoadAVMediaCharacteristicIsMainProgramContent() && [m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</del><ins>+        if ([m_assetTrack hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</ins><span class="cx">             return VideoTrackPrivate::Main;
</span><span class="cx">         return VideoTrackPrivate::None;
</span><span class="cx">     }
</span><span class="lines">@@ -152,13 +128,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_mediaSelectionOption) {
</span><span class="cx">         AVMediaSelectionOption *option = m_mediaSelectionOption->avMediaSelectionOption();
</span><del>-        if (canLoadAVMediaCharacteristicDescribesVideoForAccessibility() && [option hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</del><ins>+        if ([option hasMediaCharacteristic:AVMediaCharacteristicDescribesVideoForAccessibility])
</ins><span class="cx">             return VideoTrackPrivate::Sign;
</span><del>-        if (canLoadAVMediaCharacteristicTranscribesSpokenDialogForAccessibility() && [option hasMediaCharacteristic:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility])
</del><ins>+        if ([option hasMediaCharacteristic:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility])
</ins><span class="cx">             return VideoTrackPrivate::Captions;
</span><del>-        if (canLoadAVMediaCharacteristicIsAuxiliaryContent() && [option hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</del><ins>+        if ([option hasMediaCharacteristic:AVMediaCharacteristicIsAuxiliaryContent])
</ins><span class="cx">             return VideoTrackPrivate::Alternative;
</span><del>-        if (canLoadAVMediaCharacteristicIsMainProgramContent() && [option hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</del><ins>+        if ([option hasMediaCharacteristic:AVMediaCharacteristicIsMainProgramContent])
</ins><span class="cx">             return VideoTrackPrivate::Main;
</span><span class="cx">         return VideoTrackPrivate::None;
</span><span class="cx">     }
</span><span class="lines">@@ -189,9 +165,6 @@
</span><span class="cx"> 
</span><span class="cx"> AtomicString AVTrackPrivateAVFObjCImpl::label() const
</span><span class="cx"> {
</span><del>-    if (!canLoadAVMetadataCommonKeyTitle() || !canLoadAVMetadataKeySpaceCommon())
-        return emptyAtom();
-
</del><span class="cx">     NSArray *commonMetadata = nil;
</span><span class="cx">     if (m_assetTrack)
</span><span class="cx">         commonMetadata = [m_assetTrack commonMetadata];
</span><span class="lines">@@ -200,12 +173,12 @@
</span><span class="cx">     else
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span><del>-    NSArray *titles = [AVMetadataItem metadataItemsFromArray:commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
</del><ins>+    NSArray *titles = [PAL::getAVMetadataItemClass() metadataItemsFromArray:commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
</ins><span class="cx">     if (![titles count])
</span><span class="cx">         return emptyAtom();
</span><span class="cx"> 
</span><span class="cx">     // If possible, return a title in one of the user's preferred languages.
</span><del>-    NSArray *titlesForPreferredLanguages = [AVMetadataItem metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
</del><ins>+    NSArray *titlesForPreferredLanguages = [PAL::getAVMetadataItemClass() metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
</ins><span class="cx">     if ([titlesForPreferredLanguages count])
</span><span class="cx">         return [[titlesForPreferredLanguages objectAtIndex:0] stringValue];
</span><span class="cx">     return [[titles objectAtIndex:0] stringValue];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationAudioSourceProviderAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -48,15 +48,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
</del><span class="cx"> SOFT_LINK_FRAMEWORK(MediaToolbox)
</span><span class="cx"> SOFT_LINK_FRAMEWORK(AudioToolbox)
</span><span class="cx"> 
</span><del>-SOFT_LINK_CLASS(AVFoundation, AVPlayerItem)
-SOFT_LINK_CLASS(AVFoundation, AVMutableAudioMix)
-SOFT_LINK_CLASS(AVFoundation, AVMutableAudioMixInputParameters)
-
</del><span class="cx"> SOFT_LINK(AudioToolbox, AudioConverterConvertComplexBuffer, OSStatus, (AudioConverterRef inAudioConverter, UInt32 inNumberPCMFrames, const AudioBufferList* inInputData, AudioBufferList* outOutputData), (inAudioConverter, inNumberPCMFrames, inInputData, outOutputData))
</span><span class="cx"> SOFT_LINK(AudioToolbox, AudioConverterNew, OSStatus, (const AudioStreamBasicDescription* inSourceFormat, const AudioStreamBasicDescription* inDestinationFormat, AudioConverterRef* outAudioConverter), (inSourceFormat, inDestinationFormat, outAudioConverter))
</span><span class="cx"> 
</span><span class="lines">@@ -207,7 +203,7 @@
</span><span class="cx">     ASSERT(m_avPlayerItem);
</span><span class="cx">     ASSERT(m_client);
</span><span class="cx"> 
</span><del>-    m_avAudioMix = adoptNS([allocAVMutableAudioMixInstance() init]);
</del><ins>+    m_avAudioMix = adoptNS([PAL::allocAVMutableAudioMixInstance() init]);
</ins><span class="cx"> 
</span><span class="cx">     MTAudioProcessingTapCallbacks callbacks = {
</span><span class="cx">         0,
</span><span class="lines">@@ -224,7 +220,7 @@
</span><span class="cx">     ASSERT(tap);
</span><span class="cx">     ASSERT(m_tap == tap);
</span><span class="cx"> 
</span><del>-    RetainPtr<AVMutableAudioMixInputParameters> parameters = adoptNS([allocAVMutableAudioMixInputParametersInstance() init]);
</del><ins>+    RetainPtr<AVMutableAudioMixInputParameters> parameters = adoptNS([PAL::allocAVMutableAudioMixInputParametersInstance() init]);
</ins><span class="cx">     [parameters setAudioTapProcessor:m_tap.get()];
</span><span class="cx"> 
</span><span class="cx">     CMPersistentTrackID trackID = m_avAssetTrack.get().trackID;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlaybackTargetMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -30,10 +30,8 @@
</span><span class="cx"> 
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx"> #import <pal/spi/mac/AVFoundationSPI.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVOutputContext)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaSelectionGroupAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -33,19 +33,15 @@
</span><span class="cx"> #import <AVFoundation/AVPlayerItem.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx"> #import <wtf/Language.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> #import <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionGroup)
-SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionOption)
-
</del><span class="cx"> #if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
</span><span class="cx"> #include <MediaAccessibility/MediaAccessibility.h>
</span><span class="cx"> #include "MediaAccessibilitySoftLink.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> Ref<MediaSelectionOptionAVFObjC> MediaSelectionOptionAVFObjC::create(MediaSelectionGroupAVFObjC& group, AVMediaSelectionOption *option)
</span><span class="lines">@@ -106,7 +102,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaSelectionGroupAVFObjC::updateOptions(const Vector<String>& characteristics)
</span><span class="cx"> {
</span><del>-    RetainPtr<NSSet> newAVOptions = adoptNS([[NSSet alloc] initWithArray:[getAVMediaSelectionGroupClass() playableMediaSelectionOptionsFromArray:[m_mediaSelectionGroup options]]]);
</del><ins>+    RetainPtr<NSSet> newAVOptions = adoptNS([[NSSet alloc] initWithArray:[PAL::getAVMediaSelectionGroupClass() playableMediaSelectionOptionsFromArray:[m_mediaSelectionGroup options]]]);
</ins><span class="cx">     RetainPtr<NSMutableSet> oldAVOptions = adoptNS([[NSMutableSet alloc] initWithCapacity:m_options.size()]);
</span><span class="cx">     for (auto& avOption : m_options.keys())
</span><span class="cx">         [oldAVOptions addObject:(__bridge AVMediaSelectionOption *)avOption];
</span><span class="lines">@@ -139,7 +135,7 @@
</span><span class="cx">     RetainPtr<NSMutableArray> nsLanguages = adoptNS([[NSMutableArray alloc] initWithCapacity:userPreferredLanguages().size()]);
</span><span class="cx">     for (auto& language : userPreferredLanguages())
</span><span class="cx">         [nsLanguages addObject:(NSString*)language];
</span><del>-    NSArray* filteredOptions = [getAVMediaSelectionGroupClass() mediaSelectionOptionsFromArray:[m_mediaSelectionGroup options] filteredAndSortedAccordingToPreferredLanguages:nsLanguages.get()];
</del><ins>+    NSArray* filteredOptions = [PAL::getAVMediaSelectionGroupClass() mediaSelectionOptionsFromArray:[m_mediaSelectionGroup options] filteredAndSortedAccordingToPreferredLanguages:nsLanguages.get()];
</ins><span class="cx"> 
</span><span class="cx">     if (![filteredOptions count] && characteristics.isEmpty())
</span><span class="cx">         return;
</span><span class="lines">@@ -152,7 +148,7 @@
</span><span class="cx">     for (auto& characteristic : characteristics)
</span><span class="cx">         [nsCharacteristics addObject:(NSString *)characteristic];
</span><span class="cx"> 
</span><del>-    NSArray* optionsWithCharacteristics = [getAVMediaSelectionGroupClass() mediaSelectionOptionsFromArray:filteredOptions withMediaCharacteristics:nsCharacteristics.get()];
</del><ins>+    NSArray* optionsWithCharacteristics = [PAL::getAVMediaSelectionGroupClass() mediaSelectionOptionsFromArray:filteredOptions withMediaCharacteristics:nsCharacteristics.get()];
</ins><span class="cx">     if (optionsWithCharacteristics && [optionsWithCharacteristics count])
</span><span class="cx">         filteredOptions = optionsWithCharacteristics;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcAVFoundationMIMETypeCachemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -29,18 +29,14 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> 
</span><span class="cx"> #import "ContentType.h"
</span><del>-#import <AVFoundation/AVAsset.h>
</del><span class="cx"> #import <wtf/HashSet.h>
</span><span class="cx"> 
</span><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-#if ENABLE(VIDEO) && USE(AVFOUNDATION)
</del><span class="cx"> #if !PLATFORM(IOSMAC)
</span><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(AVFoundation)
</span><span class="cx"> #endif
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
-#endif
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -85,7 +81,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO) && USE(AVFOUNDATION)
</span><del>-    return [getAVURLAssetClass() isPlayableExtendedMIMEType:mimeType];
</del><ins>+    return [PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:mimeType];
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="lines">@@ -113,10 +109,10 @@
</span><span class="cx"> #if ENABLE(VIDEO) && USE(AVFOUNDATION)
</span><span class="cx">     static std::once_flag onceFlag;
</span><span class="cx">     std::call_once(onceFlag, [this] {
</span><del>-        if (!AVFoundationLibrary())
</del><ins>+        if (!PAL::AVFoundationLibrary())
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        for (NSString* type in [getAVURLAssetClass() audiovisualMIMETypes])
</del><ins>+        for (NSString* type in [PAL::getAVURLAssetClass() audiovisualMIMETypes])
</ins><span class="cx">             m_cache->add(type);
</span><span class="cx"> 
</span><span class="cx">         if (m_cacheTypeCallback)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMInstanceFairPlayStreamingAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -39,19 +39,10 @@
</span><span class="cx"> #import <pal/spi/mac/AVFoundationSPI.h>
</span><span class="cx"> #import <wtf/Algorithms.h>
</span><span class="cx"> #import <wtf/FileSystem.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> #import <wtf/text/StringHash.h>
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVContentKeySession);
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVContentKeyResponse);
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVURLAsset);
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVContentKeySystemFairPlayStreaming, NSString*)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-#if PLATFORM(IOS_FAMILY)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVPersistableContentKeyRequest);
-#endif
-
</del><span class="cx"> static const NSString *PlaybackSessionIdKey = @"PlaybackSessionID";
</span><span class="cx"> 
</span><span class="cx"> @interface WebCoreFPSContentKeySessionDelegate : NSObject<AVContentKeySessionDelegate> {
</span><span class="lines">@@ -138,13 +129,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState()
</span><span class="cx"> {
</span><del>-    return [getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)];
</del><ins>+    return [PAL::getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys()
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><del>-    return getAVPersistableContentKeyRequestClass();
</del><ins>+    return PAL::getAVPersistableContentKeyRequestClass();
</ins><span class="cx"> #else
</span><span class="cx">     return false;
</span><span class="cx"> #endif
</span><span class="lines">@@ -152,7 +143,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability(const CDMMediaCapability& capability)
</span><span class="cx"> {
</span><del>-    if (![getAVURLAssetClass() isPlayableExtendedMIMEType:capability.contentType])
</del><ins>+    if (![PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:capability.contentType])
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // FairPlay only supports 'cbcs' encryption:
</span><span class="lines">@@ -177,7 +168,7 @@
</span><span class="cx">     if (configuration.sessionTypes.contains(CDMSessionType::PersistentLicense) && !supportsPersistentKeys())
</span><span class="cx">         return Failed;
</span><span class="cx"> 
</span><del>-    if (!canLoadAVContentKeySystemFairPlayStreaming())
</del><ins>+    if (!PAL::canLoad_AVFoundation_AVContentKeySystemFairPlayStreaming())
</ins><span class="cx">         return Failed;
</span><span class="cx"> 
</span><span class="cx">     return Succeeded;
</span><span class="lines">@@ -370,7 +361,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         RetainPtr<NSData> appIdentifier = certificate->createNSData();
</span><del>-        [getAVContentKeySessionClass() removePendingExpiredSessionReports:expiredSessions.get() withAppIdentifier:appIdentifier.get() storageDirectoryAtURL:storageURL];
</del><ins>+        [PAL::getAVContentKeySessionClass() removePendingExpiredSessionReports:expiredSessions.get() withAppIdentifier:appIdentifier.get() storageDirectoryAtURL:storageURL];
</ins><span class="cx">         callback(false, { }, WTF::nullopt, WTF::nullopt, Succeeded);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -391,7 +382,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [m_currentRequest processContentKeyResponse:[getAVContentKeyResponseClass() contentKeyResponseWithFairPlayStreamingKeyResponseData:responseData.createNSData().get()]];
</del><ins>+    [m_currentRequest processContentKeyResponse:[PAL::getAVContentKeyResponseClass() contentKeyResponseWithFairPlayStreamingKeyResponseData:responseData.createNSData().get()]];
</ins><span class="cx"> 
</span><span class="cx">     // FIXME(rdar://problem/35592277): stash the callback and call it once AVContentKeyResponse supports a success callback.
</span><span class="cx">     struct objc_method_description method = protocol_getMethodDescription(@protocol(AVContentKeySessionDelegate), @selector(contentKeySession:contentKeyRequestDidSucceed:), NO, YES);
</span><span class="lines">@@ -423,7 +414,7 @@
</span><span class="cx"> 
</span><span class="cx">         RetainPtr<NSData> appIdentifier = certificate->createNSData();
</span><span class="cx">         KeyStatusVector changedKeys;
</span><del>-        for (NSData* expiredSessionData in [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:appIdentifier.get() storageDirectoryAtURL:storageURL]) {
</del><ins>+        for (NSData* expiredSessionData in [PAL::getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:appIdentifier.get() storageDirectoryAtURL:storageURL]) {
</ins><span class="cx">             NSDictionary *expiredSession = [NSPropertyListSerialization propertyListWithData:expiredSessionData options:kCFPropertyListImmutable format:nullptr error:nullptr];
</span><span class="cx">             NSString *playbackSessionIdValue = (NSString *)[expiredSession objectForKey:PlaybackSessionIdKey];
</span><span class="cx">             if (![playbackSessionIdValue isKindOfClass:[NSString class]])
</span><span class="lines">@@ -482,7 +473,7 @@
</span><span class="cx">         RetainPtr<NSData> appIdentifier = certificate->createNSData();
</span><span class="cx">         RetainPtr<NSMutableArray> expiredSessionsArray = adoptNS([[NSMutableArray alloc] init]);
</span><span class="cx">         KeyStatusVector changedKeys;
</span><del>-        for (NSData* expiredSessionData in [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:appIdentifier.get() storageDirectoryAtURL:storageURL]) {
</del><ins>+        for (NSData* expiredSessionData in [PAL::getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:appIdentifier.get() storageDirectoryAtURL:storageURL]) {
</ins><span class="cx">             NSDictionary *expiredSession = [NSPropertyListSerialization propertyListWithData:expiredSessionData options:kCFPropertyListImmutable format:nullptr error:nullptr];
</span><span class="cx">             NSString *playbackSessionIdValue = (NSString *)[expiredSession objectForKey:PlaybackSessionIdKey];
</span><span class="cx">             if (![playbackSessionIdValue isKindOfClass:[NSString class]])
</span><span class="lines">@@ -715,9 +706,9 @@
</span><span class="cx"> 
</span><span class="cx">     auto storageURL = m_instance->storageURL();
</span><span class="cx">     if (!m_instance->persistentStateAllowed() || !storageURL)
</span><del>-        m_session = [getAVContentKeySessionClass() contentKeySessionWithKeySystem:getAVContentKeySystemFairPlayStreaming()];
</del><ins>+        m_session = [PAL::getAVContentKeySessionClass() contentKeySessionWithKeySystem:AVContentKeySystemFairPlayStreaming];
</ins><span class="cx">     else
</span><del>-        m_session = [getAVContentKeySessionClass() contentKeySessionWithKeySystem:getAVContentKeySystemFairPlayStreaming() storageDirectoryAtURL:storageURL];
</del><ins>+        m_session = [PAL::getAVContentKeySessionClass() contentKeySessionWithKeySystem:AVContentKeySystemFairPlayStreaming storageDirectoryAtURL:storageURL];
</ins><span class="cx"> 
</span><span class="cx">     if (!m_session)
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVContentKeySessionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -40,14 +40,8 @@
</span><span class="cx"> #import <objc/objc-runtime.h>
</span><span class="cx"> #import <pal/spi/mac/AVFoundationSPI.h>
</span><span class="cx"> #import <wtf/FileSystem.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVStreamDataParser);
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVContentKeySession);
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVContentKeyResponse);
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVContentKeyRequestProtocolVersionsKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVContentKeySystemFairPlayStreaming, NSString *)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><span class="cx"> typedef NSString *AVContentKeySystem;
</span><span class="cx"> 
</span><span class="lines">@@ -127,7 +121,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool CDMSessionAVContentKeySession::isAvailable()
</span><span class="cx"> {
</span><del>-    return getAVContentKeySessionClass();
</del><ins>+    return PAL::getAVContentKeySessionClass();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<Uint8Array> CDMSessionAVContentKeySession::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
</span><span class="lines">@@ -173,7 +167,7 @@
</span><span class="cx">         if (!m_certificate)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        if (![getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)])
</del><ins>+        if (![PAL::getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)])
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         auto storagePath = this->storagePath();
</span><span class="lines">@@ -181,7 +175,7 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]);
</span><del>-        NSArray* expiredSessions = [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</del><ins>+        NSArray* expiredSessions = [PAL::getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</ins><span class="cx">         for (NSData* expiredSessionData in expiredSessions) {
</span><span class="cx">             NSDictionary *expiredSession = [NSPropertyListSerialization propertyListWithData:expiredSessionData options:kCFPropertyListImmutable format:nullptr error:nullptr];
</span><span class="cx">             NSString *playbackSessionIdValue = (NSString *)[expiredSession objectForKey:PlaybackSessionIdKey];
</span><span class="lines">@@ -229,8 +223,8 @@
</span><span class="cx"> 
</span><span class="cx">         RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]);
</span><span class="cx"> 
</span><del>-        if ([getAVContentKeySessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)])
-            [getAVContentKeySessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</del><ins>+        if ([PAL::getAVContentKeySessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)])
+            [PAL::getAVContentKeySessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</ins><span class="cx">         m_expiredSession = nullptr;
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="lines">@@ -284,7 +278,7 @@
</span><span class="cx">         RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]);
</span><span class="cx"> 
</span><span class="cx">         RetainPtr<NSDictionary> options;
</span><del>-        if (!m_protocolVersions.isEmpty() && canLoadAVContentKeyRequestProtocolVersionsKey()) {
</del><ins>+        if (!m_protocolVersions.isEmpty() && PAL::canLoad_AVFoundation_AVContentKeyRequestProtocolVersionsKey()) {
</ins><span class="cx">             RetainPtr<NSMutableArray> protocolVersionsOption = adoptNS([[NSMutableArray alloc] init]);
</span><span class="cx">             for (auto& version : m_protocolVersions) {
</span><span class="cx">                 if (!version)
</span><span class="lines">@@ -292,7 +286,7 @@
</span><span class="cx">                 [protocolVersionsOption addObject:@(version)];
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            options = @{ getAVContentKeyRequestProtocolVersionsKey(): protocolVersionsOption.get() };
</del><ins>+            options = @{ AVContentKeyRequestProtocolVersionsKey: protocolVersionsOption.get() };
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         errorCode = MediaPlayer::NoError;
</span><span class="lines">@@ -316,8 +310,8 @@
</span><span class="cx">     systemCode = 0;
</span><span class="cx">     RetainPtr<NSData> keyData = adoptNS([[NSData alloc] initWithBytes:key->data() length:key->length()]);
</span><span class="cx">     
</span><del>-    if ([m_keyRequest respondsToSelector:@selector(processContentKeyResponse:)] && [getAVContentKeyResponseClass() respondsToSelector:@selector(contentKeyResponseWithFairPlayStreamingKeyResponseData:)])
-        [m_keyRequest processContentKeyResponse:[getAVContentKeyResponseClass() contentKeyResponseWithFairPlayStreamingKeyResponseData:keyData.get()]];
</del><ins>+    if ([m_keyRequest respondsToSelector:@selector(processContentKeyResponse:)] && [PAL::getAVContentKeyResponseClass() respondsToSelector:@selector(contentKeyResponseWithFairPlayStreamingKeyResponseData:)])
+        [m_keyRequest processContentKeyResponse:[PAL::getAVContentKeyResponseClass() contentKeyResponseWithFairPlayStreamingKeyResponseData:keyData.get()]];
</ins><span class="cx">     else
</span><span class="cx">         [m_keyRequest processContentKeyResponseData:keyData.get()];
</span><span class="cx"> 
</span><span class="lines">@@ -346,13 +340,13 @@
</span><span class="cx">     RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]);
</span><span class="cx"> 
</span><span class="cx">     String storagePath = this->storagePath();
</span><del>-    if (storagePath.isEmpty() || ![getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) {
</del><ins>+    if (storagePath.isEmpty() || ![PAL::getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) {
</ins><span class="cx">         errorCode = MediaPlayer::KeySystemNotSupported;
</span><span class="cx">         systemCode = '!mor';
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    NSArray* expiredSessions = [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</del><ins>+    NSArray* expiredSessions = [PAL::getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</ins><span class="cx">     if (![expiredSessions count]) {
</span><span class="cx">         LOG(Media, "CDMSessionAVContentKeySession::generateKeyReleaseMessage(%p) - no expired sessions found", this);
</span><span class="cx"> 
</span><span class="lines">@@ -381,10 +375,10 @@
</span><span class="cx"> 
</span><span class="cx">     String storagePath = this->storagePath();
</span><span class="cx">     if (storagePath.isEmpty()) {
</span><del>-        if (![getAVContentKeySessionClass() respondsToSelector:@selector(contentKeySessionWithKeySystem:)] || !canLoadAVContentKeySystemFairPlayStreaming())
</del><ins>+        if (![PAL::getAVContentKeySessionClass() respondsToSelector:@selector(contentKeySessionWithKeySystem:)] || !PAL::canLoad_AVFoundation_AVContentKeySystemFairPlayStreaming())
</ins><span class="cx">             return nil;
</span><span class="cx"> 
</span><del>-        m_contentKeySession = [getAVContentKeySessionClass() contentKeySessionWithKeySystem:getAVContentKeySystemFairPlayStreaming()];
</del><ins>+        m_contentKeySession = [PAL::getAVContentKeySessionClass() contentKeySessionWithKeySystem:AVContentKeySystemFairPlayStreaming];
</ins><span class="cx">     } else {
</span><span class="cx">         String storageDirectory = FileSystem::directoryName(storagePath);
</span><span class="cx"> 
</span><span class="lines">@@ -394,10 +388,10 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         auto url = [NSURL fileURLWithPath:storagePath];
</span><del>-        if ([getAVContentKeySessionClass() respondsToSelector:@selector(contentKeySessionWithKeySystem:storageDirectoryAtURL:)] && canLoadAVContentKeySystemFairPlayStreaming())
-            m_contentKeySession = [getAVContentKeySessionClass() contentKeySessionWithKeySystem:getAVContentKeySystemFairPlayStreaming() storageDirectoryAtURL:url];
</del><ins>+        if ([PAL::getAVContentKeySessionClass() respondsToSelector:@selector(contentKeySessionWithKeySystem:storageDirectoryAtURL:)] && PAL::canLoad_AVFoundation_AVContentKeySystemFairPlayStreaming())
+            m_contentKeySession = [PAL::getAVContentKeySessionClass() contentKeySessionWithKeySystem:AVContentKeySystemFairPlayStreaming storageDirectoryAtURL:url];
</ins><span class="cx">         else
</span><del>-            m_contentKeySession = adoptNS([allocAVContentKeySessionInstance() initWithStorageDirectoryAtURL:url]);
</del><ins>+            m_contentKeySession = adoptNS([PAL::allocAVContentKeySessionInstance() initWithStorageDirectoryAtURL:url]);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_contentKeySession.get().delegate = m_contentKeySessionDelegate.get();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm   2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm      2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -41,12 +41,6 @@
</span><span class="cx"> #import <wtf/SoftLinking.h>
</span><span class="cx"> #import <wtf/UUID.h>
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
-SOFT_LINK_CLASS(AVFoundation, AVAssetResourceLoadingRequest)
-#define AVURLAsset getAVURLAssetClass()
-#define AVAssetResourceLoadingRequest getAVAssetResourceLoadingRequest()
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent, LegacyCDMSessionClient* client)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVStreamSessionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -40,14 +40,9 @@
</span><span class="cx"> #import <objc/objc-runtime.h>
</span><span class="cx"> #import <pal/spi/mac/AVFoundationSPI.h>
</span><span class="cx"> #import <wtf/FileSystem.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> #import <wtf/UUID.h>
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVStreamDataParser);
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVStreamSession);
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVStreamDataParserContentKeyRequestProtocolVersionsKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVStreamSessionContentProtectionSessionIdentifierChangedNotification, NSString *)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><span class="cx"> @interface AVStreamSession : NSObject
</span><span class="cx"> - (void)addStreamDataParser:(AVStreamDataParser *)streamDataParser;
</span><span class="lines">@@ -142,11 +137,11 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         String storagePath = this->storagePath();
</span><del>-        if (storagePath.isEmpty() || ![getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)])
</del><ins>+        if (storagePath.isEmpty() || ![PAL::getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)])
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]);
</span><del>-        NSArray* expiredSessions = [getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</del><ins>+        NSArray* expiredSessions = [PAL::getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</ins><span class="cx">         for (NSData* expiredSessionData in expiredSessions) {
</span><span class="cx">             NSDictionary *expiredSession = [NSPropertyListSerialization propertyListWithData:expiredSessionData options:kCFPropertyListImmutable format:nullptr error:nullptr];
</span><span class="cx">             NSString *playbackSessionIdValue = (NSString *)[expiredSession objectForKey:PlaybackSessionIdKey];
</span><span class="lines">@@ -200,8 +195,8 @@
</span><span class="cx"> 
</span><span class="cx">         IGNORE_WARNINGS_BEGIN("objc-literal-conversion")
</span><span class="cx">         String storagePath = this->storagePath();
</span><del>-        if (!storagePath.isEmpty() && [getAVStreamSessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)])
-            [getAVStreamSessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</del><ins>+        if (!storagePath.isEmpty() && [PAL::getAVStreamSessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)])
+            [PAL::getAVStreamSessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</ins><span class="cx">         IGNORE_WARNINGS_END
</span><span class="cx">         m_expiredSession = nullptr;
</span><span class="cx">         return true;
</span><span class="lines">@@ -230,7 +225,7 @@
</span><span class="cx">         RetainPtr<NSData> initData = adoptNS([[NSData alloc] initWithBytes:m_initData->data() length:m_initData->length()]);
</span><span class="cx"> 
</span><span class="cx">         RetainPtr<NSDictionary> options;
</span><del>-        if (!m_protocolVersions.isEmpty() && canLoadAVStreamDataParserContentKeyRequestProtocolVersionsKey()) {
</del><ins>+        if (!m_protocolVersions.isEmpty()) {
</ins><span class="cx">             RetainPtr<NSMutableArray> protocolVersionsOption = adoptNS([[NSMutableArray alloc] init]);
</span><span class="cx">             for (auto& version : m_protocolVersions) {
</span><span class="cx">                 if (!version)
</span><span class="lines">@@ -238,7 +233,7 @@
</span><span class="cx">                 [protocolVersionsOption addObject:@(version)];
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            options = @{ getAVStreamDataParserContentKeyRequestProtocolVersionsKey(): protocolVersionsOption.get() };
</del><ins>+            options = @{ AVStreamDataParserContentKeyRequestProtocolVersionsKey: protocolVersionsOption.get() };
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         NSError* error = nil;
</span><span class="lines">@@ -280,8 +275,8 @@
</span><span class="cx"> 
</span><span class="cx"> void CDMSessionAVStreamSession::setStreamSession(AVStreamSession *streamSession)
</span><span class="cx"> {
</span><del>-    if (m_streamSession && canLoadAVStreamSessionContentProtectionSessionIdentifierChangedNotification())
-        [[NSNotificationCenter defaultCenter] removeObserver:m_dataParserObserver.get() name:getAVStreamSessionContentProtectionSessionIdentifierChangedNotification() object:m_streamSession.get()];
</del><ins>+    if (m_streamSession)
+        [[NSNotificationCenter defaultCenter] removeObserver:m_dataParserObserver.get() name:AVStreamSessionContentProtectionSessionIdentifierChangedNotification object:m_streamSession.get()];
</ins><span class="cx"> 
</span><span class="cx">     m_streamSession = streamSession;
</span><span class="cx"> 
</span><span class="lines">@@ -288,8 +283,7 @@
</span><span class="cx">     if (!m_streamSession)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (canLoadAVStreamSessionContentProtectionSessionIdentifierChangedNotification())
-        [[NSNotificationCenter defaultCenter] addObserver:m_dataParserObserver.get() selector:@selector(contentProtectionSessionIdentifierChanged:) name:getAVStreamSessionContentProtectionSessionIdentifierChangedNotification() object:m_streamSession.get()];
</del><ins>+    [[NSNotificationCenter defaultCenter] addObserver:m_dataParserObserver.get() selector:@selector(contentProtectionSessionIdentifierChanged:) name:AVStreamSessionContentProtectionSessionIdentifierChangedNotification object:m_streamSession.get()];
</ins><span class="cx"> 
</span><span class="cx">     NSData* identifier = [streamSession contentProtectionSessionIdentifier];
</span><span class="cx">     RetainPtr<NSString> sessionIdentifierString = identifier ? adoptNS([[NSString alloc] initWithData:identifier encoding:(NSUTF8StringEncoding)]) : nil;
</span><span class="lines">@@ -315,13 +309,13 @@
</span><span class="cx">     RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]);
</span><span class="cx"> 
</span><span class="cx">     String storagePath = this->storagePath();
</span><del>-    if (storagePath.isEmpty() || ![getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) {
</del><ins>+    if (storagePath.isEmpty() || ![PAL::getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) {
</ins><span class="cx">         errorCode = MediaPlayer::KeySystemNotSupported;
</span><span class="cx">         systemCode = '!mor';
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    NSArray* expiredSessions = [getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</del><ins>+    NSArray* expiredSessions = [PAL::getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
</ins><span class="cx">     if (![expiredSessions count]) {
</span><span class="cx">         LOG(Media, "CDMSessionAVStreamSession::generateKeyReleaseMessage(%p) - no expired sessions found", this);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcImageDecoderAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -52,26 +52,13 @@
</span><span class="cx"> #import <wtf/MediaTime.h>
</span><span class="cx"> #import <wtf/NeverDestroyed.h>
</span><span class="cx"> #import <wtf/Optional.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> #import <wtf/Vector.h>
</span><span class="cx"> 
</span><del>-#import <pal/cf/CoreMediaSoftLink.h>
</del><span class="cx"> #import "CoreVideoSoftLink.h"
</span><span class="cx"> #import "VideoToolboxSoftLink.h"
</span><ins>+#import <pal/cf/CoreMediaSoftLink.h>
+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-#pragma mark - Soft Linking
-
-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVURLAsset)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVAssetReader)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVAssetReaderSampleReferenceOutput)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMediaCharacteristicVisual, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVURLAssetReferenceRestrictionsKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVURLAssetUsesNoPersistentCacheKey, NSString *)
-#define AVMediaCharacteristicVisual getAVMediaCharacteristicVisual()
-#define AVURLAssetReferenceRestrictionsKey getAVURLAssetReferenceRestrictionsKey()
-#define AVURLAssetUsesNoPersistentCacheKey getAVURLAssetUsesNoPersistentCacheKey()
-
</del><span class="cx"> #pragma mark -
</span><span class="cx"> 
</span><span class="cx"> @interface WebCoreSharedBufferResourceLoaderDelegate : NSObject<AVAssetResourceLoaderDelegate> {
</span><span class="lines">@@ -238,9 +225,6 @@
</span><span class="cx"> static NSDictionary *imageDecoderAssetOptions()
</span><span class="cx"> {
</span><span class="cx">     static NSDictionary *options = [] {
</span><del>-        // FIXME: Are these keys really optional?
-        if (!canLoadAVURLAssetReferenceRestrictionsKey() || !canLoadAVURLAssetUsesNoPersistentCacheKey())
-            return [@{ } retain];
</del><span class="cx">         return [@{
</span><span class="cx">             AVURLAssetReferenceRestrictionsKey: @(AVAssetReferenceRestrictionForbidAll),
</span><span class="cx">             AVURLAssetUsesNoPersistentCacheKey: @YES,
</span><span class="lines">@@ -366,7 +350,7 @@
</span><span class="cx">     : ImageDecoder()
</span><span class="cx">     , m_mimeType(mimeType)
</span><span class="cx">     , m_uti(WebCore::UTIFromMIMEType(mimeType))
</span><del>-    , m_asset(adoptNS([allocAVURLAssetInstance() initWithURL:customSchemeURL() options:imageDecoderAssetOptions()]))
</del><ins>+    , m_asset(adoptNS([PAL::allocAVURLAssetInstance() initWithURL:customSchemeURL() options:imageDecoderAssetOptions()]))
</ins><span class="cx">     , m_loader(adoptNS([[WebCoreSharedBufferResourceLoaderDelegate alloc] initWithParent:this]))
</span><span class="cx">     , m_decompressionSession(WebCoreDecompressionSession::createRGB())
</span><span class="cx"> {
</span><span class="lines">@@ -399,12 +383,6 @@
</span><span class="cx"> 
</span><span class="cx"> AVAssetTrack *ImageDecoderAVFObjC::firstEnabledTrack()
</span><span class="cx"> {
</span><del>-    // FIXME: Is AVMediaCharacteristicVisual truly optional?
-    if (!canLoadAVMediaCharacteristicVisual()) {
-        LOG(Images, "ImageDecoderAVFObjC::firstEnabledTrack(%p) - AVMediaCharacteristicVisual is not supported", this);
-        return nil;
-    }
-
</del><span class="cx">     NSArray<AVAssetTrack *> *videoTracks = [m_asset tracksWithMediaCharacteristic:AVMediaCharacteristicVisual];
</span><span class="cx">     NSUInteger firstEnabledIndex = [videoTracks indexOfObjectPassingTest:^(AVAssetTrack *track, NSUInteger, BOOL*) {
</span><span class="cx">         return track.enabled;
</span><span class="lines">@@ -423,8 +401,8 @@
</span><span class="cx">     if (!m_sampleData.empty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto assetReader = adoptNS([allocAVAssetReaderInstance() initWithAsset:m_asset.get() error:nil]);
-    auto referenceOutput = adoptNS([allocAVAssetReaderSampleReferenceOutputInstance() initWithTrack:m_track.get()]);
</del><ins>+    auto assetReader = adoptNS([PAL::allocAVAssetReaderInstance() initWithAsset:m_asset.get() error:nil]);
+    auto referenceOutput = adoptNS([PAL::allocAVAssetReaderSampleReferenceOutputInstance() initWithTrack:m_track.get()]);
</ins><span class="cx"> 
</span><span class="cx">     referenceOutput.get().alwaysCopiesSampleData = NO;
</span><span class="cx">     [assetReader addOutput:referenceOutput.get()];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcInbandTextTrackPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -39,43 +39,9 @@
</span><span class="cx"> #import <AVFoundation/AVPlayerItem.h>
</span><span class="cx"> #import <AVFoundation/AVPlayerItemOutput.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_CLASS(AVFoundation, AVPlayer)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerItem)
-SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerItemLegibleOutput)
-#define AVMediaCharacteristicVisual getAVMediaCharacteristicVisual()
-#define AVMediaCharacteristicAudible getAVMediaCharacteristicAudible()
-#define AVMediaTypeClosedCaption getAVMediaTypeClosedCaption()
-#define AVMediaCharacteristicContainsOnlyForcedSubtitles getAVMediaCharacteristicContainsOnlyForcedSubtitles()
-#define AVMediaCharacteristicIsMainProgramContent getAVMediaCharacteristicIsMainProgramContent()
-#define AVMediaCharacteristicEasyToRead getAVMediaCharacteristicEasyToRead()
-
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeClosedCaption, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicLegible, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataCommonKeyTitle, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataKeySpaceCommon, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeSubtitle, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicTranscribesSpokenDialogForAccessibility, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicDescribesMusicAndSoundForAccessibility, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicContainsOnlyForcedSubtitles, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicIsMainProgramContent, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicEasyToRead, NSString *)
-
-#define AVPlayer getAVPlayerClass()
-#define AVPlayerItem getAVPlayerItemClass()
-#define AVMetadataItem getAVMetadataItemClass()
-#define AVPlayerItemLegibleOutput getAVPlayerItemLegibleOutputClass()
-#define AVMediaCharacteristicLegible getAVMediaCharacteristicLegible()
-#define AVMetadataCommonKeyTitle getAVMetadataCommonKeyTitle()
-#define AVMetadataKeySpaceCommon getAVMetadataKeySpaceCommon()
-#define AVMediaTypeSubtitle getAVMediaTypeSubtitle()
-#define AVMediaCharacteristicTranscribesSpokenDialogForAccessibility getAVMediaCharacteristicTranscribesSpokenDialogForAccessibility()
-#define AVMediaCharacteristicDescribesMusicAndSoundForAccessibility getAVMediaCharacteristicDescribesMusicAndSoundForAccessibility()
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> InbandTextTrackPrivateAVFObjC::InbandTextTrackPrivateAVFObjC(AVFInbandTrackParent* player, AVMediaSelectionOption *selection, InbandTextTrackPrivate::CueFormat format)
</span><span class="lines">@@ -170,10 +136,10 @@
</span><span class="cx"> 
</span><span class="cx">     NSString *title = 0;
</span><span class="cx"> 
</span><del>-    NSArray *titles = [AVMetadataItem metadataItemsFromArray:[m_mediaSelectionOption.get() commonMetadata] withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
</del><ins>+    NSArray *titles = [PAL::getAVMetadataItemClass() metadataItemsFromArray:[m_mediaSelectionOption.get() commonMetadata] withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
</ins><span class="cx">     if ([titles count]) {
</span><span class="cx">         // If possible, return a title in one of the user's preferred languages.
</span><del>-        NSArray *titlesForPreferredLanguages = [AVMetadataItem metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
</del><ins>+        NSArray *titlesForPreferredLanguages = [PAL::getAVMetadataItemClass() metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
</ins><span class="cx">         if ([titlesForPreferredLanguages count])
</span><span class="cx">             title = [[titlesForPreferredLanguages objectAtIndex:0] stringValue];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcInbandTextTrackPrivateLegacyAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -33,25 +33,9 @@
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "MediaPlayerPrivateAVFoundationObjC.h"
</span><span class="cx"> #import <objc/runtime.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_CLASS(AVFoundation, AVPlayerItem)
-SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
-#define AVMediaTypeClosedCaption getAVMediaTypeClosedCaption()
-
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeClosedCaption, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicLegible, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataCommonKeyTitle, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataKeySpaceCommon, NSString *)
-
-#define AVPlayerItem getAVPlayerItemClass()
-#define AVMetadataItem getAVMetadataItemClass()
-#define AVMediaCharacteristicLegible getAVMediaCharacteristicLegible()
-#define AVMetadataCommonKeyTitle getAVMetadataCommonKeyTitle()
-#define AVMetadataKeySpaceCommon getAVMetadataKeySpaceCommon()
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> InbandTextTrackPrivateLegacyAVFObjC::InbandTextTrackPrivateLegacyAVFObjC(MediaPlayerPrivateAVFoundationObjC* player, AVPlayerItemTrack* track)
</span><span class="lines">@@ -101,10 +85,10 @@
</span><span class="cx"> 
</span><span class="cx">     NSString *title = 0;
</span><span class="cx"> 
</span><del>-    NSArray *titles = [AVMetadataItem metadataItemsFromArray:[[m_playerItemTrack assetTrack] commonMetadata] withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
</del><ins>+    NSArray *titles = [PAL::getAVMetadataItemClass() metadataItemsFromArray:[[m_playerItemTrack assetTrack] commonMetadata] withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
</ins><span class="cx">     if ([titles count]) {
</span><span class="cx">         // If possible, return a title in one of the user's preferred languages.
</span><del>-        NSArray *titlesForPreferredLanguages = [AVMetadataItem metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
</del><ins>+        NSArray *titlesForPreferredLanguages = [PAL::getAVMetadataItemClass() metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
</ins><span class="cx">         if ([titlesForPreferredLanguages count])
</span><span class="cx">             title = [[titlesForPreferredLanguages objectAtIndex:0] stringValue];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlaybackTargetPickerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm 2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm    2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -37,14 +37,9 @@
</span><span class="cx"> #import <pal/spi/mac/AVFoundationSPI.h>
</span><span class="cx"> #import <wtf/MainThread.h>
</span><span class="cx"> 
</span><del>-typedef AVOutputContext AVOutputContextWKType;
-typedef AVOutputDeviceMenuController AVOutputDeviceMenuControllerWKType;
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> SOFTLINK_AVKIT_FRAMEWORK()
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVOutputContext)
</del><span class="cx"> SOFT_LINK_CLASS_OPTIONAL(AVKit, AVOutputDeviceMenuController)
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -87,7 +82,7 @@
</span><span class="cx">     return WebCore::MediaPlaybackTargetMac::create(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AVOutputDeviceMenuControllerWKType *MediaPlaybackTargetPickerMac::devicePicker()
</del><ins>+AVOutputDeviceMenuController *MediaPlaybackTargetPickerMac::devicePicker()
</ins><span class="cx"> {
</span><span class="cx">     if (!getAVOutputDeviceMenuControllerClass())
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -95,7 +90,7 @@
</span><span class="cx">     if (!m_outputDeviceMenuController) {
</span><span class="cx">         LOG(Media, "MediaPlaybackTargetPickerMac::devicePicker - allocating picker");
</span><span class="cx"> 
</span><del>-        RetainPtr<AVOutputContextWKType> context = adoptNS([allocAVOutputContextInstance() init]);
</del><ins>+        RetainPtr<AVOutputContext> context = adoptNS([PAL::allocAVOutputContextInstance() init]);
</ins><span class="cx">         m_outputDeviceMenuController = adoptNS([allocAVOutputDeviceMenuControllerInstance() initWithOutputContext:context.get()]);
</span><span class="cx"> 
</span><span class="cx">         [m_outputDeviceMenuController.get() addObserver:m_outputDeviceMenuControllerDelegate.get() forKeyPath:externalOutputDeviceAvailableKeyName options:NSKeyValueObservingOptionNew context:nullptr];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm   2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm      2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -136,169 +136,9 @@
</span><span class="cx"> @property (nonatomic, readonly) NSURL *resolvedURL;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-typedef AVPlayer AVPlayerType;
-typedef AVPlayerItem AVPlayerItemType;
-typedef AVPlayerItemLegibleOutput AVPlayerItemLegibleOutputType;
-typedef AVPlayerItemVideoOutput AVPlayerItemVideoOutputType;
-typedef AVMetadataItem AVMetadataItemType;
-typedef AVMediaSelectionGroup AVMediaSelectionGroupType;
-typedef AVMediaSelectionOption AVMediaSelectionOptionType;
-typedef AVAssetCache AVAssetCacheType;
-
-#pragma mark - Soft Linking
-
-// Soft-linking headers must be included last since they #define functions, constants, etc.
</del><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_FRAMEWORK_OPTIONAL(CoreImage)
-
-SOFT_LINK_CLASS(AVFoundation, AVPlayer)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerItem)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerItemVideoOutput)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
-SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
-SOFT_LINK_CLASS(AVFoundation, AVAssetImageGenerator)
-SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
-SOFT_LINK_CLASS(AVFoundation, AVAssetCache)
-
-SOFT_LINK_CLASS(CoreImage, CIContext)
-SOFT_LINK_CLASS(CoreImage, CIImage)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioTimePitchAlgorithmSpectral, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioTimePitchAlgorithmVarispeed, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicVisual, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicAudible, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeClosedCaption, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeVideo, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeAudio, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeMetadata, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVPlayerItemDidPlayToEndTimeNotification, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVURLAssetInheritURIQueryComponentFromReferencingURIKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAssetImageGeneratorApertureModeCleanAperture, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVURLAssetReferenceRestrictionsKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspect, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspectFill, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResize, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVStreamingKeyDeliveryContentKeyType, NSString *)
-
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVURLAssetOutOfBandMIMETypeKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVURLAssetUseClientURLLoadingExclusively, NSString *)
-
-#define AVPlayer initAVPlayer()
-#define AVPlayerItem initAVPlayerItem()
-#define AVPlayerLayer initAVPlayerLayer()
-#define AVURLAsset initAVURLAsset()
-#define AVAssetImageGenerator initAVAssetImageGenerator()
-#define AVPlayerItemVideoOutput initAVPlayerItemVideoOutput()
-#define AVMetadataItem initAVMetadataItem()
-#define AVAssetCache initAVAssetCache()
-
-#define AVAudioTimePitchAlgorithmSpectral getAVAudioTimePitchAlgorithmSpectral()
-#define AVAudioTimePitchAlgorithmVarispeed getAVAudioTimePitchAlgorithmVarispeed()
-#define AVMediaCharacteristicVisual getAVMediaCharacteristicVisual()
-#define AVMediaCharacteristicAudible getAVMediaCharacteristicAudible()
-#define AVMediaTypeClosedCaption getAVMediaTypeClosedCaption()
-#define AVMediaTypeVideo getAVMediaTypeVideo()
-#define AVMediaTypeAudio getAVMediaTypeAudio()
-#define AVMediaTypeMetadata getAVMediaTypeMetadata()
-#define AVPlayerItemDidPlayToEndTimeNotification getAVPlayerItemDidPlayToEndTimeNotification()
-#define AVURLAssetInheritURIQueryComponentFromReferencingURIKey getAVURLAssetInheritURIQueryComponentFromReferencingURIKey()
-#define AVURLAssetOutOfBandMIMETypeKey getAVURLAssetOutOfBandMIMETypeKey()
-#define AVURLAssetUseClientURLLoadingExclusively getAVURLAssetUseClientURLLoadingExclusively()
-#define AVAssetImageGeneratorApertureModeCleanAperture getAVAssetImageGeneratorApertureModeCleanAperture()
-#define AVURLAssetReferenceRestrictionsKey getAVURLAssetReferenceRestrictionsKey()
-#define AVLayerVideoGravityResizeAspect getAVLayerVideoGravityResizeAspect()
-#define AVLayerVideoGravityResizeAspectFill getAVLayerVideoGravityResizeAspectFill()
-#define AVLayerVideoGravityResize getAVLayerVideoGravityResize()
-#define AVStreamingKeyDeliveryContentKeyType getAVStreamingKeyDeliveryContentKeyType()
-
-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-
-typedef AVMediaSelectionGroup AVMediaSelectionGroupType;
-typedef AVMediaSelectionOption AVMediaSelectionOptionType;
-
-SOFT_LINK_CLASS(AVFoundation, AVPlayerItemLegibleOutput)
-SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionGroup)
-SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionOption)
-SOFT_LINK_CLASS(AVFoundation, AVOutputContext)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicLegible, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeSubtitle, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicContainsOnlyForcedSubtitles, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly, NSString *)
-
-#define AVPlayerItemLegibleOutput getAVPlayerItemLegibleOutputClass()
-#define AVMediaSelectionGroup getAVMediaSelectionGroupClass()
-#define AVMediaSelectionOption getAVMediaSelectionOptionClass()
-#define AVMediaCharacteristicLegible getAVMediaCharacteristicLegible()
-#define AVMediaTypeSubtitle getAVMediaTypeSubtitle()
-#define AVMediaCharacteristicContainsOnlyForcedSubtitles getAVMediaCharacteristicContainsOnlyForcedSubtitles()
-#define AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly getAVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly()
-
-#endif
-
-#if ENABLE(AVF_CAPTIONS)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVURLAssetCacheKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVURLAssetOutOfBandAlternateTracksKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVURLAssetUsesNoPersistentCacheKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVOutOfBandAlternateTrackDisplayNameKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVOutOfBandAlternateTrackExtendedLanguageTagKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVOutOfBandAlternateTrackIsDefaultKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVOutOfBandAlternateTrackMediaCharactersticsKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVOutOfBandAlternateTrackIdentifierKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVOutOfBandAlternateTrackSourceKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicDescribesMusicAndSoundForAccessibility, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicTranscribesSpokenDialogForAccessibility, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicIsAuxiliaryContent, NSString *)
-
-#define AVURLAssetOutOfBandAlternateTracksKey getAVURLAssetOutOfBandAlternateTracksKey()
-#define AVURLAssetCacheKey getAVURLAssetCacheKey()
-#define AVURLAssetUsesNoPersistentCacheKey getAVURLAssetUsesNoPersistentCacheKey()
-#define AVOutOfBandAlternateTrackDisplayNameKey getAVOutOfBandAlternateTrackDisplayNameKey()
-#define AVOutOfBandAlternateTrackExtendedLanguageTagKey getAVOutOfBandAlternateTrackExtendedLanguageTagKey()
-#define AVOutOfBandAlternateTrackIsDefaultKey getAVOutOfBandAlternateTrackIsDefaultKey()
-#define AVOutOfBandAlternateTrackMediaCharactersticsKey getAVOutOfBandAlternateTrackMediaCharactersticsKey()
-#define AVOutOfBandAlternateTrackIdentifierKey getAVOutOfBandAlternateTrackIdentifierKey()
-#define AVOutOfBandAlternateTrackSourceKey getAVOutOfBandAlternateTrackSourceKey()
-#define AVMediaCharacteristicDescribesMusicAndSoundForAccessibility getAVMediaCharacteristicDescribesMusicAndSoundForAccessibility()
-#define AVMediaCharacteristicTranscribesSpokenDialogForAccessibility getAVMediaCharacteristicTranscribesSpokenDialogForAccessibility()
-#define AVMediaCharacteristicIsAuxiliaryContent getAVMediaCharacteristicIsAuxiliaryContent()
-
-#endif
-
-#if ENABLE(DATACUE_VALUE)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataKeySpaceQuickTimeUserData, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVMetadataKeySpaceISOUserData, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataKeySpaceQuickTimeMetadata, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataKeySpaceiTunes, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMetadataKeySpaceID3, NSString *)
-
-#define AVMetadataKeySpaceQuickTimeUserData getAVMetadataKeySpaceQuickTimeUserData()
-#define AVMetadataKeySpaceISOUserData getAVMetadataKeySpaceISOUserData()
-#define AVMetadataKeySpaceQuickTimeMetadata getAVMetadataKeySpaceQuickTimeMetadata()
-#define AVMetadataKeySpaceiTunes getAVMetadataKeySpaceiTunes()
-#define AVMetadataKeySpaceID3 getAVMetadataKeySpaceID3()
-
-#endif
-
-#if PLATFORM(IOS_FAMILY)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVURLAssetBoundNetworkInterfaceName, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVURLAssetClientBundleIdentifierKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVURLAssetHTTPCookiesKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVURLAssetRequiresCustomURLLoadingKey, NSString *)
-
-#define AVURLAssetBoundNetworkInterfaceName getAVURLAssetBoundNetworkInterfaceName()
-#define AVURLAssetClientBundleIdentifierKey getAVURLAssetClientBundleIdentifierKey()
-#define AVURLAssetHTTPCookiesKey getAVURLAssetHTTPCookiesKey()
-#define AVURLAssetRequiresCustomURLLoadingKey getAVURLAssetRequiresCustomURLLoadingKey()
-
-#endif
-
</del><span class="cx"> SOFT_LINK_FRAMEWORK(MediaToolbox)
</span><span class="cx"> SOFT_LINK_OPTIONAL(MediaToolbox, MTEnableCaption2015Behavior, Boolean, (), ())
</span><span class="cx"> 
</span><span class="lines">@@ -325,11 +165,7 @@
</span><span class="cx">     MediaPlayerAVFoundationObservationContextAVPlayerLayer,
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
</del><span class="cx"> @interface WebCoreAVFMovieObserver : NSObject <AVPlayerItemLegibleOutputPushDelegate>
</span><del>-#else
-@interface WebCoreAVFMovieObserver : NSObject
-#endif
</del><span class="cx"> {
</span><span class="cx">     WeakPtr<MediaPlayerPrivateAVFoundationObjC> m_player;
</span><span class="cx">     GenericTaskQueue<Timer, std::atomic<unsigned>> m_taskQueue;
</span><span class="lines">@@ -340,10 +176,8 @@
</span><span class="cx"> -(void)metadataLoaded;
</span><span class="cx"> -(void)didEnd:(NSNotification *)notification;
</span><span class="cx"> -(void)observeValueForKeyPath:keyPath ofObject:(id)object change:(NSDictionary *)change context:(MediaPlayerAVFoundationObservationContext)context;
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx"> - (void)legibleOutput:(id)output didOutputAttributedStrings:(NSArray *)strings nativeSampleBuffers:(NSArray *)nativeSamples forItemTime:(CMTime)itemTime;
</span><span class="cx"> - (void)outputSequenceWasFlushed:(id)output;
</span><del>-#endif
</del><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
</span><span class="lines">@@ -409,7 +243,7 @@
</span><span class="cx">     ASSERT(AVFoundationMIMETypeCache::singleton().isAvailable());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static AVAssetCacheType *assetCacheForPath(const String& path)
</del><ins>+static AVAssetCache *assetCacheForPath(const String& path)
</ins><span class="cx"> {
</span><span class="cx">     NSURL *assetCacheURL;
</span><span class="cx">     
</span><span class="lines">@@ -418,7 +252,7 @@
</span><span class="cx">     else
</span><span class="cx">         assetCacheURL = [NSURL fileURLWithPath:path isDirectory:YES];
</span><span class="cx"> 
</span><del>-    return [initAVAssetCache() assetCacheWithURL:assetCacheURL];
</del><ins>+    return [PAL::getAVAssetCacheClass() assetCacheWithURL:assetCacheURL];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> HashSet<RefPtr<SecurityOrigin>> MediaPlayerPrivateAVFoundationObjC::originsInMediaCache(const String& path)
</span><span class="lines">@@ -440,7 +274,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::clearMediaCache(const String& path, WallTime modifiedSince)
</span><span class="cx"> {
</span><del>-    AVAssetCacheType* assetCache = assetCacheForPath(path);
</del><ins>+    AVAssetCache* assetCache = assetCacheForPath(path);
</ins><span class="cx">     
</span><span class="cx">     for (NSString *key in [assetCache allKeys]) {
</span><span class="cx">         if (toSystemClockTime([assetCache lastModifiedDateOfEntryForKey:key]) > modifiedSince)
</span><span class="lines">@@ -482,7 +316,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins(const String& path, const HashSet<RefPtr<SecurityOrigin>>& origins)
</span><span class="cx"> {
</span><del>-    AVAssetCacheType* assetCache = assetCacheForPath(path);
</del><ins>+    AVAssetCache* assetCache = assetCacheForPath(path);
</ins><span class="cx">     for (NSString *key in [assetCache allKeys]) {
</span><span class="cx">         URL keyAsURL = URL(URL(), key);
</span><span class="cx">         if (keyAsURL.isValid()) {
</span><span class="lines">@@ -560,13 +394,11 @@
</span><span class="cx"> 
</span><span class="cx">     clearTextTracks();
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
</del><span class="cx">     if (m_legibleOutput) {
</span><span class="cx">         if (m_avPlayerItem)
</span><span class="cx">             [m_avPlayerItem.get() removeOutput:m_legibleOutput.get()];
</span><span class="cx">         m_legibleOutput = nil;
</span><span class="cx">     }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     if (m_avPlayerItem) {
</span><span class="cx">         for (NSString *keyName in itemKVOProperties())
</span><span class="lines">@@ -645,7 +477,7 @@
</span><span class="cx">     if (!m_avAsset || m_imageGenerator)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:m_avAsset.get()];
</del><ins>+    m_imageGenerator = [PAL::getAVAssetImageGeneratorClass() assetImageGeneratorWithAsset:m_avAsset.get()];
</ins><span class="cx"> 
</span><span class="cx">     [m_imageGenerator.get() setApertureMode:AVAssetImageGeneratorApertureModeCleanAperture];
</span><span class="cx">     [m_imageGenerator.get() setAppliesPreferredTrackTransform:YES];
</span><span class="lines">@@ -701,7 +533,7 @@
</span><span class="cx">     if (!m_avPlayer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_videoLayer = adoptNS([[AVPlayerLayer alloc] init]);
</del><ins>+    m_videoLayer = adoptNS([PAL::allocAVPlayerLayerInstance() init]);
</ins><span class="cx">     [m_videoLayer setPlayer:m_avPlayer.get()];
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -800,7 +632,7 @@
</span><span class="cx">             continue;
</span><span class="cx">         
</span><span class="cx">         RefPtr<OutOfBandTextTrackPrivateAVF> trackPrivate = static_cast<OutOfBandTextTrackPrivateAVF*>(textTrack.get());
</span><del>-        RetainPtr<AVMediaSelectionOptionType> currentOption = trackPrivate->mediaSelectionOption();
</del><ins>+        RetainPtr<AVMediaSelectionOption> currentOption = trackPrivate->mediaSelectionOption();
</ins><span class="cx">         
</span><span class="cx">         for (auto& track : outOfBandTrackSources) {
</span><span class="cx">             RetainPtr<CFStringRef> uniqueID = String::number(track->uniqueId()).createCFString();
</span><span class="lines">@@ -890,19 +722,19 @@
</span><span class="cx">     if (player()->doesHaveAttribute("x-itunes-inherit-uri-query-component"))
</span><span class="cx">         [options.get() setObject:@YES forKey: AVURLAssetInheritURIQueryComponentFromReferencingURIKey];
</span><span class="cx"> 
</span><del>-    if (canLoadAVURLAssetUseClientURLLoadingExclusively())
</del><ins>+    if (PAL::canLoad_AVFoundation_AVURLAssetUseClientURLLoadingExclusively())
</ins><span class="cx">         [options setObject:@YES forKey:AVURLAssetUseClientURLLoadingExclusively];
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><del>-    else if (canLoadAVURLAssetRequiresCustomURLLoadingKey())
</del><ins>+    else if (PAL::canLoad_AVFoundation_AVURLAssetRequiresCustomURLLoadingKey())
</ins><span class="cx">         [options setObject:@YES forKey:AVURLAssetRequiresCustomURLLoadingKey];
</span><span class="cx">     // FIXME: rdar://problem/20354688
</span><span class="cx">     String identifier = player()->sourceApplicationIdentifier();
</span><del>-    if (!identifier.isEmpty() && canLoadAVURLAssetClientBundleIdentifierKey())
</del><ins>+    if (!identifier.isEmpty())
</ins><span class="cx">         [options setObject:identifier forKey:AVURLAssetClientBundleIdentifierKey];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     auto type = player()->contentMIMEType();
</span><del>-    if (canLoadAVURLAssetOutOfBandMIMETypeKey() && !type.isEmpty() && !player()->contentMIMETypeWasInferredFromExtension()) {
</del><ins>+    if (PAL::canLoad_AVFoundation_AVURLAssetOutOfBandMIMETypeKey() && !type.isEmpty() && !player()->contentMIMETypeWasInferredFromExtension()) {
</ins><span class="cx">         auto codecs = player()->contentTypeCodecs();
</span><span class="cx">         if (!codecs.isEmpty()) {
</span><span class="cx">             NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)type, (NSString *)codecs];
</span><span class="lines">@@ -947,7 +779,7 @@
</span><span class="cx">         for (auto& cookie : cookies)
</span><span class="cx">             [nsCookies addObject:toNSHTTPCookie(cookie)];
</span><span class="cx"> 
</span><del>-        if (canLoadAVURLAssetHTTPCookiesKey())
</del><ins>+        if (PAL::canLoad_AVFoundation_AVURLAssetHTTPCookiesKey())
</ins><span class="cx">             [options setObject:nsCookies.get() forKey:AVURLAssetHTTPCookiesKey];
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -959,7 +791,7 @@
</span><span class="cx">         [options setObject:assetCacheForPath(player()->client().mediaPlayerMediaCacheDirectory()) forKey:AVURLAssetCacheKey];
</span><span class="cx"> 
</span><span class="cx">     NSURL *cocoaURL = canonicalURL(url);
</span><del>-    m_avAsset = adoptNS([[AVURLAsset alloc] initWithURL:cocoaURL options:options.get()]);
</del><ins>+    m_avAsset = adoptNS([PAL::allocAVURLAssetInstance() initWithURL:cocoaURL options:options.get()]);
</ins><span class="cx"> 
</span><span class="cx"> #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
</span><span class="cx">     AVAssetResourceLoader *resourceLoader = m_avAsset.get().resourceLoader;
</span><span class="lines">@@ -981,7 +813,7 @@
</span><span class="cx">     setDelayCallbacks(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem(AVPlayerItemType *item)
</del><ins>+void MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem(AVPlayerItem *item)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_avPlayer)
</span><span class="cx">         return;
</span><span class="lines">@@ -991,8 +823,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RetainPtr<AVPlayerType> strongPlayer = m_avPlayer.get();
-    RetainPtr<AVPlayerItemType> strongItem = item;
</del><ins>+    RetainPtr<AVPlayer> strongPlayer = m_avPlayer.get();
+    RetainPtr<AVPlayerItem> strongItem = item;
</ins><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongPlayer, strongItem] {
</span><span class="cx">         [strongPlayer replaceCurrentItemWithPlayerItem:strongItem.get()];
</span><span class="cx">     });
</span><span class="lines">@@ -1007,15 +839,13 @@
</span><span class="cx"> 
</span><span class="cx">     setDelayCallbacks(true);
</span><span class="cx"> 
</span><del>-    m_avPlayer = adoptNS([[AVPlayer alloc] init]);
</del><ins>+    m_avPlayer = adoptNS([PAL::allocAVPlayerInstance() init]);
</ins><span class="cx">     for (NSString *keyName in playerKVOProperties())
</span><span class="cx">         [m_avPlayer.get() addObserver:m_objcObserver.get() forKeyPath:keyName options:NSKeyValueObservingOptionNew context:(void *)MediaPlayerAVFoundationObservationContextPlayer];
</span><span class="cx"> 
</span><span class="cx">     setShouldObserveTimeControlStatus(true);
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
</del><span class="cx">     [m_avPlayer.get() setAppliesMediaSelectionCriteriaAutomatically:NO];
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx">     updateDisableExternalPlayback();
</span><span class="lines">@@ -1059,7 +889,7 @@
</span><span class="cx">     setDelayCallbacks(true);
</span><span class="cx"> 
</span><span class="cx">     // Create the player item so we can load media data. 
</span><del>-    m_avPlayerItem = adoptNS([[AVPlayerItem alloc] initWithAsset:m_avAsset.get()]);
</del><ins>+    m_avPlayerItem = adoptNS([PAL::allocAVPlayerItemInstance() initWithAsset:m_avAsset.get()]);
</ins><span class="cx"> 
</span><span class="cx">     [[NSNotificationCenter defaultCenter] addObserver:m_objcObserver.get() selector:@selector(didEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:m_avPlayerItem.get()];
</span><span class="cx"> 
</span><span class="lines">@@ -1072,11 +902,10 @@
</span><span class="cx">     if (m_avPlayer)
</span><span class="cx">         setAVPlayerItem(m_avPlayerItem.get());
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
</del><span class="cx">     const NSTimeInterval legibleOutputAdvanceInterval = 2;
</span><span class="cx"> 
</span><span class="cx">     RetainPtr<NSArray> subtypes = adoptNS([[NSArray alloc] initWithObjects:[NSNumber numberWithUnsignedInt:kCMSubtitleFormatType_WebVTT], nil]);
</span><del>-    m_legibleOutput = adoptNS([[AVPlayerItemLegibleOutput alloc] initWithMediaSubtypesForNativeRepresentation:subtypes.get()]);
</del><ins>+    m_legibleOutput = adoptNS([PAL::allocAVPlayerItemLegibleOutputInstance() initWithMediaSubtypesForNativeRepresentation:subtypes.get()]);
</ins><span class="cx">     [m_legibleOutput.get() setSuppressesPlayerRendering:YES];
</span><span class="cx"> 
</span><span class="cx">     [m_legibleOutput.get() setDelegate:m_objcObserver.get() queue:dispatch_get_main_queue()];
</span><span class="lines">@@ -1083,7 +912,6 @@
</span><span class="cx">     [m_legibleOutput.get() setAdvanceIntervalForDelegateInvocation:legibleOutputAdvanceInterval];
</span><span class="cx">     [m_legibleOutput.get() setTextStylingResolution:AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly];
</span><span class="cx">     [m_avPlayerItem.get() addOutput:m_legibleOutput.get()];
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_AUDIO) && USE(MEDIATOOLBOX)
</span><span class="cx">     if (m_provider) {
</span><span class="lines">@@ -1722,7 +1550,7 @@
</span><span class="cx">         return MediaPlayer::IsNotSupported;
</span><span class="cx"> 
</span><span class="cx">     NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)containerType, (NSString *)parameters.type.parameter(ContentType::codecsParameter())];
</span><del>-    return [AVURLAsset isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
</del><ins>+    return [PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateAVFoundationObjC::supportsKeySystem(const String& keySystem, const String& mimeType)
</span><span class="lines">@@ -1868,7 +1696,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateAVFoundationObjC::isAvailable()
</span><span class="cx"> {
</span><del>-    return AVFoundationLibrary() && isCoreMediaFrameworkAvailable();
</del><ins>+    return PAL::AVFoundationLibrary() && isCoreMediaFrameworkAvailable();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaTime MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue(const MediaTime& timeValue) const
</span><span class="lines">@@ -1933,9 +1761,6 @@
</span><span class="cx">         AVAssetTrack* firstEnabledVideoTrack = firstEnabledTrack([m_avAsset.get() tracksWithMediaCharacteristic:AVMediaCharacteristicVisual]);
</span><span class="cx">         setHasVideo(firstEnabledVideoTrack);
</span><span class="cx">         setHasAudio(firstEnabledTrack([m_avAsset.get() tracksWithMediaCharacteristic:AVMediaCharacteristicAudible]));
</span><del>-#if !HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-        hasCaptions = [[m_avAsset.get() tracksWithMediaType:AVMediaTypeClosedCaption] count];
-#endif
</del><span class="cx">         auto size = firstEnabledVideoTrack ? FloatSize(CGSizeApplyAffineTransform([firstEnabledVideoTrack naturalSize], [firstEnabledVideoTrack preferredTransform])) : FloatSize();
</span><span class="cx">         // For videos with rotation tag set, the transformation above might return a CGSize instance with negative width or height.
</span><span class="cx">         // See https://bugs.webkit.org/show_bug.cgi?id=172648.
</span><span class="lines">@@ -1957,9 +1782,6 @@
</span><span class="cx">                 else if ([mediaType isEqualToString:AVMediaTypeAudio])
</span><span class="cx">                     hasAudio = true;
</span><span class="cx">                 else if ([mediaType isEqualToString:AVMediaTypeClosedCaption]) {
</span><del>-#if !HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-                    hasCaptions = true;
-#endif
</del><span class="cx">                     haveCCTrack = true;
</span><span class="cx">                 } else if ([mediaType isEqualToString:AVMediaTypeMetadata]) {
</span><span class="cx">                     hasMetaData = true;
</span><span class="lines">@@ -1967,15 +1789,11 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO_TRACK)
</del><span class="cx">         updateAudioTracks();
</span><span class="cx">         updateVideoTracks();
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx">         hasAudio |= (m_audibleGroup && m_audibleGroup->selectedOption());
</span><span class="cx">         hasVideo |= (m_visualGroup && m_visualGroup->selectedOption());
</span><del>-#endif
-#endif
</del><span class="cx"> 
</span><span class="cx">         // Always says we have video if the AVPlayerLayer is ready for diaplay to work around
</span><span class="cx">         // an AVFoundation bug which causes it to sometimes claim a track is disabled even
</span><span class="lines">@@ -1989,23 +1807,13 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-    AVMediaSelectionGroupType *legibleGroup = safeMediaSelectionGroupForLegibleMedia();
</del><ins>+    AVMediaSelectionGroup *legibleGroup = safeMediaSelectionGroupForLegibleMedia();
</ins><span class="cx">     if (legibleGroup && m_cachedTracks) {
</span><del>-        hasCaptions = [[AVMediaSelectionGroup playableMediaSelectionOptionsFromArray:[legibleGroup options]] count];
</del><ins>+        hasCaptions = [[PAL::getAVMediaSelectionGroupClass() playableMediaSelectionOptionsFromArray:[legibleGroup options]] count];
</ins><span class="cx">         if (hasCaptions)
</span><span class="cx">             processMediaSelectionOptions();
</span><span class="cx">     }
</span><del>-#endif
</del><span class="cx"> 
</span><del>-#if !HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT) && HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-    if (!hasCaptions && haveCCTrack)
-        processLegacyClosedCaptionsTracks();
-#elif !HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
-    if (haveCCTrack)
-        processLegacyClosedCaptionsTracks();
-#endif
-
</del><span class="cx">     setHasClosedCaptions(hasCaptions);
</span><span class="cx"> 
</span><span class="cx">     INFO_LOG(LOGIDENTIFIER, "has video = ", hasVideo(), ", has audio = ", hasAudio(), ", has captions = ", hasClosedCaptions());
</span><span class="lines">@@ -2069,8 +1877,6 @@
</span><span class="cx">         (player->*addedFunction)(*addedItem);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-
</del><span class="cx"> template <typename RefT, typename PassRefT>
</span><span class="cx"> void determineChangedTracksFromNewTracksAndOldItems(MediaSelectionGroupAVFObjC* group, Vector<RefT>& oldItems, const Vector<String>& characteristics, RefT (*itemFactory)(MediaSelectionOptionAVFObjC&), MediaPlayer* player, void (MediaPlayer::*removedFunction)(PassRefT), void (MediaPlayer::*addedFunction)(PassRefT))
</span><span class="cx"> {
</span><span class="lines">@@ -2080,7 +1886,7 @@
</span><span class="cx">     for (auto& option : group->options()) {
</span><span class="cx">         if (!option)
</span><span class="cx">             continue;
</span><del>-        AVMediaSelectionOptionType* avOption = option->avMediaSelectionOption();
</del><ins>+        AVMediaSelectionOption* avOption = option->avMediaSelectionOption();
</ins><span class="cx">         if (!avOption)
</span><span class="cx">             continue;
</span><span class="cx">         newSelectionOptions.add(option);
</span><span class="lines">@@ -2131,8 +1937,6 @@
</span><span class="cx">         (player->*addedFunction)(*addedItem);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif
-
</del><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::updateAudioTracks()
</span><span class="cx"> {
</span><span class="cx"> #if !RELEASE_LOG_DISABLED
</span><span class="lines">@@ -2139,10 +1943,9 @@
</span><span class="cx">     size_t count = m_audioTracks.size();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx">     Vector<String> characteristics = player()->preferredAudioCharacteristics();
</span><span class="cx">     if (!m_audibleGroup) {
</span><del>-        if (AVMediaSelectionGroupType *group = safeMediaSelectionGroupForAudibleMedia())
</del><ins>+        if (AVMediaSelectionGroup *group = safeMediaSelectionGroupForAudibleMedia())
</ins><span class="cx">             m_audibleGroup = MediaSelectionGroupAVFObjC::create(m_avPlayerItem.get(), group, characteristics);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2149,7 +1952,6 @@
</span><span class="cx">     if (m_audibleGroup)
</span><span class="cx">         determineChangedTracksFromNewTracksAndOldItems(m_audibleGroup.get(), m_audioTracks, characteristics, &AudioTrackPrivateAVFObjC::create, player(), &MediaPlayer::removeAudioTrack, &MediaPlayer::addAudioTrack);
</span><span class="cx">     else
</span><del>-#endif
</del><span class="cx">         determineChangedTracksFromNewTracksAndOldItems(m_cachedTracks.get(), AVMediaTypeAudio, m_audioTracks, &AudioTrackPrivateAVFObjC::create, player(), &MediaPlayer::removeAudioTrack, &MediaPlayer::addAudioTrack);
</span><span class="cx"> 
</span><span class="cx">     for (auto& track : m_audioTracks)
</span><span class="lines">@@ -2168,15 +1970,13 @@
</span><span class="cx"> 
</span><span class="cx">     determineChangedTracksFromNewTracksAndOldItems(m_cachedTracks.get(), AVMediaTypeVideo, m_videoTracks, &VideoTrackPrivateAVFObjC::create, player(), &MediaPlayer::removeVideoTrack, &MediaPlayer::addVideoTrack);
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx">     if (!m_visualGroup) {
</span><del>-        if (AVMediaSelectionGroupType *group = safeMediaSelectionGroupForVisualMedia())
</del><ins>+        if (AVMediaSelectionGroup *group = safeMediaSelectionGroupForVisualMedia())
</ins><span class="cx">             m_visualGroup = MediaSelectionGroupAVFObjC::create(m_avPlayerItem.get(), group, Vector<String>());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_visualGroup)
</span><span class="cx">         determineChangedTracksFromNewTracksAndOldItems(m_visualGroup.get(), m_videoTracks, Vector<String>(), &VideoTrackPrivateAVFObjC::create, player(), &MediaPlayer::removeVideoTrack, &MediaPlayer::addVideoTrack);
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     for (auto& track : m_audioTracks)
</span><span class="cx">         track->resetPropertiesFromTrack();
</span><span class="lines">@@ -2272,7 +2072,7 @@
</span><span class="cx"> #else
</span><span class="cx">     NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA], kCVPixelBufferPixelFormatTypeKey, nil];
</span><span class="cx"> #endif
</span><del>-    m_videoOutput = adoptNS([[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:attributes]);
</del><ins>+    m_videoOutput = adoptNS([PAL::allocAVPlayerItemVideoOutputInstance() initWithPixelBufferAttributes:attributes]);
</ins><span class="cx">     ASSERT(m_videoOutput);
</span><span class="cx"> 
</span><span class="cx">     [m_videoOutput setDelegate:m_videoOutputDelegate.get() queue:globalPullDelegateQueue()];
</span><span class="lines">@@ -2422,7 +2222,7 @@
</span><span class="cx">         ERROR_LOG(LOGIDENTIFIER, "timed out");
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange(AVPlayerItemVideoOutputType *)
</del><ins>+void MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange(AVPlayerItemVideoOutput *)
</ins><span class="cx"> {
</span><span class="cx">     m_videoOutputSemaphore.signal();
</span><span class="cx"> }
</span><span class="lines">@@ -2551,45 +2351,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if !HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
-
-void MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks()
-{
-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-    [m_avPlayerItem.get() selectMediaOption:nil inMediaSelectionGroup:safeMediaSelectionGroupForLegibleMedia()];
-#endif
-
-    Vector<RefPtr<InbandTextTrackPrivateAVF>> removedTextTracks = m_textTracks;
-    for (AVPlayerItemTrack *playerItemTrack in m_cachedTracks.get()) {
-
-        AVAssetTrack *assetTrack = [playerItemTrack assetTrack];
-        if (![[assetTrack mediaType] isEqualToString:AVMediaTypeClosedCaption])
-            continue;
-
-        bool newCCTrack = true;
-        for (unsigned i = removedTextTracks.size(); i > 0; --i) {
-            if (removedTextTracks[i - 1]->textTrackCategory() != InbandTextTrackPrivateAVF::LegacyClosedCaption)
-                continue;
-
-            RefPtr<InbandTextTrackPrivateLegacyAVFObjC> track = static_cast<InbandTextTrackPrivateLegacyAVFObjC*>(m_textTracks[i - 1].get());
-            if (track->avPlayerItemTrack() == playerItemTrack) {
-                removedTextTracks.remove(i - 1);
-                newCCTrack = false;
-                break;
-            }
-        }
-
-        if (!newCCTrack)
-            continue;
-        
-        m_textTracks.append(InbandTextTrackPrivateLegacyAVFObjC::create(this, playerItemTrack));
-    }
-
-    processNewAndRemovedTextTracks(removedTextTracks);
-}
-
-#endif
-
</del><span class="cx"> NSArray* MediaPlayerPrivateAVFoundationObjC::safeAVAssetTracksForAudibleMedia()
</span><span class="cx"> {
</span><span class="cx">     if (!m_avAsset)
</span><span class="lines">@@ -2601,8 +2362,6 @@
</span><span class="cx">     return [m_avAsset tracksWithMediaCharacteristic:AVMediaCharacteristicAudible];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-
</del><span class="cx"> bool MediaPlayerPrivateAVFoundationObjC::hasLoadedMediaSelectionGroups()
</span><span class="cx"> {
</span><span class="cx">     if (!m_avAsset)
</span><span class="lines">@@ -2614,7 +2373,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia()
</del><ins>+AVMediaSelectionGroup* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia()
</ins><span class="cx"> {
</span><span class="cx">     if (!hasLoadedMediaSelectionGroups())
</span><span class="cx">         return nil;
</span><span class="lines">@@ -2622,7 +2381,7 @@
</span><span class="cx">     return [m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicLegible];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia()
</del><ins>+AVMediaSelectionGroup* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia()
</ins><span class="cx"> {
</span><span class="cx">     if (!hasLoadedMediaSelectionGroups())
</span><span class="cx">         return nil;
</span><span class="lines">@@ -2630,7 +2389,7 @@
</span><span class="cx">     return [m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicAudible];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia()
</del><ins>+AVMediaSelectionGroup* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia()
</ins><span class="cx"> {
</span><span class="cx">     if (!hasLoadedMediaSelectionGroups())
</span><span class="cx">         return nil;
</span><span class="lines">@@ -2640,7 +2399,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions()
</span><span class="cx"> {
</span><del>-    AVMediaSelectionGroupType *legibleGroup = safeMediaSelectionGroupForLegibleMedia();
</del><ins>+    AVMediaSelectionGroup *legibleGroup = safeMediaSelectionGroupForLegibleMedia();
</ins><span class="cx">     if (!legibleGroup) {
</span><span class="cx">         INFO_LOG(LOGIDENTIFIER, "no mediaSelectionGroup");
</span><span class="cx">         return;
</span><span class="lines">@@ -2652,14 +2411,14 @@
</span><span class="cx">         [m_avPlayerItem.get() selectMediaOption:nil inMediaSelectionGroup:safeMediaSelectionGroupForLegibleMedia()];
</span><span class="cx"> 
</span><span class="cx">     Vector<RefPtr<InbandTextTrackPrivateAVF>> removedTextTracks = m_textTracks;
</span><del>-    NSArray *legibleOptions = [AVMediaSelectionGroup playableMediaSelectionOptionsFromArray:[legibleGroup options]];
-    for (AVMediaSelectionOptionType *option in legibleOptions) {
</del><ins>+    NSArray *legibleOptions = [PAL::getAVMediaSelectionGroupClass() playableMediaSelectionOptionsFromArray:[legibleGroup options]];
+    for (AVMediaSelectionOption *option in legibleOptions) {
</ins><span class="cx">         bool newTrack = true;
</span><span class="cx">         for (unsigned i = removedTextTracks.size(); i > 0; --i) {
</span><span class="cx">             if (removedTextTracks[i - 1]->textTrackCategory() == InbandTextTrackPrivateAVF::LegacyClosedCaption)
</span><span class="cx">                 continue;
</span><span class="cx">             
</span><del>-            RetainPtr<AVMediaSelectionOptionType> currentOption;
</del><ins>+            RetainPtr<AVMediaSelectionOption> currentOption;
</ins><span class="cx"> #if ENABLE(AVF_CAPTIONS)
</span><span class="cx">             if (removedTextTracks[i - 1]->textTrackCategory() == InbandTextTrackPrivateAVF::OutOfBand) {
</span><span class="cx">                 RefPtr<OutOfBandTextTrackPrivateAVF> track = static_cast<OutOfBandTextTrackPrivateAVF*>(removedTextTracks[i - 1].get());
</span><span class="lines">@@ -2724,8 +2483,6 @@
</span><span class="cx">     m_currentTextTrack->resetCueValues();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif // HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-
</del><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack(InbandTextTrackPrivateAVF *track)
</span><span class="cx"> {
</span><span class="cx">     if (m_currentTextTrack == track)
</span><span class="lines">@@ -2740,7 +2497,6 @@
</span><span class="cx">             ALLOW_DEPRECATED_DECLARATIONS_BEGIN
</span><span class="cx">             [m_avPlayer.get() setClosedCaptionDisplayEnabled:YES];
</span><span class="cx">             ALLOW_DEPRECATED_DECLARATIONS_END
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx"> #if ENABLE(AVF_CAPTIONS)
</span><span class="cx">         else if (track->textTrackCategory() == InbandTextTrackPrivateAVF::OutOfBand)
</span><span class="cx">             [m_avPlayerItem.get() selectMediaOption:static_cast<OutOfBandTextTrackPrivateAVF*>(track)->mediaSelectionOption() inMediaSelectionGroup:safeMediaSelectionGroupForLegibleMedia()];
</span><span class="lines">@@ -2747,11 +2503,8 @@
</span><span class="cx"> #endif
</span><span class="cx">         else
</span><span class="cx">             [m_avPlayerItem.get() selectMediaOption:static_cast<InbandTextTrackPrivateAVFObjC*>(track)->mediaSelectionOption() inMediaSelectionGroup:safeMediaSelectionGroupForLegibleMedia()];
</span><del>-#endif
</del><span class="cx">     } else {
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx">         [m_avPlayerItem.get() selectMediaOption:0 inMediaSelectionGroup:safeMediaSelectionGroupForLegibleMedia()];
</span><del>-#endif
</del><span class="cx">         ALLOW_DEPRECATED_DECLARATIONS_BEGIN
</span><span class="cx">         [m_avPlayer.get() setClosedCaptionDisplayEnabled:NO];
</span><span class="cx">         ALLOW_DEPRECATED_DECLARATIONS_END
</span><span class="lines">@@ -2767,11 +2520,10 @@
</span><span class="cx">     if (!m_avPlayerItem.get())
</span><span class="cx">         return emptyString();
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx">     // If AVFoundation has an audible group, return the language of the currently selected audible option.
</span><del>-    AVMediaSelectionGroupType *audibleGroup = [m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicAudible];
</del><ins>+    AVMediaSelectionGroup *audibleGroup = [m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicAudible];
</ins><span class="cx">     ALLOW_DEPRECATED_DECLARATIONS_BEGIN
</span><del>-    AVMediaSelectionOptionType *currentlySelectedAudibleOption = [m_avPlayerItem.get() selectedMediaOptionInMediaSelectionGroup:audibleGroup];
</del><ins>+    AVMediaSelectionOption *currentlySelectedAudibleOption = [m_avPlayerItem.get() selectedMediaOptionInMediaSelectionGroup:audibleGroup];
</ins><span class="cx">     ALLOW_DEPRECATED_DECLARATIONS_END
</span><span class="cx">     if (currentlySelectedAudibleOption) {
</span><span class="cx">         m_languageOfPrimaryAudioTrack = [[currentlySelectedAudibleOption locale] localeIdentifier];
</span><span class="lines">@@ -2779,7 +2531,6 @@
</span><span class="cx"> 
</span><span class="cx">         return m_languageOfPrimaryAudioTrack;
</span><span class="cx">     }
</span><del>-#endif // HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
</del><span class="cx"> 
</span><span class="cx">     // AVFoundation synthesizes an audible group when there is only one ungrouped audio track if there is also a legible group (one or
</span><span class="cx">     // more in-band text tracks). It doesn't know about out-of-band tracks, so if there is a single audio track return its language.
</span><span class="lines">@@ -2825,7 +2576,7 @@
</span><span class="cx">         return MediaPlayer::TargetTypeNone;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><del>-    if (!AVFoundationLibrary())
</del><ins>+    if (!PAL::AVFoundationLibrary())
</ins><span class="cx">         return MediaPlayer::TargetTypeNone;
</span><span class="cx"> 
</span><span class="cx">     switch ([m_avPlayer externalPlaybackType]) {
</span><span class="lines">@@ -2846,14 +2597,14 @@
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><del>-static NSString *exernalDeviceDisplayNameForPlayer(AVPlayerType *player)
</del><ins>+static NSString *exernalDeviceDisplayNameForPlayer(AVPlayer *player)
</ins><span class="cx"> {
</span><span class="cx"> #if HAVE(CELESTIAL)
</span><del>-    if (!AVFoundationLibrary())
</del><ins>+    if (!PAL::AVFoundationLibrary())
</ins><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    if ([getAVOutputContextClass() respondsToSelector:@selector(sharedAudioPresentationOutputContext)]) {
-        AVOutputContext *outputContext = [getAVOutputContextClass() sharedAudioPresentationOutputContext];
</del><ins>+    if ([PAL::getAVOutputContextClass() respondsToSelector:@selector(sharedAudioPresentationOutputContext)]) {
+        AVOutputContext *outputContext = [PAL::getAVOutputContextClass() sharedAudioPresentationOutputContext];
</ins><span class="cx"> 
</span><span class="cx">         if (![outputContext respondsToSelector:@selector(supportsMultipleOutputDevices)]
</span><span class="cx">             || ![outputContext supportsMultipleOutputDevices]
</span><span class="lines">@@ -3136,7 +2887,7 @@
</span><span class="cx"> 
</span><span class="cx">     if ([avMetadataKeySpace isEqualToString:AVMetadataKeySpaceQuickTimeUserData])
</span><span class="cx">         return quickTimeUserData;
</span><del>-    if (canLoadAVMetadataKeySpaceISOUserData() && [avMetadataKeySpace isEqualToString:AVMetadataKeySpaceISOUserData])
</del><ins>+    if ([avMetadataKeySpace isEqualToString:AVMetadataKeySpaceISOUserData])
</ins><span class="cx">         return isoUserData;
</span><span class="cx">     if ([avMetadataKeySpace isEqualToString:AVMetadataKeySpaceQuickTimeMetadata])
</span><span class="cx">         return quickTimeMetadata;
</span><span class="lines">@@ -3170,7 +2921,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Set the duration of all incomplete cues before adding new ones.
</span><span class="cx">     MediaTime earliestStartTime = MediaTime::positiveInfiniteTime();
</span><del>-    for (AVMetadataItemType *item in m_currentMetaData.get()) {
</del><ins>+    for (AVMetadataItem *item in m_currentMetaData.get()) {
</ins><span class="cx">         MediaTime start = std::max(PAL::toMediaTime(item.time), MediaTime::zeroTime());
</span><span class="cx">         if (start < earliestStartTime)
</span><span class="cx">             earliestStartTime = start;
</span><span class="lines">@@ -3177,7 +2928,7 @@
</span><span class="cx">     }
</span><span class="cx">     m_metadataTrack->updatePendingCueEndTimes(earliestStartTime);
</span><span class="cx"> 
</span><del>-    for (AVMetadataItemType *item in m_currentMetaData.get()) {
</del><ins>+    for (AVMetadataItem *item in m_currentMetaData.get()) {
</ins><span class="cx">         MediaTime start = std::max(PAL::toMediaTime(item.time), MediaTime::zeroTime());
</span><span class="cx">         MediaTime end = MediaTime::positiveInfiniteTime();
</span><span class="cx">         if (CMTIME_IS_VALID(item.duration))
</span><span class="lines">@@ -3523,7 +3274,7 @@
</span><span class="cx">                 player->durationDidChange(PAL::toMediaTime([newValue CMTimeValue]));
</span><span class="cx">             else if ([keyPath isEqualToString:@"timedMetadata"] && newValue) {
</span><span class="cx">                 MediaTime now;
</span><del>-                CMTime itemTime = [(AVPlayerItemType *)object.get() currentTime];
</del><ins>+                CMTime itemTime = [(AVPlayerItem *)object.get() currentTime];
</ins><span class="cx">                 if (CMTIME_IS_NUMERIC(itemTime))
</span><span class="cx">                     now = std::max(PAL::toMediaTime(itemTime), MediaTime::zeroTime());
</span><span class="cx">                 player->metadataDidArrive(RetainPtr<NSArray>(newValue), now);
</span><span class="lines">@@ -3568,8 +3319,6 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
-
</del><span class="cx"> - (void)legibleOutput:(id)output didOutputAttributedStrings:(NSArray *)strings nativeSampleBuffers:(NSArray *)nativeSamples forItemTime:(CMTime)itemTime
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(output);
</span><span class="lines">@@ -3592,8 +3341,6 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif
-
</del><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
</span><span class="lines">@@ -3661,13 +3408,13 @@
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)outputMediaDataWillChange:(AVPlayerItemVideoOutputType *)output
</del><ins>+- (void)outputMediaDataWillChange:(AVPlayerItemVideoOutput *)output
</ins><span class="cx"> {
</span><span class="cx">     if (m_player)
</span><span class="cx">         m_player->outputMediaDataWillChange(output);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)outputSequenceWasFlushed:(AVPlayerItemVideoOutputType *)output
</del><ins>+- (void)outputSequenceWasFlushed:(AVPlayerItemVideoOutput *)output
</ins><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(output);
</span><span class="cx">     // No-op.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm 2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm    2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -52,32 +52,10 @@
</span><span class="cx"> #import <wtf/MainThread.h>
</span><span class="cx"> #import <wtf/NeverDestroyed.h>
</span><span class="cx"> 
</span><del>-#pragma mark - Soft Linking
-
</del><ins>+#import "CoreVideoSoftLink.h"
</ins><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><del>-#import "CoreVideoSoftLink.h"
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVAsset)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVURLAsset)
-ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVSampleBufferAudioRenderer)
-ALLOW_NEW_API_WITHOUT_GUARDS_END
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVSampleBufferDisplayLayer)
-ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVSampleBufferRenderSynchronizer)
-ALLOW_NEW_API_WITHOUT_GUARDS_END
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVStreamDataParser)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVStreamSession);
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVVideoPerformanceMetrics)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioTimePitchAlgorithmSpectral, NSString*)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioTimePitchAlgorithmVarispeed, NSString*)
-
-#define AVAudioTimePitchAlgorithmSpectral getAVAudioTimePitchAlgorithmSpectral()
-#define AVAudioTimePitchAlgorithmVarispeed getAVAudioTimePitchAlgorithmVarispeed()
-
</del><span class="cx"> #pragma mark -
</span><span class="cx"> #pragma mark AVStreamSession
</span><span class="cx"> 
</span><span class="lines">@@ -117,7 +95,7 @@
</span><span class="cx"> 
</span><span class="cx"> MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer* player)
</span><span class="cx">     : m_player(player)
</span><del>-    , m_synchronizer(adoptNS([allocAVSampleBufferRenderSynchronizerInstance() init]))
</del><ins>+    , m_synchronizer(adoptNS([PAL::allocAVSampleBufferRenderSynchronizerInstance() init]))
</ins><span class="cx">     , m_seekTimer(*this, &MediaPlayerPrivateMediaSourceAVFObjC::seekInternal)
</span><span class="cx">     , m_networkState(MediaPlayer::Empty)
</span><span class="cx">     , m_readyState(MediaPlayer::HaveNothing)
</span><span class="lines">@@ -201,7 +179,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable()
</span><span class="cx"> {
</span><del>-    return AVFoundationLibrary()
</del><ins>+    return PAL::AVFoundationLibrary()
</ins><span class="cx">         && isCoreMediaFrameworkAvailable()
</span><span class="cx">         && getAVStreamDataParserClass()
</span><span class="cx">         && getAVSampleBufferAudioRendererClass()
</span><span class="lines">@@ -234,14 +212,14 @@
</span><span class="cx">         return MediaPlayer::MayBeSupported;
</span><span class="cx"> 
</span><span class="cx">     NSString *outputCodecs = codecs;
</span><del>-    if ([getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)])
-        outputCodecs = [getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
</del><ins>+    if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)])
+        outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
</ins><span class="cx"> 
</span><span class="cx">     if (!contentTypeMeetsHardwareDecodeRequirements(parameters.type, parameters.contentTypesRequiringHardwareSupport))
</span><span class="cx">         return MediaPlayer::IsNotSupported;
</span><span class="cx"> 
</span><span class="cx">     NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)parameters.type.containerType(), (NSString *)outputCodecs];
</span><del>-    return [getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;;
</del><ins>+    return [PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #pragma mark -
</span><span class="lines">@@ -719,7 +697,7 @@
</span><span class="cx">     if (m_sampleBufferDisplayLayer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_sampleBufferDisplayLayer = adoptNS([allocAVSampleBufferDisplayLayerInstance() init]);
</del><ins>+    m_sampleBufferDisplayLayer = adoptNS([PAL::allocAVSampleBufferDisplayLayerInstance() init]);
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     [m_sampleBufferDisplayLayer setName:@"MediaPlayerPrivateMediaSource AVSampleBufferDisplayLayer"];
</span><span class="cx"> #endif
</span><span class="lines">@@ -937,7 +915,7 @@
</span><span class="cx"> #if HAVE(AVSTREAMSESSION)
</span><span class="cx"> AVStreamSession* MediaPlayerPrivateMediaSourceAVFObjC::streamSession()
</span><span class="cx"> {
</span><del>-    if (!getAVStreamSessionClass() || ![getAVStreamSessionClass() instancesRespondToSelector:@selector(initWithStorageDirectoryAtURL:)])
</del><ins>+    if (!getAVStreamSessionClass() || ![PAL::getAVStreamSessionClass() instancesRespondToSelector:@selector(initWithStorageDirectoryAtURL:)])
</ins><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     if (!m_streamSession) {
</span><span class="lines">@@ -951,7 +929,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         String storagePath = FileSystem::pathByAppendingComponent(storageDirectory, "SecureStop.plist");
</span><del>-        m_streamSession = adoptNS([allocAVStreamSessionInstance() initWithStorageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]);
</del><ins>+        m_streamSession = adoptNS([PAL::allocAVStreamSessionInstance() initWithStorageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]);
</ins><span class="cx">     }
</span><span class="cx">     return m_streamSession.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm    2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -46,24 +46,10 @@
</span><span class="cx"> #import <wtf/MainThread.h>
</span><span class="cx"> #import <wtf/NeverDestroyed.h>
</span><span class="cx"> 
</span><del>-
-#pragma mark - Soft Linking
-
</del><ins>+#import "CoreVideoSoftLink.h"
</ins><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><del>-#import "CoreVideoSoftLink.h"
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVSampleBufferDisplayLayer)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspect, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspectFill, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResize, NSString *)
-
-#define AVLayerVideoGravityResizeAspect getAVLayerVideoGravityResizeAspect()
-#define AVLayerVideoGravityResizeAspectFill getAVLayerVideoGravityResizeAspectFill()
-#define AVLayerVideoGravityResize getAVLayerVideoGravityResize()
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface WebAVSampleBufferStatusChangeListener : NSObject {
</span><span class="lines">@@ -133,7 +119,7 @@
</span><span class="cx">     if (!_parent)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if ([object isKindOfClass:getAVSampleBufferDisplayLayerClass()]) {
</del><ins>+    if ([object isKindOfClass:PAL::getAVSampleBufferDisplayLayerClass()]) {
</ins><span class="cx">         RetainPtr<AVSampleBufferDisplayLayer> layer = (AVSampleBufferDisplayLayer *)object;
</span><span class="cx">         ASSERT(layer.get() == _parent->displayLayer());
</span><span class="cx"> 
</span><span class="lines">@@ -240,7 +226,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateMediaStreamAVFObjC::isAvailable()
</span><span class="cx"> {
</span><del>-    return AVFoundationLibrary() && isCoreMediaFrameworkAvailable() && getAVSampleBufferDisplayLayerClass();
</del><ins>+    return PAL::AVFoundationLibrary() && isCoreMediaFrameworkAvailable() && getAVSampleBufferDisplayLayerClass();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
</span><span class="lines">@@ -484,7 +470,7 @@
</span><span class="cx">     if (!m_mediaStreamPrivate || !m_mediaStreamPrivate->activeVideoTrack() || !m_mediaStreamPrivate->activeVideoTrack()->enabled())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_sampleBufferDisplayLayer = adoptNS([allocAVSampleBufferDisplayLayerInstance() init]);
</del><ins>+    m_sampleBufferDisplayLayer = adoptNS([PAL::allocAVSampleBufferDisplayLayerInstance() init]);
</ins><span class="cx">     if (!m_sampleBufferDisplayLayer) {
</span><span class="cx">         ERROR_LOG(LOGIDENTIFIER, "+[AVSampleBufferDisplayLayer alloc] failed.");
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSampleAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm   2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm      2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -32,8 +32,8 @@
</span><span class="cx"> #import <wtf/PrintStream.h>
</span><span class="cx"> #import <wtf/cf/TypeCastsCF.h>
</span><span class="cx"> 
</span><ins>+#import "CoreVideoSoftLink.h"
</ins><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><del>-#import "CoreVideoSoftLink.h"
</del><span class="cx"> 
</span><span class="cx"> using namespace PAL;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm   2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm      2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -65,30 +65,8 @@
</span><span class="cx"> #pragma mark - Soft Linking
</span><span class="cx"> 
</span><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS(AVFoundation, AVAssetTrack)
-SOFT_LINK_CLASS(AVFoundation, AVStreamDataParser)
-ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
-SOFT_LINK_CLASS(AVFoundation, AVSampleBufferAudioRenderer)
-ALLOW_NEW_API_WITHOUT_GUARDS_END
-SOFT_LINK_CLASS(AVFoundation, AVSampleBufferDisplayLayer)
-SOFT_LINK_CLASS(AVFoundation, AVStreamSession)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicVisual, NSString*)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicAudible, NSString*)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicLegible, NSString*)
-SOFT_LINK_CONSTANT(AVFoundation, AVSampleBufferDisplayLayerFailedToDecodeNotification, NSString*)
-SOFT_LINK_CONSTANT(AVFoundation, AVSampleBufferDisplayLayerFailedToDecodeNotificationErrorKey, NSString*)
-
-#define AVSampleBufferDisplayLayerFailedToDecodeNotification getAVSampleBufferDisplayLayerFailedToDecodeNotification()
-#define AVSampleBufferDisplayLayerFailedToDecodeNotificationErrorKey getAVSampleBufferDisplayLayerFailedToDecodeNotificationErrorKey()
-
-#define AVMediaCharacteristicVisual getAVMediaCharacteristicVisual()
-#define AVMediaCharacteristicAudible getAVMediaCharacteristicAudible()
-#define AVMediaCharacteristicLegible getAVMediaCharacteristicLegible()
-
</del><span class="cx"> @interface AVSampleBufferDisplayLayer (WebCoreAVSampleBufferDisplayLayerQueueManagementPrivate)
</span><span class="cx"> - (void)prerollDecodeWithCompletionHandler:(void (^)(BOOL success))block;
</span><span class="cx"> @end
</span><span class="lines">@@ -354,7 +332,7 @@
</span><span class="cx">     UNUSED_PARAM(keyPath);
</span><span class="cx">     ASSERT(_parent);
</span><span class="cx"> 
</span><del>-    if ([object isKindOfClass:getAVSampleBufferDisplayLayerClass()]) {
</del><ins>+    if ([object isKindOfClass:PAL::getAVSampleBufferDisplayLayerClass()]) {
</ins><span class="cx">         RetainPtr<AVSampleBufferDisplayLayer> layer = (AVSampleBufferDisplayLayer *)object;
</span><span class="cx">         ASSERT(_layers.contains(layer.get()));
</span><span class="cx"> 
</span><span class="lines">@@ -375,7 +353,7 @@
</span><span class="cx">         } else
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span><del>-    } else if ([object isKindOfClass:getAVSampleBufferAudioRendererClass()]) {
</del><ins>+    } else if ([object isKindOfClass:PAL::getAVSampleBufferAudioRendererClass()]) {
</ins><span class="cx">         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
</span><span class="cx">         RetainPtr<AVSampleBufferAudioRenderer> renderer = (AVSampleBufferAudioRenderer *)object;
</span><span class="cx">         ALLOW_NEW_API_WITHOUT_GUARDS_END
</span><span class="lines">@@ -486,7 +464,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC* parent)
</span><del>-    : m_parser(adoptNS([allocAVStreamDataParserInstance() init]))
</del><ins>+    : m_parser(adoptNS([PAL::allocAVStreamDataParserInstance() init]))
</ins><span class="cx">     , m_delegate(adoptNS([[WebAVStreamDataParserListener alloc] initWithParser:m_parser.get() parent:createWeakPtr()]))
</span><span class="cx">     , m_errorListener(adoptNS([[WebAVSampleBufferErrorListener alloc] initWithParent:createWeakPtr()]))
</span><span class="cx">     , m_isAppendingGroup(adoptOSObject(dispatch_group_create()))
</span><span class="lines">@@ -498,8 +476,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="cx">     ALWAYS_LOG(LOGIDENTIFIER);
</span><del>-    
-    if (![getAVSampleBufferDisplayLayerClass() instancesRespondToSelector:@selector(prerollDecodeWithCompletionHandler:)])
</del><ins>+
+    if (![PAL::getAVSampleBufferDisplayLayerClass() instancesRespondToSelector:@selector(prerollDecodeWithCompletionHandler:)])
</ins><span class="cx">         CMNotificationCenterAddListener(CMNotificationCenterGetDefaultLocalCenter(), reinterpret_cast<void*>(m_mapID), bufferWasConsumedCallback, kCMSampleBufferConsumerNotification_BufferConsumed, nullptr, 0);
</span><span class="cx">     
</span><span class="cx">     m_delegate.get().abortSemaphore = Box<Semaphore>::create(0);
</span><span class="lines">@@ -516,7 +494,7 @@
</span><span class="cx">     destroyParser();
</span><span class="cx">     destroyRenderers();
</span><span class="cx"> 
</span><del>-    if (![getAVSampleBufferDisplayLayerClass() instancesRespondToSelector:@selector(prerollDecodeWithCompletionHandler:)])
</del><ins>+    if (![PAL::getAVSampleBufferDisplayLayerClass() instancesRespondToSelector:@selector(prerollDecodeWithCompletionHandler:)])
</ins><span class="cx">         CMNotificationCenterRemoveListener(CMNotificationCenterGetDefaultLocalCenter(), this, bufferWasConsumedCallback, kCMSampleBufferConsumerNotification_BufferConsumed, nullptr);
</span><span class="cx"> 
</span><span class="cx">     if (m_hasSessionSemaphore)
</span><span class="lines">@@ -909,7 +887,7 @@
</span><span class="cx">         RetainPtr<AVSampleBufferAudioRenderer> renderer;
</span><span class="cx">         ALLOW_NEW_API_WITHOUT_GUARDS_END
</span><span class="cx">         if (!m_audioRenderers.contains(trackID)) {
</span><del>-            renderer = adoptNS([allocAVSampleBufferAudioRendererInstance() init]);
</del><ins>+            renderer = adoptNS([PAL::allocAVSampleBufferAudioRendererInstance() init]);
</ins><span class="cx">             auto weakThis = createWeakPtr();
</span><span class="cx">             [renderer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^{
</span><span class="cx">                 if (weakThis)
</span><span class="lines">@@ -1151,7 +1129,7 @@
</span><span class="cx">         if (m_mediaSource && !m_mediaSource->player()->hasAvailableVideoFrame() && !sample->isNonDisplaying()) {
</span><span class="cx">             DEBUG_LOG(LOGIDENTIFIER, "adding buffer attachment");
</span><span class="cx"> 
</span><del>-            bool havePrerollDecodeWithCompletionHandler = [getAVSampleBufferDisplayLayerClass() instancesRespondToSelector:@selector(prerollDecodeWithCompletionHandler:)];
</del><ins>+            bool havePrerollDecodeWithCompletionHandler = [PAL::getAVSampleBufferDisplayLayerClass() instancesRespondToSelector:@selector(prerollDecodeWithCompletionHandler:)];
</ins><span class="cx"> 
</span><span class="cx">             if (!havePrerollDecodeWithCompletionHandler) {
</span><span class="cx">                 CMSampleBufferRef rawSampleCopy;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -63,10 +63,8 @@
</span><span class="cx"> #import "ThemeMac.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVPlayerLayer)
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> Ref<PlatformCALayer> PlatformCALayerCocoa::create(LayerType layerType, PlatformCALayerClient* owner)
</span><span class="lines">@@ -198,12 +196,12 @@
</span><span class="cx"> 
</span><span class="cx"> PlatformCALayer::LayerType PlatformCALayerCocoa::layerTypeForPlatformLayer(PlatformLayer* layer)
</span><span class="cx"> {
</span><del>-    if ([layer isKindOfClass:getAVPlayerLayerClass()])
</del><ins>+    if ([layer isKindOfClass:PAL::getAVPlayerLayerClass()])
</ins><span class="cx">         return LayerTypeAVPlayerLayer;
</span><span class="cx"> 
</span><span class="cx">     if ([layer isKindOfClass:objc_getClass("WebVideoContainerLayer")]
</span><span class="cx">         && layer.sublayers.count == 1
</span><del>-        && [layer.sublayers[0] isKindOfClass:getAVPlayerLayerClass()])
</del><ins>+        && [layer.sublayers[0] isKindOfClass:PAL::getAVPlayerLayerClass()])
</ins><span class="cx">         return LayerTypeAVPlayerLayer;
</span><span class="cx"> 
</span><span class="cx">     if ([layer isKindOfClass:[WebGLLayer class]])
</span><span class="lines">@@ -263,7 +261,7 @@
</span><span class="cx">         layerClass = [WebTiledBackingLayer class];
</span><span class="cx">         break;
</span><span class="cx">     case LayerTypeAVPlayerLayer:
</span><del>-        layerClass = getAVPlayerLayerClass();
</del><ins>+        layerClass = PAL::getAVPlayerLayerClass();
</ins><span class="cx">         break;
</span><span class="cx">     case LayerTypeContentsProvidedLayer:
</span><span class="cx">         // We don't create PlatformCALayerCocoas wrapped around WebGLLayers or WebGPULayers.
</span><span class="lines">@@ -360,7 +358,7 @@
</span><span class="cx">     newLayer->updateCustomAppearance(customAppearance());
</span><span class="cx"> 
</span><span class="cx">     if (type == LayerTypeAVPlayerLayer) {
</span><del>-        ASSERT([newLayer->platformLayer() isKindOfClass:getAVPlayerLayerClass()]);
</del><ins>+        ASSERT([newLayer->platformLayer() isKindOfClass:PAL::getAVPlayerLayerClass()]);
</ins><span class="cx"> 
</span><span class="cx">         AVPlayerLayer *destinationPlayerLayer = static_cast<PlatformCALayerCocoa&>(newLayer.get()).avPlayerLayer();
</span><span class="cx">         AVPlayerLayer *sourcePlayerLayer = avPlayerLayer();
</span><span class="lines">@@ -1271,12 +1269,12 @@
</span><span class="cx">     if (layerType() != LayerTypeAVPlayerLayer)
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    if ([platformLayer() isKindOfClass:getAVPlayerLayerClass()])
</del><ins>+    if ([platformLayer() isKindOfClass:PAL::getAVPlayerLayerClass()])
</ins><span class="cx">         return static_cast<AVPlayerLayer *>(platformLayer());
</span><span class="cx"> 
</span><span class="cx">     if ([platformLayer() isKindOfClass:objc_getClass("WebVideoContainerLayer")]) {
</span><span class="cx">         ASSERT([platformLayer() sublayers].count == 1);
</span><del>-        ASSERT([[platformLayer() sublayers][0] isKindOfClass:getAVPlayerLayerClass()]);
</del><ins>+        ASSERT([[platformLayer() sublayers][0] isKindOfClass:PAL::getAVPlayerLayerClass()]);
</ins><span class="cx">         return static_cast<AVPlayerLayer *>([platformLayer() sublayers][0]);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaHEVCUtilitiesCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.mm       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -23,20 +23,18 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#include "config.h"
-#include "HEVCUtilitiesCocoa.h"
</del><ins>+#import "config.h"
+#import "HEVCUtilitiesCocoa.h"
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> 
</span><del>-#include "FourCC.h"
-#include "HEVCUtilities.h"
-#include "MediaCapabilitiesInfo.h"
</del><ins>+#import "FourCC.h"
+#import "HEVCUtilities.h"
+#import "MediaCapabilitiesInfo.h"
</ins><span class="cx"> 
</span><del>-#include "VideoToolboxSoftLink.h"
</del><ins>+#import "VideoToolboxSoftLink.h"
+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVVideoCodecTypeHEVCWithAlpha, NSString *)
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> bool validateHEVCParameters(HEVCParameterSet& parameters, MediaCapabilitiesInfo& info, bool hasAlphaChannel)
</span><span class="lines">@@ -43,10 +41,10 @@
</span><span class="cx"> {
</span><span class="cx">     CMVideoCodecType codec = kCMVideoCodecType_HEVC;
</span><span class="cx">     if (hasAlphaChannel) {
</span><del>-        if (!AVFoundationLibrary() || !canLoadAVVideoCodecTypeHEVCWithAlpha())
</del><ins>+        if (!PAL::AVFoundationLibrary() || !PAL::canLoad_AVFoundation_AVVideoCodecTypeHEVCWithAlpha())
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        auto codecCode = FourCC::fromString(getAVVideoCodecTypeHEVCWithAlpha());
</del><ins>+        auto codecCode = FourCC::fromString(AVVideoCodecTypeHEVCWithAlpha);
</ins><span class="cx">         if (!codecCode)
</span><span class="cx">             return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformSpeechSynthesizerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -32,22 +32,36 @@
</span><span class="cx"> #import <AVFoundation/AVSpeechSynthesis.h>
</span><span class="cx"> #import <wtf/BlockObjCExceptions.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVSpeechSynthesizer)
-SOFT_LINK_CLASS(AVFoundation, AVSpeechUtterance)
-SOFT_LINK_CLASS(AVFoundation, AVSpeechSynthesisVoice)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_CONSTANT(AVFoundation, AVSpeechUtteranceDefaultSpeechRate, float)
-SOFT_LINK_CONSTANT(AVFoundation, AVSpeechUtteranceMaximumSpeechRate, float)
</del><ins>+static float getAVSpeechUtteranceDefaultSpeechRate()
+{
+    static float value;
+    static void* symbol;
+    if (!symbol) {
+        void* symbol = dlsym(PAL::AVFoundationLibrary(), "AVSpeechUtteranceDefaultSpeechRate");
+        RELEASE_ASSERT_WITH_MESSAGE(symbol, "%s", dlerror());
+        value = *static_cast<float const *>(symbol);
+    }
+    return value;
+}
</ins><span class="cx"> 
</span><ins>+static float getAVSpeechUtteranceMaximumSpeechRate()
+{
+    static float value;
+    static void* symbol;
+    if (!symbol) {
+        void* symbol = dlsym(PAL::AVFoundationLibrary(), "AVSpeechUtteranceMaximumSpeechRate");
+        RELEASE_ASSERT_WITH_MESSAGE(symbol, "%s", dlerror());
+        value = *static_cast<float const *>(symbol);
+    }
+    return value;
+}
+
</ins><span class="cx"> #define AVSpeechUtteranceDefaultSpeechRate getAVSpeechUtteranceDefaultSpeechRate()
</span><span class="cx"> #define AVSpeechUtteranceMaximumSpeechRate getAVSpeechUtteranceMaximumSpeechRate()
</span><span class="cx"> 
</span><del>-#define AVSpeechUtteranceClass getAVSpeechUtteranceClass()
-#define AVSpeechSynthesisVoiceClass getAVSpeechSynthesisVoiceClass()
-
</del><span class="cx"> @interface WebSpeechSynthesisWrapper : NSObject<AVSpeechSynthesizerDelegate>
</span><span class="cx"> {
</span><span class="cx">     WebCore::PlatformSpeechSynthesizer* m_synthesizerObject;
</span><span class="lines">@@ -96,7 +110,7 @@
</span><span class="cx"> 
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx">     if (!m_synthesizer) {
</span><del>-        m_synthesizer = adoptNS([allocAVSpeechSynthesizerInstance() init]);
</del><ins>+        m_synthesizer = adoptNS([PAL::allocAVSpeechSynthesizerInstance() init]);
</ins><span class="cx">         [m_synthesizer setDelegate:self];
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -106,7 +120,7 @@
</span><span class="cx">     NSString *voiceLanguage = nil;
</span><span class="cx">     if (!utteranceVoice) {
</span><span class="cx">         if (utterance->lang().isEmpty())
</span><del>-            voiceLanguage = [AVSpeechSynthesisVoiceClass currentLanguageCode];
</del><ins>+            voiceLanguage = [PAL::getAVSpeechSynthesisVoiceClass() currentLanguageCode];
</ins><span class="cx">         else
</span><span class="cx">             voiceLanguage = utterance->lang();
</span><span class="cx">     } else
</span><span class="lines">@@ -114,9 +128,9 @@
</span><span class="cx"> 
</span><span class="cx">     AVSpeechSynthesisVoice *avVoice = nil;
</span><span class="cx">     if (voiceLanguage)
</span><del>-        avVoice = [AVSpeechSynthesisVoiceClass voiceWithLanguage:voiceLanguage];
</del><ins>+        avVoice = [PAL::getAVSpeechSynthesisVoiceClass() voiceWithLanguage:voiceLanguage];
</ins><span class="cx"> 
</span><del>-    AVSpeechUtterance *avUtterance = [AVSpeechUtteranceClass speechUtteranceWithString:utterance->text()];
</del><ins>+    AVSpeechUtterance *avUtterance = [PAL::getAVSpeechUtteranceClass() speechUtteranceWithString:utterance->text()];
</ins><span class="cx"> 
</span><span class="cx">     [avUtterance setRate:[self mapSpeechRateToPlatformRate:utterance->rate()]];
</span><span class="cx">     [avUtterance setVolume:utterance->volume()];
</span><span class="lines">@@ -244,7 +258,7 @@
</span><span class="cx"> void PlatformSpeechSynthesizer::initializeVoiceList()
</span><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-    for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoiceClass speechVoices]) {
</del><ins>+    for (AVSpeechSynthesisVoice *voice in [PAL::getAVSpeechSynthesisVoiceClass() speechVoices]) {
</ins><span class="cx">         NSString *language = [voice language];
</span><span class="cx">         bool isDefault = true;
</span><span class="cx">         NSString *voiceURI = [voice identifier];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -43,7 +43,6 @@
</span><span class="cx"> #import <UIKit/UIWindow.h>
</span><span class="cx"> #import <objc/message.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><del>-#import <pal/ios/UIKitSoftLink.h>
</del><span class="cx"> #import <pal/spi/cocoa/AVKitSPI.h>
</span><span class="cx"> #import <pal/spi/ios/UIKitSPI.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="lines">@@ -52,15 +51,10 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><del>-// Soft-linking headers must be included last since they #define functions, constants, etc.
</del><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
+#import <pal/ios/UIKitSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResize, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspect, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspectFill, NSString *)
-
</del><span class="cx"> SOFTLINK_AVKIT_FRAMEWORK()
</span><span class="cx"> SOFT_LINK_CLASS_OPTIONAL(AVKit, AVPictureInPictureController)
</span><span class="cx"> SOFT_LINK_CLASS_OPTIONAL(AVKit, AVPlayerViewController)
</span><span class="lines">@@ -210,7 +204,7 @@
</span><span class="cx">     self = [super init];
</span><span class="cx">     if (self) {
</span><span class="cx">         [self setMasksToBounds:YES];
</span><del>-        _videoGravity = getAVLayerVideoGravityResizeAspect();
</del><ins>+        _videoGravity = AVLayerVideoGravityResizeAspect;
</ins><span class="cx">     }
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="lines">@@ -270,13 +264,13 @@
</span><span class="cx">     FloatRect targetVideoFrame;
</span><span class="cx">     float videoAspectRatio = self.videoDimensions.width / self.videoDimensions.height;
</span><span class="cx">     
</span><del>-    if ([getAVLayerVideoGravityResize() isEqualToString:self.videoGravity]) {
</del><ins>+    if ([AVLayerVideoGravityResize isEqualToString:self.videoGravity]) {
</ins><span class="cx">         sourceVideoFrame = self.modelVideoLayerFrame;
</span><span class="cx">         targetVideoFrame = self.bounds;
</span><del>-    } else if ([getAVLayerVideoGravityResizeAspect() isEqualToString:self.videoGravity]) {
</del><ins>+    } else if ([AVLayerVideoGravityResizeAspect isEqualToString:self.videoGravity]) {
</ins><span class="cx">         sourceVideoFrame = largestRectWithAspectRatioInsideRect(videoAspectRatio, self.modelVideoLayerFrame);
</span><span class="cx">         targetVideoFrame = largestRectWithAspectRatioInsideRect(videoAspectRatio, self.bounds);
</span><del>-    } else if ([getAVLayerVideoGravityResizeAspectFill() isEqualToString:self.videoGravity]) {
</del><ins>+    } else if ([AVLayerVideoGravityResizeAspectFill isEqualToString:self.videoGravity]) {
</ins><span class="cx">         sourceVideoFrame = smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.modelVideoLayerFrame);
</span><span class="cx">         self.modelVideoLayerFrame = CGRectMake(0, 0, sourceVideoFrame.width(), sourceVideoFrame.height());
</span><span class="cx">         if (auto* model = _fullscreenInterface->videoFullscreenModel())
</span><span class="lines">@@ -328,7 +322,7 @@
</span><span class="cx"> #if PLATFORM(IOSMAC)
</span><span class="cx">     // FIXME<rdar://46011230>: remove this #if once this radar lands.
</span><span class="cx">     if (!videoGravity)
</span><del>-        videoGravity = getAVLayerVideoGravityResizeAspect();
</del><ins>+        videoGravity = AVLayerVideoGravityResizeAspect;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     _videoGravity = videoGravity;
</span><span class="lines">@@ -337,11 +331,11 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     WebCore::MediaPlayerEnums::VideoGravity gravity = WebCore::MediaPlayerEnums::VideoGravityResizeAspect;
</span><del>-    if (videoGravity == getAVLayerVideoGravityResize())
</del><ins>+    if (videoGravity == AVLayerVideoGravityResize)
</ins><span class="cx">         gravity = WebCore::MediaPlayerEnums::VideoGravityResize;
</span><del>-    if (videoGravity == getAVLayerVideoGravityResizeAspect())
</del><ins>+    if (videoGravity == AVLayerVideoGravityResizeAspect)
</ins><span class="cx">         gravity = WebCore::MediaPlayerEnums::VideoGravityResizeAspect;
</span><del>-    else if (videoGravity == getAVLayerVideoGravityResizeAspectFill())
</del><ins>+    else if (videoGravity == AVLayerVideoGravityResizeAspectFill)
</ins><span class="cx">         gravity = WebCore::MediaPlayerEnums::VideoGravityResizeAspectFill;
</span><span class="cx">     else
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -362,9 +356,9 @@
</span><span class="cx">     
</span><span class="cx">     float videoAspectRatio = self.videoDimensions.width / self.videoDimensions.height;
</span><span class="cx"> 
</span><del>-    if ([getAVLayerVideoGravityResizeAspect() isEqualToString:self.videoGravity])
</del><ins>+    if ([AVLayerVideoGravityResizeAspect isEqualToString:self.videoGravity])
</ins><span class="cx">         return largestRectWithAspectRatioInsideRect(videoAspectRatio, self.bounds);
</span><del>-    if ([getAVLayerVideoGravityResizeAspectFill() isEqualToString:self.videoGravity])
</del><ins>+    if ([AVLayerVideoGravityResizeAspectFill isEqualToString:self.videoGravity])
</ins><span class="cx">         return smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.bounds);
</span><span class="cx"> 
</span><span class="cx">     return self.bounds;
</span><span class="lines">@@ -460,7 +454,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebAVPlayerLayer *playerLayer = (WebAVPlayerLayer *)[playerLayerView playerLayer];
</span><span class="cx">     WebAVPlayerLayer *pipPlayerLayer = (WebAVPlayerLayer *)[pipView layer];
</span><del>-    [playerLayer setVideoGravity:getAVLayerVideoGravityResizeAspect()];
</del><ins>+    [playerLayer setVideoGravity:AVLayerVideoGravityResizeAspect];
</ins><span class="cx">     [pipPlayerLayer setVideoSublayer:playerLayer.videoSublayer];
</span><span class="cx">     [pipPlayerLayer setVideoDimensions:playerLayer.videoDimensions];
</span><span class="cx">     [pipPlayerLayer setVideoGravity:playerLayer.videoGravity];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacSerializedPlatformRepresentationMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm 2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm    2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -38,15 +38,10 @@
</span><span class="cx"> #import <JavaScriptCore/JSObjectRef.h>
</span><span class="cx"> #import <JavaScriptCore/JavaScriptCore.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> #import <wtf/text/Base64.h>
</span><span class="cx"> 
</span><del>-typedef AVMetadataItem AVMetadataItemType;
-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
-#define AVMetadataItem getAVMetadataItemClass()
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> #if JSC_OBJC_API_ENABLED
</span><span class="lines">@@ -53,7 +48,7 @@
</span><span class="cx"> static JSValue *jsValueWithDataInContext(NSData *, JSContext *);
</span><span class="cx"> static JSValue *jsValueWithArrayInContext(NSArray *, JSContext *);
</span><span class="cx"> static JSValue *jsValueWithDictionaryInContext(NSDictionary *, JSContext *);
</span><del>-static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItemType *, JSContext *);
</del><ins>+static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *, JSContext *);
</ins><span class="cx"> static JSValue *jsValueWithValueInContext(id, JSContext *);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -136,7 +131,7 @@
</span><span class="cx">     if ([value isKindOfClass:[NSData class]])
</span><span class="cx">         return jsValueWithDataInContext(value, context);
</span><span class="cx"> 
</span><del>-    if ([value isKindOfClass:[AVMetadataItem class]])
</del><ins>+    if ([value isKindOfClass:PAL::getAVMetadataItemClass()])
</ins><span class="cx">         return jsValueWithAVMetadataItemInContext(value, context);
</span><span class="cx"> 
</span><span class="cx">     return nil;
</span><span class="lines">@@ -199,7 +194,7 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItemType *item, JSContext *context)
</del><ins>+static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSContext *context)
</ins><span class="cx"> {
</span><span class="cx">     NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediarecordercocoaMediaRecorderPrivateWriterCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm     2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm        2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -37,52 +37,15 @@
</span><span class="cx"> #include <pal/cf/CoreMediaSoftLink.h>
</span><span class="cx"> #include <wtf/FileSystem.h>
</span><span class="cx"> 
</span><del>-typedef AVAssetWriter AVAssetWriterType;
-typedef AVAssetWriterInput AVAssetWriterInputType;
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS(AVFoundation, AVAssetWriter)
-SOFT_LINK_CLASS(AVFoundation, AVAssetWriterInput)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVFileTypeMPEG4, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoCodecKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoCodecH264, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoWidthKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoHeightKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeVideo, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeAudio, NSString *)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoExpectedSourceFrameRateKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoProfileLevelKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoAverageBitRateKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoMaxKeyFrameIntervalKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoProfileLevelH264MainAutoLevel, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVVideoCompressionPropertiesKey, NSString *)
-
-#define AVFileTypeMPEG4 getAVFileTypeMPEG4()
-#define AVMediaTypeAudio getAVMediaTypeAudio()
-#define AVMediaTypeVideo getAVMediaTypeVideo()
-#define AVVideoCodecKey getAVVideoCodecKey()
-#define AVVideoCodecH264 getAVVideoCodecH264()
-#define AVVideoWidthKey getAVVideoWidthKey()
-#define AVVideoHeightKey getAVVideoHeightKey()
-
-#define AVVideoExpectedSourceFrameRateKey getAVVideoExpectedSourceFrameRateKey()
-#define AVVideoProfileLevelKey getAVVideoProfileLevelKey()
-#define AVVideoAverageBitRateKey getAVVideoAverageBitRateKey()
-#define AVVideoMaxKeyFrameIntervalKey getAVVideoMaxKeyFrameIntervalKey()
-#define AVVideoProfileLevelH264MainAutoLevel getAVVideoProfileLevelH264MainAutoLevel()
-#define AVVideoCompressionPropertiesKey getAVVideoCompressionPropertiesKey()
-
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVEncoderBitRateKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVFormatIDKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVNumberOfChannelsKey, NSString *)
-SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVSampleRateKey, NSString *)
-
</del><ins>+#undef AVEncoderBitRateKey
</ins><span class="cx"> #define AVEncoderBitRateKey getAVEncoderBitRateKeyWithFallback()
</span><ins>+#undef AVFormatIDKey
</ins><span class="cx"> #define AVFormatIDKey getAVFormatIDKeyWithFallback()
</span><ins>+#undef AVNumberOfChannelsKey
</ins><span class="cx"> #define AVNumberOfChannelsKey getAVNumberOfChannelsKeyWithFallback()
</span><ins>+#undef AVSampleRateKey
</ins><span class="cx"> #define AVSampleRateKey getAVSampleRateKeyWithFallback()
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -91,8 +54,8 @@
</span><span class="cx"> 
</span><span class="cx"> static NSString *getAVFormatIDKeyWithFallback()
</span><span class="cx"> {
</span><del>-    if (canLoadAVFormatIDKey())
-        return getAVFormatIDKey();
</del><ins>+    if (PAL::canLoad_AVFoundation_AVFormatIDKey())
+        return PAL::get_AVFoundation_AVFormatIDKey();
</ins><span class="cx"> 
</span><span class="cx">     RELEASE_LOG_ERROR(Media, "Failed to load AVFormatIDKey");
</span><span class="cx">     return @"AVFormatIDKey";
</span><span class="lines">@@ -100,8 +63,8 @@
</span><span class="cx"> 
</span><span class="cx"> static NSString *getAVNumberOfChannelsKeyWithFallback()
</span><span class="cx"> {
</span><del>-    if (canLoadAVNumberOfChannelsKey())
-        return getAVNumberOfChannelsKey();
</del><ins>+    if (PAL::canLoad_AVFoundation_AVNumberOfChannelsKey())
+        return PAL::get_AVFoundation_AVNumberOfChannelsKey();
</ins><span class="cx"> 
</span><span class="cx">     RELEASE_LOG_ERROR(Media, "Failed to load AVNumberOfChannelsKey");
</span><span class="cx">     return @"AVNumberOfChannelsKey";
</span><span class="lines">@@ -109,8 +72,8 @@
</span><span class="cx"> 
</span><span class="cx"> static NSString *getAVSampleRateKeyWithFallback()
</span><span class="cx"> {
</span><del>-    if (canLoadAVSampleRateKey())
-        return getAVSampleRateKey();
</del><ins>+    if (PAL::canLoad_AVFoundation_AVSampleRateKey())
+        return PAL::get_AVFoundation_AVSampleRateKey();
</ins><span class="cx"> 
</span><span class="cx">     RELEASE_LOG_ERROR(Media, "Failed to load AVSampleRateKey");
</span><span class="cx">     return @"AVSampleRateKey";
</span><span class="lines">@@ -118,8 +81,8 @@
</span><span class="cx"> 
</span><span class="cx"> static NSString *getAVEncoderBitRateKeyWithFallback()
</span><span class="cx"> {
</span><del>-    if (canLoadAVEncoderBitRateKey())
-        return getAVEncoderBitRateKey();
</del><ins>+    if (PAL::canLoad_AVFoundation_AVEncoderBitRateKey())
+        return PAL::get_AVFoundation_AVEncoderBitRateKey();
</ins><span class="cx"> 
</span><span class="cx">     RELEASE_LOG_ERROR(Media, "Failed to load AVEncoderBitRateKey");
</span><span class="cx">     return @"AVEncoderBitRateKey";
</span><span class="lines">@@ -134,7 +97,7 @@
</span><span class="cx">     NSURL *outputURL = [NSURL fileURLWithPath:path];
</span><span class="cx">     String filePath = [path UTF8String];
</span><span class="cx">     NSError *error = nil;
</span><del>-    auto avAssetWriter = adoptNS([allocAVAssetWriterInstance() initWithURL:outputURL fileType:AVFileTypeMPEG4 error:&error]);
</del><ins>+    auto avAssetWriter = adoptNS([PAL::allocAVAssetWriterInstance() initWithURL:outputURL fileType:AVFileTypeMPEG4 error:&error]);
</ins><span class="cx">     if (error) {
</span><span class="cx">         RELEASE_LOG_ERROR(MediaStream, "create AVAssetWriter instance failed with error code %ld", (long)error.code);
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -197,7 +160,7 @@
</span><span class="cx">         AVVideoCompressionPropertiesKey: compressionProperties
</span><span class="cx">     };
</span><span class="cx">     
</span><del>-    m_videoInput = adoptNS([allocAVAssetWriterInputInstance() initWithMediaType:AVMediaTypeVideo outputSettings:videoSettings sourceFormatHint:nil]);
</del><ins>+    m_videoInput = adoptNS([PAL::allocAVAssetWriterInputInstance() initWithMediaType:AVMediaTypeVideo outputSettings:videoSettings sourceFormatHint:nil]);
</ins><span class="cx">     [m_videoInput setExpectsMediaDataInRealTime:true];
</span><span class="cx">     
</span><span class="cx">     if (![m_writer canAddInput:m_videoInput.get()]) {
</span><span class="lines">@@ -221,7 +184,7 @@
</span><span class="cx">         AVSampleRateKey : @(22050)
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    m_audioInput = adoptNS([allocAVAssetWriterInputInstance() initWithMediaType:AVMediaTypeAudio outputSettings:audioSettings sourceFormatHint:nil]);
</del><ins>+    m_audioInput = adoptNS([PAL::allocAVAssetWriterInputInstance() initWithMediaType:AVMediaTypeAudio outputSettings:audioSettings sourceFormatHint:nil]);
</ins><span class="cx">     [m_audioInput setExpectsMediaDataInRealTime:true];
</span><span class="cx">     
</span><span class="cx">     if (![m_writer canAddInput:m_audioInput.get()]) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeVideoSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.h (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.h  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.h     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> 
</span><del>-#include "FontCascade.h"
</del><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "MediaSample.h"
</span><span class="cx"> #include "RealtimeMediaSource.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamVideoPreseth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/VideoPreset.h (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/VideoPreset.h  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediastream/VideoPreset.h     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> 
</span><del>-#include "FontCascade.h"
</del><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "MediaSample.h"
</span><span class="cx"> #include "RealtimeMediaSource.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamiosAVAudioSessionCaptureDeviceManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm      2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm 2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -23,20 +23,17 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#include "config.h"
-#include "AVAudioSessionCaptureDeviceManager.h"
</del><ins>+#import "config.h"
+#import "AVAudioSessionCaptureDeviceManager.h"
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM) && PLATFORM(IOS_FAMILY)
</span><span class="cx"> 
</span><del>-#include "AVAudioSessionCaptureDevice.h"
-#include "RealtimeMediaSourceCenter.h"
-#include <AVFoundation/AVAudioSession.h>
-#include <wtf/SoftLinking.h>
-#include <wtf/Vector.h>
</del><ins>+#import "AVAudioSessionCaptureDevice.h"
+#import "RealtimeMediaSourceCenter.h"
+#import <AVFoundation/AVAudioSession.h>
+#import <wtf/Vector.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVAudioSession)
-#define AVAudioSession getAVAudioSessionClass()
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><span class="cx"> void* AvailableInputsContext = &AvailableInputsContext;
</span><span class="cx"> 
</span><span class="lines">@@ -127,13 +124,13 @@
</span><span class="cx">         m_listener = adoptNS([[WebAVAudioSessionAvailableInputsListener alloc] initWithCallback:[this] {
</span><span class="cx">             refreshAudioCaptureDevices();
</span><span class="cx">         }]);
</span><del>-        [[AVAudioSession sharedInstance] addObserver:m_listener.get() forKeyPath:@"availableInputs" options:0 context:AvailableInputsContext];
</del><ins>+        [[PAL::getAVAudioSessionClass() sharedInstance] addObserver:m_listener.get() forKeyPath:@"availableInputs" options:0 context:AvailableInputsContext];
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Vector<AVAudioSessionCaptureDevice> newAudioDevices;
</span><span class="cx">     Vector<CaptureDevice> newDevices;
</span><span class="cx"> 
</span><del>-    for (AVAudioSessionPortDescription *portDescription in [AVAudioSession sharedInstance].availableInputs) {
</del><ins>+    for (AVAudioSessionPortDescription *portDescription in [PAL::getAVAudioSessionClass() sharedInstance].availableInputs) {
</ins><span class="cx">         auto audioDevice = AVAudioSessionCaptureDevice::create(portDescription);
</span><span class="cx">         newDevices.append(audioDevice);
</span><span class="cx">         newAudioDevices.append(WTFMove(audioDevice));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamiosCoreAudioCaptureSourceIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -31,22 +31,9 @@
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import <AVFoundation/AVAudioSession.h>
</span><span class="cx"> #import <wtf/MainThread.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-typedef AVAudioSession AVAudioSessionType;
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVAudioSession)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionInterruptionNotification, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionInterruptionTypeKey, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionMediaServicesWereResetNotification, NSString *)
-
-#define AVAudioSession getAVAudioSessionClass()
-#define AVAudioSessionInterruptionNotification getAVAudioSessionInterruptionNotification()
-#define AVAudioSessionInterruptionTypeKey getAVAudioSessionInterruptionTypeKey()
-#define AVAudioSessionMediaServicesWereResetNotification getAVAudioSessionMediaServicesWereResetNotification()
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface WebCoreAudioCaptureSourceIOSListener : NSObject {
</span><span class="lines">@@ -68,7 +55,7 @@
</span><span class="cx">     _callback = callback;
</span><span class="cx"> 
</span><span class="cx">     NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
</span><del>-    AVAudioSessionType* session = [AVAudioSession sharedInstance];
</del><ins>+    AVAudioSession* session = [PAL::getAVAudioSessionClass() sharedInstance];
</ins><span class="cx"> 
</span><span class="cx">     [center addObserver:self selector:@selector(handleInterruption:) name:AVAudioSessionInterruptionNotification object:session];
</span><span class="cx">     [center addObserver:self selector:@selector(sessionMediaServicesWereReset:) name:AVAudioSessionMediaServicesWereResetNotification object:session];
</span><span class="lines">@@ -95,7 +82,7 @@
</span><span class="cx"> 
</span><span class="cx">     if ([[notification.userInfo valueForKey:AVAudioSessionInterruptionTypeKey] intValue] == AVAudioSessionInterruptionTypeEnded) {
</span><span class="cx">         NSError *error = nil;
</span><del>-        [[AVAudioSession sharedInstance] setActive:YES error:&error];
</del><ins>+        [[PAL::getAVAudioSessionClass() sharedInstance] setActive:YES error:&error];
</ins><span class="cx"> 
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="cx">         if (error)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -41,28 +41,9 @@
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx"> #import <wtf/MainThread.h>
</span><span class="cx"> #import <wtf/NeverDestroyed.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-typedef AVCaptureDevice AVCaptureDeviceTypedef;
-typedef AVCaptureSession AVCaptureSessionType;
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS(AVFoundation, AVCaptureDevice)
-SOFT_LINK_CLASS(AVFoundation, AVCaptureSession)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeAudio, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeMuxed, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeVideo, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVCaptureDeviceWasConnectedNotification, NSString *)
-SOFT_LINK_CONSTANT(AVFoundation, AVCaptureDeviceWasDisconnectedNotification, NSString *)
-
-#define AVMediaTypeAudio getAVMediaTypeAudio()
-#define AVMediaTypeMuxed getAVMediaTypeMuxed()
-#define AVMediaTypeVideo getAVMediaTypeVideo()
-#define AVCaptureDeviceWasConnectedNotification getAVCaptureDeviceWasConnectedNotification()
-#define AVCaptureDeviceWasDisconnectedNotification getAVCaptureDeviceWasDisconnectedNotification()
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface WebCoreAVCaptureDeviceManagerObserver : NSObject
</span><span class="lines">@@ -99,7 +80,7 @@
</span><span class="cx">     return captureDevicesInternal();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline static bool deviceIsAvailable(AVCaptureDeviceTypedef *device)
</del><ins>+inline static bool deviceIsAvailable(AVCaptureDevice *device)
</ins><span class="cx"> {
</span><span class="cx">     if (![device isConnected])
</span><span class="cx">         return false;
</span><span class="lines">@@ -114,20 +95,20 @@
</span><span class="cx"> 
</span><span class="cx"> void AVCaptureDeviceManager::updateCachedAVCaptureDevices()
</span><span class="cx"> {
</span><del>-    auto* currentDevices = [getAVCaptureDeviceClass() devices];
</del><ins>+    auto* currentDevices = [PAL::getAVCaptureDeviceClass() devices];
</ins><span class="cx">     auto changedDevices = adoptNS([[NSMutableArray alloc] init]);
</span><del>-    for (AVCaptureDeviceTypedef *cachedDevice in m_avCaptureDevices.get()) {
</del><ins>+    for (AVCaptureDevice *cachedDevice in m_avCaptureDevices.get()) {
</ins><span class="cx">         if (![currentDevices containsObject:cachedDevice])
</span><span class="cx">             [changedDevices addObject:cachedDevice];
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ([changedDevices count]) {
</span><del>-        for (AVCaptureDeviceTypedef *device in changedDevices.get())
</del><ins>+        for (AVCaptureDevice *device in changedDevices.get())
</ins><span class="cx">             [device removeObserver:m_objcObserver.get() forKeyPath:@"suspended"];
</span><span class="cx">         [m_avCaptureDevices removeObjectsInArray:changedDevices.get()];
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (AVCaptureDeviceTypedef *device in currentDevices) {
</del><ins>+    for (AVCaptureDevice *device in currentDevices) {
</ins><span class="cx"> 
</span><span class="cx">         if (![device hasMediaType:AVMediaTypeVideo] && ![device hasMediaType:AVMediaTypeMuxed])
</span><span class="cx">             continue;
</span><span class="lines">@@ -151,9 +132,9 @@
</span><span class="cx">     updateCachedAVCaptureDevices();
</span><span class="cx"> 
</span><span class="cx">     bool deviceHasChanged = false;
</span><del>-    auto* currentDevices = [getAVCaptureDeviceClass() devices];
</del><ins>+    auto* currentDevices = [PAL::getAVCaptureDeviceClass() devices];
</ins><span class="cx">     Vector<CaptureDevice> deviceList;
</span><del>-    for (AVCaptureDeviceTypedef *platformDevice in currentDevices) {
</del><ins>+    for (AVCaptureDevice *platformDevice in currentDevices) {
</ins><span class="cx"> 
</span><span class="cx">         if (![platformDevice hasMediaType:AVMediaTypeVideo] && ![platformDevice hasMediaType:AVMediaTypeMuxed])
</span><span class="cx">             continue;
</span><span class="lines">@@ -179,7 +160,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool AVCaptureDeviceManager::isAvailable()
</span><span class="cx"> {
</span><del>-    return AVFoundationLibrary();
</del><ins>+    return PAL::AVFoundationLibrary();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AVCaptureDeviceManager& AVCaptureDeviceManager::singleton()
</span><span class="lines">@@ -197,7 +178,7 @@
</span><span class="cx"> {
</span><span class="cx">     [[NSNotificationCenter defaultCenter] removeObserver:m_objcObserver.get()];
</span><span class="cx">     [m_objcObserver disconnect];
</span><del>-    for (AVCaptureDeviceTypedef *device in m_avCaptureDevices.get())
</del><ins>+    for (AVCaptureDevice *device in m_avCaptureDevices.get())
</ins><span class="cx">         [device removeObserver:m_objcObserver.get() forKeyPath:@"suspended"];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -45,56 +45,10 @@
</span><span class="cx"> #import <AVFoundation/AVError.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx"> 
</span><ins>+#import "CoreVideoSoftLink.h"
+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><del>-#import "CoreVideoSoftLink.h"
</del><span class="cx"> 
</span><del>-typedef AVCaptureConnection AVCaptureConnectionType;
-typedef AVCaptureDevice AVCaptureDeviceTypedef;
-typedef AVCaptureDeviceFormat AVCaptureDeviceFormatType;
-typedef AVCaptureDeviceInput AVCaptureDeviceInputType;
-typedef AVCaptureOutput AVCaptureOutputType;
-typedef AVCaptureVideoDataOutput AVCaptureVideoDataOutputType;
-typedef AVFrameRateRange AVFrameRateRangeType;
-typedef AVCaptureSession AVCaptureSessionType;
-
-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-
-SOFT_LINK_CLASS(AVFoundation, AVCaptureConnection)
-SOFT_LINK_CLASS(AVFoundation, AVCaptureDevice)
-SOFT_LINK_CLASS(AVFoundation, AVCaptureDeviceFormat)
-SOFT_LINK_CLASS(AVFoundation, AVCaptureDeviceInput)
-SOFT_LINK_CLASS(AVFoundation, AVCaptureOutput)
-SOFT_LINK_CLASS(AVFoundation, AVCaptureVideoDataOutput)
-SOFT_LINK_CLASS(AVFoundation, AVFrameRateRange)
-SOFT_LINK_CLASS(AVFoundation, AVCaptureSession)
-
-#define AVCaptureConnection getAVCaptureConnectionClass()
-#define AVCaptureDevice getAVCaptureDeviceClass()
-#define AVCaptureDeviceFormat getAVCaptureDeviceFormatClass()
-#define AVCaptureDeviceInput getAVCaptureDeviceInputClass()
-#define AVCaptureOutput getAVCaptureOutputClass()
-#define AVCaptureVideoDataOutput getAVCaptureVideoDataOutputClass()
-#define AVFrameRateRange getAVFrameRateRangeClass()
-
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeVideo, NSString *)
-
-SOFT_LINK_CONSTANT(AVFoundation, AVCaptureDeviceWasDisconnectedNotification, NSString *)
-#define AVCaptureDeviceWasDisconnectedNotification getAVCaptureDeviceWasDisconnectedNotification()
-
-#if PLATFORM(IOS_FAMILY)
-SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVCaptureSessionRuntimeErrorNotification, NSString *)
-SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVCaptureSessionWasInterruptedNotification, NSString *)
-SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVCaptureSessionInterruptionEndedNotification, NSString *)
-SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVCaptureSessionInterruptionReasonKey, NSString *)
-SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVCaptureSessionErrorKey, NSString *)
-
-#define AVCaptureSessionRuntimeErrorNotification getAVCaptureSessionRuntimeErrorNotification()
-#define AVCaptureSessionWasInterruptedNotification getAVCaptureSessionWasInterruptedNotification()
-#define AVCaptureSessionInterruptionEndedNotification getAVCaptureSessionInterruptionEndedNotification()
-#define AVCaptureSessionInterruptionReasonKey getAVCaptureSessionInterruptionReasonKey()
-#define AVCaptureSessionErrorKey getAVCaptureSessionErrorKey()
-#endif
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace PAL;
</span><span class="cx"> 
</span><span class="lines">@@ -106,7 +60,7 @@
</span><span class="cx"> -(void)disconnect;
</span><span class="cx"> -(void)addNotificationObservers;
</span><span class="cx"> -(void)removeNotificationObservers;
</span><del>--(void)captureOutput:(AVCaptureOutputType*)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnectionType*)connection;
</del><ins>+-(void)captureOutput:(AVCaptureOutput*)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection*)connection;
</ins><span class="cx"> -(void)observeValueForKeyPath:keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context;
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx"> -(void)sessionRuntimeError:(NSNotification*)notification;
</span><span class="lines">@@ -140,23 +94,23 @@
</span><span class="cx"> 
</span><span class="cx"> class AVVideoPreset : public VideoPreset {
</span><span class="cx"> public:
</span><del>-    static Ref<AVVideoPreset> create(IntSize size, Vector<FrameRateRange>&& frameRateRanges, AVCaptureDeviceFormatType* format)
</del><ins>+    static Ref<AVVideoPreset> create(IntSize size, Vector<FrameRateRange>&& frameRateRanges, AVCaptureDeviceFormat* format)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(*new AVVideoPreset(size, WTFMove(frameRateRanges), format));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    AVVideoPreset(IntSize size, Vector<FrameRateRange>&& frameRateRanges, AVCaptureDeviceFormatType* format)
</del><ins>+    AVVideoPreset(IntSize size, Vector<FrameRateRange>&& frameRateRanges, AVCaptureDeviceFormat* format)
</ins><span class="cx">         : VideoPreset(size, WTFMove(frameRateRanges), AVCapture)
</span><span class="cx">         , format(format)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RetainPtr<AVCaptureDeviceFormatType> format;
</del><ins>+    RetainPtr<AVCaptureDeviceFormat> format;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> CaptureSourceOrError AVVideoCaptureSource::create(String&& id, String&& hashSalt, const MediaConstraints* constraints)
</span><span class="cx"> {
</span><del>-    AVCaptureDeviceTypedef *device = [getAVCaptureDeviceClass() deviceWithUniqueID:id];
</del><ins>+    AVCaptureDevice *device = [PAL::getAVCaptureDeviceClass() deviceWithUniqueID:id];
</ins><span class="cx">     if (!device)
</span><span class="cx">         return { };
</span><span class="cx"> 
</span><span class="lines">@@ -170,7 +124,7 @@
</span><span class="cx">     return CaptureSourceOrError(WTFMove(source));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AVVideoCaptureSource::AVVideoCaptureSource(AVCaptureDeviceTypedef* device, String&& id, String&& hashSalt)
</del><ins>+AVVideoCaptureSource::AVVideoCaptureSource(AVCaptureDevice* device, String&& id, String&& hashSalt)
</ins><span class="cx">     : RealtimeVideoSource(device.localizedName, WTFMove(id), WTFMove(hashSalt))
</span><span class="cx">     , m_objcObserver(adoptNS([[WebCoreAVVideoCaptureSourceObserver alloc] initWithCallback:this]))
</span><span class="cx">     , m_device(device)
</span><span class="lines">@@ -305,7 +259,7 @@
</span><span class="cx">     RealtimeMediaSourceCapabilities capabilities(settings().supportedConstraints());
</span><span class="cx">     capabilities.setDeviceId(hashedId());
</span><span class="cx"> 
</span><del>-    AVCaptureDeviceTypedef *videoDevice = device();
</del><ins>+    AVCaptureDevice *videoDevice = device();
</ins><span class="cx">     if ([videoDevice position] == AVCaptureDevicePositionFront)
</span><span class="cx">         capabilities.addFacingMode(RealtimeMediaSourceSettings::User);
</span><span class="cx">     if ([videoDevice position] == AVCaptureDevicePositionBack)
</span><span class="lines">@@ -421,9 +375,9 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline int sensorOrientationFromVideoOutput(AVCaptureVideoDataOutputType* videoOutput)
</del><ins>+static inline int sensorOrientationFromVideoOutput(AVCaptureVideoDataOutput* videoOutput)
</ins><span class="cx"> {
</span><del>-    AVCaptureConnectionType* connection = [videoOutput connectionWithMediaType: getAVMediaTypeVideo()];
</del><ins>+    AVCaptureConnection* connection = [videoOutput connectionWithMediaType:AVMediaTypeVideo];
</ins><span class="cx">     return connection ? sensorOrientation([connection videoOrientation]) : 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -434,7 +388,7 @@
</span><span class="cx"> 
</span><span class="cx">     ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER);
</span><span class="cx"> 
</span><del>-    m_session = adoptNS([allocAVCaptureSessionInstance() init]);
</del><ins>+    m_session = adoptNS([PAL::allocAVCaptureSessionInstance() init]);
</ins><span class="cx">     [m_session addObserver:m_objcObserver.get() forKeyPath:@"running" options:NSKeyValueObservingOptionNew context:(void *)nil];
</span><span class="cx"> 
</span><span class="cx">     [m_session beginConfiguration];
</span><span class="lines">@@ -447,10 +401,10 @@
</span><span class="cx">     return success;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AVFrameRateRangeType* AVVideoCaptureSource::frameDurationForFrameRate(double rate)
</del><ins>+AVFrameRateRange* AVVideoCaptureSource::frameDurationForFrameRate(double rate)
</ins><span class="cx"> {
</span><del>-    AVFrameRateRangeType *bestFrameRateRange = nil;
-    for (AVFrameRateRangeType *frameRateRange in [[device() activeFormat] videoSupportedFrameRateRanges]) {
</del><ins>+    AVFrameRateRange *bestFrameRateRange = nil;
+    for (AVFrameRateRange *frameRateRange in [[device() activeFormat] videoSupportedFrameRateRanges]) {
</ins><span class="cx">         if (frameRateRangeIncludesRate({ [frameRateRange minFrameRate], [frameRateRange maxFrameRate] }, rate)) {
</span><span class="cx">             if (!bestFrameRateRange || CMTIME_COMPARE_INLINE([frameRateRange minFrameDuration], >, [bestFrameRateRange minFrameDuration]))
</span><span class="cx">                 bestFrameRateRange = frameRateRange;
</span><span class="lines">@@ -472,7 +426,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     NSError *error = nil;
</span><del>-    RetainPtr<AVCaptureDeviceInputType> videoIn = adoptNS([allocAVCaptureDeviceInputInstance() initWithDevice:device() error:&error]);
</del><ins>+    RetainPtr<AVCaptureDeviceInput> videoIn = adoptNS([PAL::allocAVCaptureDeviceInputInstance() initWithDevice:device() error:&error]);
</ins><span class="cx">     if (error) {
</span><span class="cx">         ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "failed to allocate AVCaptureDeviceInput ", [[error localizedDescription] UTF8String]);
</span><span class="cx">         return false;
</span><span class="lines">@@ -484,7 +438,7 @@
</span><span class="cx">     }
</span><span class="cx">     [session() addInput:videoIn.get()];
</span><span class="cx"> 
</span><del>-    m_videoOutput = adoptNS([allocAVCaptureVideoDataOutputInstance() init]);
</del><ins>+    m_videoOutput = adoptNS([PAL::allocAVCaptureVideoDataOutputInstance() init]);
</ins><span class="cx">     auto settingsDictionary = adoptNS([[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:avVideoCapturePixelBufferFormat()], kCVPixelBufferPixelFormatTypeKey, nil]);
</span><span class="cx"> 
</span><span class="cx">     [m_videoOutput setVideoSettings:settingsDictionary.get()];
</span><span class="lines">@@ -568,7 +522,7 @@
</span><span class="cx">     dispatchMediaSampleToObservers(WTFMove(sample));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection(AVCaptureOutputType*, CMSampleBufferRef sampleBuffer, AVCaptureConnectionType* captureConnection)
</del><ins>+void AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection(AVCaptureOutput*, CMSampleBufferRef sampleBuffer, AVCaptureConnection* captureConnection)
</ins><span class="cx"> {
</span><span class="cx">     if (m_framesToDropAtStartup && m_framesToDropAtStartup--)
</span><span class="cx">         return;
</span><span class="lines">@@ -619,7 +573,7 @@
</span><span class="cx"> void AVVideoCaptureSource::generatePresets()
</span><span class="cx"> {
</span><span class="cx">     Vector<Ref<VideoPreset>> presets;
</span><del>-    for (AVCaptureDeviceFormatType* format in [device() formats]) {
</del><ins>+    for (AVCaptureDeviceFormat* format in [device() formats]) {
</ins><span class="cx"> 
</span><span class="cx">         CMVideoDimensions dimensions = CMVideoFormatDescriptionGetDimensions(format.formatDescription);
</span><span class="cx">         IntSize size = { dimensions.width, dimensions.height };
</span><span class="lines">@@ -630,7 +584,7 @@
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         Vector<FrameRateRange> frameRates;
</span><del>-        for (AVFrameRateRangeType *range in [format videoSupportedFrameRateRanges])
</del><ins>+        for (AVFrameRateRange* range in [format videoSupportedFrameRateRanges])
</ins><span class="cx">             frameRates.append({ range.minFrameRate, range.maxFrameRate});
</span><span class="cx"> 
</span><span class="cx">         presets.append(AVVideoPreset::create(size, WTFMove(frameRates), format));
</span><span class="lines">@@ -712,7 +666,7 @@
</span><span class="cx">     [center addObserver:self selector:@selector(deviceConnectedDidChange:) name:AVCaptureDeviceWasDisconnectedNotification object:nil];
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><del>-    AVCaptureSessionType* session = m_callback->session();
</del><ins>+    AVCaptureSession* session = m_callback->session();
</ins><span class="cx">     [center addObserver:self selector:@selector(sessionRuntimeError:) name:AVCaptureSessionRuntimeErrorNotification object:session];
</span><span class="cx">     [center addObserver:self selector:@selector(beginSessionInterrupted:) name:AVCaptureSessionWasInterruptedNotification object:session];
</span><span class="cx">     [center addObserver:self selector:@selector(endSessionInterrupted:) name:AVCaptureSessionInterruptionEndedNotification object:session];
</span><span class="lines">@@ -724,7 +678,7 @@
</span><span class="cx">     [[NSNotificationCenter defaultCenter] removeObserver:self];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)captureOutput:(AVCaptureOutputType*)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnectionType*)connection
</del><ins>+- (void)captureOutput:(AVCaptureOutput*)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection*)connection
</ins><span class="cx"> {
</span><span class="cx">     if (!m_callback)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm      2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm 2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -46,8 +46,8 @@
</span><span class="cx"> #import <QuartzCore/CATransaction.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx"> 
</span><ins>+#import "CoreVideoSoftLink.h"
</ins><span class="cx"> #import <pal/cf/CoreMediaSoftLink.h>
</span><del>-#import "CoreVideoSoftLink.h"
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> using namespace PAL;
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebKit/ChangeLog       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2019-04-24  Eric Carlson  <eric.carlson@apple.com>
+
+        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
+        https://bugs.webkit.org/show_bug.cgi?id=197171
+        <rdar://problem/47454979>
+
+        Reviewed by Youenn Fablet.
+
+        * Shared/ios/WebIconUtilities.mm:
+        (WebKit::iconForVideoFile):
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
+        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
+        (WebKit::PlatformCALayerRemoteCustom::clone const):
+
</ins><span class="cx"> 2019-04-24  Per Arne Vollan  <pvollan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [macOS] Fix syscall sandbox violation
</span></span></pre></div>
<a id="trunkSourceWebKitSharediosWebIconUtilitiesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -34,14 +34,11 @@
</span><span class="cx"> #import <CoreMedia/CoreMedia.h>
</span><span class="cx"> #import <ImageIO/ImageIO.h>
</span><span class="cx"> #import <MobileCoreServices/MobileCoreServices.h>
</span><del>-#import <pal/cf/CoreMediaSoftLink.h>
</del><span class="cx"> #import <wtf/MathExtras.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation);
-SOFT_LINK_CLASS(AVFoundation, AVAssetImageGenerator);
-SOFT_LINK_CLASS(AVFoundation, AVURLAsset);
</del><ins>+#import <pal/cf/CoreMediaSoftLink.h>
+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="lines">@@ -120,8 +117,8 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_ARG(file, [file isFileURL]);
</span><span class="cx"> 
</span><del>-    RetainPtr<AVURLAsset> asset = adoptNS([allocAVURLAssetInstance() initWithURL:file options:nil]);
-    RetainPtr<AVAssetImageGenerator> generator = adoptNS([allocAVAssetImageGeneratorInstance() initWithAsset:asset.get()]);
</del><ins>+    RetainPtr<AVURLAsset> asset = adoptNS([PAL::allocAVURLAssetInstance() initWithURL:file options:nil]);
+    RetainPtr<AVAssetImageGenerator> generator = adoptNS([PAL::allocAVAssetImageGeneratorInstance() initWithAsset:asset.get()]);
</ins><span class="cx">     [generator setAppliesPreferredTrackTransform:YES];
</span><span class="cx"> 
</span><span class="cx">     NSError *error = nil;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedmacWebCoreArgumentCodersMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm       2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm  2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -44,11 +44,8 @@
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx"> #import <WebCore/MediaPlaybackTargetContext.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><del>-#import <pal/spi/mac/AVFoundationSPI.h>
-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVOutputContext)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="lines">@@ -580,16 +577,16 @@
</span><span class="cx"> 
</span><span class="cx"> void ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData(Encoder& encoder, const WebCore::MediaPlaybackTargetContext& target)
</span><span class="cx"> {
</span><del>-    if ([getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
</del><ins>+    if ([PAL::getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
</ins><span class="cx">         encoder << target.avOutputContext();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData(Decoder& decoder, WebCore::MediaPlaybackTargetContext& target)
</span><span class="cx"> {
</span><del>-    if (![getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
</del><ins>+    if (![PAL::getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    auto context = IPC::decode<AVOutputContext>(decoder, getAVOutputContextClass());
</del><ins>+    auto context = IPC::decode<AVOutputContext>(decoder, PAL::getAVOutputContextClass());
</ins><span class="cx">     if (!context)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaUIDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -60,12 +60,8 @@
</span><span class="cx"> #if HAVE(AUTHORIZATION_STATUS_FOR_MEDIA_TYPE)
</span><span class="cx"> #import <AVFoundation/AVCaptureDevice.h>
</span><span class="cx"> #import <AVFoundation/AVMediaFormat.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation);
-SOFT_LINK_CLASS(AVFoundation, AVCaptureDevice);
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeAudio, NSString *);
-SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeVideo, NSString *);
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -947,7 +943,7 @@
</span><span class="cx">             requestUserMediaAuthorizationForFrame(frame, topLevelOrigin, protectedRequest, (id <WKUIDelegatePrivate>)m_uiDelegate.m_delegate.get(), *webView.get());
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        AVAuthorizationStatus cameraAuthorizationStatus = usingMockCaptureDevices ? AVAuthorizationStatusAuthorized : [getAVCaptureDeviceClass() authorizationStatusForMediaType:getAVMediaTypeVideo()];
</del><ins>+        AVAuthorizationStatus cameraAuthorizationStatus = usingMockCaptureDevices ? AVAuthorizationStatusAuthorized : [PAL::getAVCaptureDeviceClass() authorizationStatusForMediaType:AVMediaTypeVideo];
</ins><span class="cx">         switch (cameraAuthorizationStatus) {
</span><span class="cx">         case AVAuthorizationStatusAuthorized:
</span><span class="cx">             requestUserMediaAuthorizationForFrame(frame, topLevelOrigin, protectedRequest, (id <WKUIDelegatePrivate>)m_uiDelegate.m_delegate.get(), *webView.get());
</span><span class="lines">@@ -965,13 +961,13 @@
</span><span class="cx">                 requestUserMediaAuthorizationForFrame(frame, topLevelOrigin, protectedRequest, (id <WKUIDelegatePrivate>)m_uiDelegate.m_delegate.get(), *webView.get());
</span><span class="cx">             });
</span><span class="cx"> 
</span><del>-            [getAVCaptureDeviceClass() requestAccessForMediaType:getAVMediaTypeVideo() completionHandler:decisionHandler.get()];
</del><ins>+            [PAL::getAVCaptureDeviceClass() requestAccessForMediaType:AVMediaTypeVideo completionHandler:decisionHandler.get()];
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     if (requiresAudioCapture) {
</span><del>-        AVAuthorizationStatus microphoneAuthorizationStatus = usingMockCaptureDevices ? AVAuthorizationStatusAuthorized : [getAVCaptureDeviceClass() authorizationStatusForMediaType:getAVMediaTypeAudio()];
</del><ins>+        AVAuthorizationStatus microphoneAuthorizationStatus = usingMockCaptureDevices ? AVAuthorizationStatusAuthorized : [PAL::getAVCaptureDeviceClass() authorizationStatusForMediaType:AVMediaTypeAudio];
</ins><span class="cx">         switch (microphoneAuthorizationStatus) {
</span><span class="cx">         case AVAuthorizationStatusAuthorized:
</span><span class="cx">             requestCameraAuthorization();
</span><span class="lines">@@ -989,7 +985,7 @@
</span><span class="cx">                 requestCameraAuthorization();
</span><span class="cx">             });
</span><span class="cx"> 
</span><del>-            [getAVCaptureDeviceClass() requestAccessForMediaType:getAVMediaTypeAudio() completionHandler:decisionHandler.get()];
</del><ins>+            [PAL::getAVCaptureDeviceClass() requestAccessForMediaType:AVMediaTypeAudio completionHandler:decisionHandler.get()];
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">     } else
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageRemoteLayerTreePlatformCALayerRemoteCustommm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -35,10 +35,8 @@
</span><span class="cx"> #import <WebCore/PlatformCALayerCocoa.h>
</span><span class="cx"> #import <WebCore/WebCoreCALayerExtras.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVPlayerLayer)
</del><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -105,8 +103,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (layerType() == LayerTypeAVPlayerLayer) {
</span><span class="cx">         
</span><del>-        if ([platformLayer() isKindOfClass:getAVPlayerLayerClass()]) {
-            clonedLayer = adoptNS([allocAVPlayerLayerInstance() init]);
</del><ins>+        if ([platformLayer() isKindOfClass:PAL::getAVPlayerLayerClass()]) {
+            clonedLayer = adoptNS([PAL::allocAVPlayerLayerInstance() init]);
</ins><span class="cx"> 
</span><span class="cx">             AVPlayerLayer *destinationPlayerLayer = static_cast<AVPlayerLayer *>(clonedLayer.get());
</span><span class="cx">             AVPlayerLayer *sourcePlayerLayer = static_cast<AVPlayerLayer *>(platformLayer());
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-04-24  Eric Carlson  <eric.carlson@apple.com>
+
+        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
+        https://bugs.webkit.org/show_bug.cgi?id=197171
+        <rdar://problem/47454979>
+
+        Reviewed by Youenn Fablet.
+
+        * WebView/WebVideoFullscreenController.mm:
+        (-[WebVideoFullscreenController setVideoElement:]):
+        (-[WebVideoFullscreenController windowDidExitFullscreen]):
+        (SOFT_LINK_CLASS): Deleted.
+
</ins><span class="cx"> 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make it possible to control the renderTreeAsText output by setting options on testRunner
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebViewWebVideoFullscreenControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenController.mm (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenController.mm    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenController.mm       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -36,13 +36,11 @@
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx"> #import <pal/system/SleepDisabler.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><del>-#import <wtf/SoftLinking.h>
</del><span class="cx"> 
</span><ins>+#import <pal/cocoa/AVFoundationSoftLink.h>
+
</ins><span class="cx"> ALLOW_DEPRECATED_DECLARATIONS_BEGIN
</span><span class="cx"> 
</span><del>-SOFT_LINK_FRAMEWORK(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
-
</del><span class="cx"> @interface WebVideoFullscreenWindow : NSWindow<NSAnimationDelegate> {
</span><span class="cx">     SEL _controllerActionOnAnimationEnd;
</span><span class="cx">     WebWindowScaleAnimation *_fullscreenAnimation; // (retain)
</span><span class="lines">@@ -118,7 +116,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto contentView = [[self fullscreenWindow] contentView];
</span><span class="cx"> 
</span><del>-    auto layer = adoptNS([allocAVPlayerLayerInstance() init]);
</del><ins>+    auto layer = adoptNS([PAL::allocAVPlayerLayerInstance() init]);
</ins><span class="cx">     [layer setPlayer:player];
</span><span class="cx"> 
</span><span class="cx">     [contentView setLayer:layer.get()];
</span><span class="lines">@@ -147,7 +145,7 @@
</span><span class="cx"> - (void)windowDidExitFullscreen
</span><span class="cx"> {
</span><span class="cx">     CALayer *layer = [[[self window] contentView] layer];
</span><del>-    if ([layer isKindOfClass:getAVPlayerLayerClass()])
</del><ins>+    if ([layer isKindOfClass:PAL::getAVPlayerLayerClass()])
</ins><span class="cx">         [[(AVPlayerLayer *)layer player] removeObserver:self forKeyPath:@"rate"];
</span><span class="cx"> 
</span><span class="cx">     [self clearFadeAnimation];
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Tools/ChangeLog       2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-04-24  Eric Carlson  <eric.carlson@apple.com>
+
+        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
+        https://bugs.webkit.org/show_bug.cgi?id=197171
+        <rdar://problem/47454979>
+
+        Reviewed by Youenn Fablet.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm: Added.
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2019-04-24  Brady Eidson  <beidson@apple.com>
</span><span class="cx"> 
</span><span class="cx">         XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (244626 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2019-04-24 23:23:03 UTC (rev 244626)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXBuildFile section */
</span><span class="cx">          041A1E34216FFDBC00789E0A /* PublicSuffix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 041A1E33216FFDBC00789E0A /* PublicSuffix.cpp */; };
</span><ins>+               0711DF52226A95FC003DD2F7 /* AVFoundationSoftLinkTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0711DF51226A95FB003DD2F7 /* AVFoundationSoftLinkTest.mm */; };
</ins><span class="cx">           07492B3B1DF8B14C00633DE1 /* EnumerateMediaDevices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07492B3A1DF8AE2D00633DE1 /* EnumerateMediaDevices.cpp */; };
</span><span class="cx">          07492B3C1DF8B86600633DE1 /* enumerateMediaDevices.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */; };
</span><span class="cx">          074994421EA5034B000DA44E /* getUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4A410F4D19AF7BEF002EBAB5 /* getUserMedia.html */; };
</span><span class="lines">@@ -1338,6 +1339,7 @@
</span><span class="cx"> /* Begin PBXFileReference section */
</span><span class="cx">          00CD9F6215BE312C002DA2CE /* BackForwardList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackForwardList.mm; sourceTree = "<group>"; };
</span><span class="cx">          041A1E33216FFDBC00789E0A /* PublicSuffix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PublicSuffix.cpp; sourceTree = "<group>"; };
</span><ins>+               0711DF51226A95FB003DD2F7 /* AVFoundationSoftLinkTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVFoundationSoftLinkTest.mm; sourceTree = "<group>"; };
</ins><span class="cx">           07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = enumerateMediaDevices.html; sourceTree = "<group>"; };
</span><span class="cx">          07492B3A1DF8AE2D00633DE1 /* EnumerateMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnumerateMediaDevices.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0766DD1F1A5AD5200023E3BB /* PendingAPIRequestURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PendingAPIRequestURL.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -3687,6 +3689,7 @@
</span><span class="cx">          CD89D0371C4EDB1300040A04 /* cocoa */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               0711DF51226A95FB003DD2F7 /* AVFoundationSoftLinkTest.mm */,
</ins><span class="cx">                           751B05D51F8EAC1A0028A09E /* DatabaseTrackerTest.mm */,
</span><span class="cx">                          5769C50A1D9B0001000847FB /* SerializedCryptoKeyWrap.mm */,
</span><span class="cx">                          A17991861E1C994E00A505ED /* SharedBuffer.mm */,
</span><span class="lines">@@ -4028,6 +4031,7 @@
</span><span class="cx">                          CDC8E48D1BC5CB4500594FEC /* AudioSessionCategoryIOS.mm in Sources */,
</span><span class="cx">                          7C83E0B91D0A64F100FEBCF3 /* AutoLayoutIntegration.mm in Sources */,
</span><span class="cx">                          07CD32F62065B5430064A4BE /* AVFoundationPreference.mm in Sources */,
</span><ins>+                               0711DF52226A95FC003DD2F7 /* AVFoundationSoftLinkTest.mm in Sources */,
</ins><span class="cx">                           7CCE7EB51A411A7E00447C4C /* BackForwardList.mm in Sources */,
</span><span class="cx">                          1C7FEB20207C0F2E00D23278 /* BackgroundColor.mm in Sources */,
</span><span class="cx">                          374B7A601DF36EEE00ACCB6C /* BundleEditingDelegate.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCorecocoaAVFoundationSoftLinkTestmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm (0 => 244627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm   2019-04-24 23:56:07 UTC (rev 244627)
</span><span class="lines">@@ -0,0 +1,194 @@
</span><ins>+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if PLATFORM(COCOA)
+
+#import <pal/cocoa/AVFoundationSoftLink.h>
+
+namespace TestWebKitAPI {
+
+TEST(AVFoundationSoftLink, Classes)
+{
+    EXPECT_NE(PAL::getAVPlayerClass(), nullptr);
+    EXPECT_NE(PAL::getAVPlayerItemClass(), nullptr);
+    EXPECT_NE(PAL::getAVPlayerItemVideoOutputClass(), nullptr);
+    EXPECT_NE(PAL::getAVPlayerLayerClass(), nullptr);
+    EXPECT_NE(PAL::getAVURLAssetClass(), nullptr);
+    EXPECT_NE(PAL::getAVAssetImageGeneratorClass(), nullptr);
+    EXPECT_NE(PAL::getAVMetadataItemClass(), nullptr);
+    EXPECT_NE(PAL::getAVAssetCacheClass(), nullptr);
+    EXPECT_NE(PAL::getAVPlayerItemLegibleOutputClass(), nullptr);
+    EXPECT_NE(PAL::getAVMediaSelectionGroupClass(), nullptr);
+    EXPECT_NE(PAL::getAVMediaSelectionOptionClass(), nullptr);
+    EXPECT_NE(PAL::getAVOutputContextClass(), nullptr);
+    EXPECT_NE(PAL::getAVAssetReaderClass(), nullptr);
+    EXPECT_NE(PAL::getAVAssetWriterClass(), nullptr);
+    EXPECT_NE(PAL::getAVAssetWriterInputClass(), nullptr);
+    EXPECT_NE(PAL::getAVCaptureSessionClass(), nullptr);
+    EXPECT_NE(PAL::getAVCaptureConnectionClass(), nullptr);
+    EXPECT_NE(PAL::getAVCaptureDeviceClass(), nullptr);
+    EXPECT_NE(PAL::getAVCaptureDeviceFormatClass(), nullptr);
+    EXPECT_NE(PAL::getAVCaptureDeviceInputClass(), nullptr);
+    EXPECT_NE(PAL::getAVCaptureOutputClass(), nullptr);
+    EXPECT_NE(PAL::getAVCaptureVideoDataOutputClass(), nullptr);
+    EXPECT_NE(PAL::getAVFrameRateRangeClass(), nullptr);
+    EXPECT_NE(PAL::getAVMutableAudioMixClass(), nullptr);
+    EXPECT_NE(PAL::getAVMutableAudioMixInputParametersClass(), nullptr);
+
+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA)
+    EXPECT_NE(PAL::getAVStreamSessionClass(), nullptr);
+    EXPECT_NE(PAL::getAVStreamDataParserClass(), nullptr);
+#endif
+
+#if PLATFORM(IOS_FAMILY)
+    EXPECT_NE(PAL::getAVPersistableContentKeyRequestClass(), nullptr);
+    EXPECT_NE(PAL::getAVAudioSessionClass(), nullptr);
+    EXPECT_NE(PAL::getAVSpeechSynthesizerClass(), nullptr);
+    EXPECT_NE(PAL::getAVSpeechUtteranceClass(), nullptr);
+    EXPECT_NE(PAL::getAVSpeechSynthesisVoiceClass(), nullptr);
+#endif
+
+#if HAVE(MEDIA_PLAYER) && !PLATFORM(WATCHOS)
+    EXPECT_NE(PAL::getAVRouteDetectorClass(), nullptr);
+#endif
+
+    EXPECT_NE(PAL::getAVContentKeyResponseClass(), nullptr);
+    EXPECT_NE(PAL::getAVContentKeySessionClass(), nullptr);
+    EXPECT_NE(PAL::getAVAssetResourceLoadingRequestClass(), nullptr);
+    EXPECT_NE(PAL::getAVAssetReaderSampleReferenceOutputClass(), nullptr);
+    EXPECT_NE(PAL::getAVVideoPerformanceMetricsClass(), nullptr);
+    EXPECT_NE(PAL::getAVSampleBufferAudioRendererClass(), nullptr);
+    EXPECT_NE(PAL::getAVSampleBufferDisplayLayerClass(), nullptr);
+    EXPECT_NE(PAL::getAVSampleBufferRenderSynchronizerClass(), nullptr);
+}
+
+
+TEST(AVFoundationSoftLink, Constants)
+{
+    EXPECT_TRUE([AVAudioTimePitchAlgorithmSpectral isEqualToString:@"Spectral"]);
+    EXPECT_TRUE([AVAudioTimePitchAlgorithmVarispeed isEqualToString:@"Varispeed"]);
+    EXPECT_TRUE([AVMediaTypeClosedCaption isEqualToString:@"clcp"]);
+    EXPECT_TRUE([AVMediaTypeVideo isEqualToString:@"vide"]);
+    EXPECT_TRUE([AVMediaTypeAudio isEqualToString:@"soun"]);
+    EXPECT_TRUE([AVMediaTypeMuxed isEqualToString:@"muxx"]);
+    EXPECT_TRUE([AVMediaTypeMetadata isEqualToString:@"meta"]);
+    EXPECT_TRUE([AVAssetImageGeneratorApertureModeCleanAperture isEqualToString:@"CleanAperture"]);
+    EXPECT_TRUE([AVStreamingKeyDeliveryContentKeyType isEqualToString:@"com.apple.streamingkeydelivery.contentkey"]);
+    EXPECT_TRUE([AVMediaCharacteristicContainsOnlyForcedSubtitles isEqualToString:@"public.subtitles.forced-only"]);
+    EXPECT_TRUE([AVMetadataCommonKeyTitle isEqualToString:@"title"]);
+    EXPECT_TRUE([AVMetadataKeySpaceCommon isEqualToString:@"comn"]);
+    EXPECT_TRUE([AVMediaTypeSubtitle isEqualToString:@"sbtl"]);
+    EXPECT_TRUE([AVMediaCharacteristicIsMainProgramContent isEqualToString:@"public.main-program-content"]);
+    EXPECT_TRUE([AVMediaCharacteristicEasyToRead isEqualToString:@"public.easy-to-read"]);
+    EXPECT_TRUE([AVFileTypeMPEG4 isEqualToString:@"public.mpeg-4"]);
+    EXPECT_TRUE([AVVideoCodecH264 isEqualToString:@"avc1"]);
+    EXPECT_TRUE([AVVideoExpectedSourceFrameRateKey isEqualToString:@"ExpectedFrameRate"]);
+    EXPECT_TRUE([AVVideoProfileLevelKey isEqualToString:@"ProfileLevel"]);
+    EXPECT_TRUE([AVVideoAverageBitRateKey isEqualToString:@"AverageBitRate"]);
+    EXPECT_TRUE([AVVideoMaxKeyFrameIntervalKey isEqualToString:@"MaxKeyFrameInterval"]);
+    EXPECT_TRUE([AVVideoProfileLevelH264MainAutoLevel isEqualToString:@"H264_Main_AutoLevel"]);
+    EXPECT_TRUE([AVOutOfBandAlternateTrackDisplayNameKey isEqualToString:@"MediaSelectionOptionsName"]);
+    EXPECT_TRUE([AVOutOfBandAlternateTrackExtendedLanguageTagKey isEqualToString:@"MediaSelectionOptionsExtendedLanguageTag"]);
+    EXPECT_TRUE([AVOutOfBandAlternateTrackIsDefaultKey isEqualToString:@"MediaSelectionOptionsIsDefault"]);
+    EXPECT_TRUE([AVOutOfBandAlternateTrackMediaCharactersticsKey isEqualToString:@"MediaSelectionOptionsTaggedMediaCharacteristics"]);
+    EXPECT_TRUE([AVOutOfBandAlternateTrackIdentifierKey isEqualToString:@"MediaSelectionOptionsClientIdentifier"]);
+    EXPECT_TRUE([AVOutOfBandAlternateTrackSourceKey isEqualToString:@"MediaSelectionOptionsURL"]);
+    EXPECT_TRUE([AVMediaCharacteristicDescribesMusicAndSoundForAccessibility isEqualToString:@"public.accessibility.describes-music-and-sound"]);
+    EXPECT_TRUE([AVMediaCharacteristicTranscribesSpokenDialogForAccessibility isEqualToString:@"public.accessibility.transcribes-spoken-dialog"]);
+    EXPECT_TRUE([AVMediaCharacteristicIsAuxiliaryContent isEqualToString:@"public.auxiliary-content"]);
+    EXPECT_TRUE([AVMediaCharacteristicDescribesVideoForAccessibility isEqualToString:@"public.accessibility.describes-video"]);
+    EXPECT_TRUE([AVMetadataKeySpaceQuickTimeUserData isEqualToString:@"udta"]);
+    EXPECT_TRUE([AVMetadataKeySpaceQuickTimeMetadata isEqualToString:@"mdta"]);
+    EXPECT_TRUE([AVMetadataKeySpaceiTunes isEqualToString:@"itsk"]);
+    EXPECT_TRUE([AVMetadataKeySpaceID3 isEqualToString:@"org.id3"]);
+    EXPECT_TRUE([AVMetadataKeySpaceISOUserData isEqualToString:@"uiso"]);
+
+    if (PAL::canLoad_AVFoundation_AVEncoderBitRateKey())
+        EXPECT_TRUE([AVEncoderBitRateKey isEqualToString:@"AVEncoderBitRateKey"]);
+    if (PAL::canLoad_AVFoundation_AVFormatIDKey())
+        EXPECT_TRUE([AVFormatIDKey isEqualToString:@"AVFormatIDKey"]);
+    if (PAL::canLoad_AVFoundation_AVNumberOfChannelsKey())
+        EXPECT_TRUE([AVNumberOfChannelsKey isEqualToString:@"AVNumberOfChannelsKey"]);
+    if (PAL::canLoad_AVFoundation_AVSampleRateKey())
+        EXPECT_TRUE([AVSampleRateKey isEqualToString:@"AVSampleRateKey"]);
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 40000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 110000)
+    EXPECT_TRUE(PAL::canLoad_AVFoundation_AVURLAssetOutOfBandMIMETypeKey());
+    EXPECT_TRUE([AVURLAssetOutOfBandMIMETypeKey isEqualToString:@"AVURLAssetOutOfBandMIMETypeKey"]);
+#endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 50000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 120000)
+    EXPECT_TRUE(PAL::canLoad_AVFoundation_AVURLAssetUseClientURLLoadingExclusively());
+    EXPECT_TRUE([AVURLAssetUseClientURLLoadingExclusively isEqualToString:@"AVURLAssetUseClientURLLoadingExclusively"]);
+#endif
+
+#if ENABLE(ENCRYPTED_MEDIA) && HAVE(AVCONTENTKEYSESSION)
+    EXPECT_TRUE(PAL::canLoad_AVFoundation_AVContentKeySystemFairPlayStreaming());
+    EXPECT_TRUE([AVContentKeySystemFairPlayStreaming isEqualToString:@"FairPlayStreaming"]);
+#endif
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA) && ENABLE(MEDIA_SOURCE)
+    EXPECT_TRUE(PAL::canLoad_AVFoundation_AVContentKeyRequestProtocolVersionsKey());
+    EXPECT_TRUE([AVContentKeyRequestProtocolVersionsKey isEqualToString:@"ProtocolVersionsKey"]);
+#endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000)
+    EXPECT_TRUE(PAL::canLoad_AVFoundation_AVVideoCodecTypeHEVCWithAlpha());
+    EXPECT_TRUE([AVVideoCodecTypeHEVCWithAlpha isEqualToString:@"muxa"]);
+#endif
+
+#if PLATFORM(MAC)
+    EXPECT_TRUE([AVStreamDataParserContentKeyRequestProtocolVersionsKey isEqualToString:@"AVContentKeyRequestProtocolVersionsKey"]);
+#endif
+
+#if PLATFORM(IOS_FAMILY)
+    EXPECT_TRUE([AVURLAssetBoundNetworkInterfaceName isEqualToString:@"AVURLAssetBoundNetworkInterfaceName"]);
+    EXPECT_TRUE([AVURLAssetClientBundleIdentifierKey isEqualToString:@"AVURLAssetClientBundleIdentifierKey"]);
+    EXPECT_TRUE([AVCaptureSessionRuntimeErrorNotification isEqualToString:@"AVCaptureSessionRuntimeErrorNotification"]);
+    EXPECT_TRUE([AVCaptureSessionWasInterruptedNotification isEqualToString:@"AVCaptureSessionWasInterruptedNotification"]);
+    EXPECT_TRUE([AVCaptureSessionInterruptionEndedNotification isEqualToString:@"AVCaptureSessionInterruptionEndedNotification"]);
+    EXPECT_TRUE([AVCaptureSessionInterruptionReasonKey isEqualToString:@"AVCaptureSessionInterruptionReasonKey"]);
+    EXPECT_TRUE([AVCaptureSessionErrorKey isEqualToString:@"AVCaptureSessionErrorKey"]);
+    EXPECT_TRUE([AVAudioSessionCategoryAmbient isEqualToString:@"AVAudioSessionCategoryAmbient"]);
+    EXPECT_TRUE([AVAudioSessionCategorySoloAmbient isEqualToString:@"AVAudioSessionCategorySoloAmbient"]);
+    EXPECT_TRUE([AVAudioSessionCategoryPlayback isEqualToString:@"AVAudioSessionCategoryPlayback"]);
+    EXPECT_TRUE([AVAudioSessionCategoryRecord isEqualToString:@"AVAudioSessionCategoryRecord"]);
+    EXPECT_TRUE([AVAudioSessionCategoryPlayAndRecord isEqualToString:@"AVAudioSessionCategoryPlayAndRecord"]);
+    EXPECT_TRUE([AVAudioSessionCategoryAudioProcessing isEqualToString:@"AVAudioSessionCategoryAudioProcessing"]);
+    EXPECT_TRUE([AVAudioSessionModeDefault isEqualToString:@"AVAudioSessionModeDefault"]);
+    EXPECT_TRUE([AVAudioSessionModeVideoChat isEqualToString:@"AVAudioSessionModeVideoChat"]);
+    EXPECT_TRUE([AVAudioSessionInterruptionNotification isEqualToString:@"AVAudioSessionInterruptionNotification"]);
+    EXPECT_TRUE([AVAudioSessionInterruptionTypeKey isEqualToString:@"AVAudioSessionInterruptionTypeKey"]);
+    EXPECT_TRUE([AVAudioSessionInterruptionOptionKey isEqualToString:@"AVAudioSessionInterruptionOptionKey"]);
+    EXPECT_TRUE([AVRouteDetectorMultipleRoutesDetectedDidChangeNotification isEqualToString:@"AVRouteDetectorMultipleRoutesDetectedDidChangeNotification"]);
+#endif
+}
+
+#endif // PLATFORM(COCOA)
+
+} // namespace TestWebKitAPI
+
</ins></span></pre>
</div>
</div>

</body>
</html>