Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION (274873@main): Audio is not anchored to WKWebView's spatia…
…l location https://bugs.webkit.org/show_bug.cgi?id=270919 rdar://123800596 Reviewed by Jer Noble. In 274873@main we added the infrastructure for passing a spatial tracking label from the UI process to the GPU process. Because a null WTF::String is implicitly converted to @"", this change had the unintended side effect of setting AVSampleBufferVidoRenderer and AVPlayer's spatial tracking label to the empty string rather than the default value of nil, breaking spatial tracking for the audio emitted from WKWebView. Resolved this by introducing nsStringNilIfNull -- returning nil if the WTF::String is null otherwise converting it as-is to NSString -- and using it to set spatial tracking labels in MediaPlayerPrivate. * Source/WTF/wtf/text/WTFString.h: (WTF::nsStringNilIfNull): * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setSpatialTrackingLabel): * Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateSpatialTrackingLabel): Canonical link: https://commits.webkit.org/276074@main
- Loading branch information