Title: [277365] trunk/Source/WebCore
Revision
277365
Author
[email protected]
Date
2021-05-12 05:47:55 -0700 (Wed, 12 May 2021)

Log Message

Adopt CoreMedia SPI to identify audio-only playback for MSE clients
https://bugs.webkit.org/show_bug.cgi?id=225647
rdar://76138365

Reviewed by Youenn Fablet.

Source/WebCore:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
  tells whether the AVSBAR is attached to an <audio> or <video> element.

Source/WebCore/PAL:

* pal/spi/cocoa/AVFoundationSPI.h: Add forward declaration for new methods
  while this isn't in SDK yet.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (277364 => 277365)


--- trunk/Source/WebCore/ChangeLog	2021-05-12 08:57:38 UTC (rev 277364)
+++ trunk/Source/WebCore/ChangeLog	2021-05-12 12:47:55 UTC (rev 277365)
@@ -1,3 +1,14 @@
+2021-05-12  Jean-Yves Avenard  <[email protected]>
+
+        Adopt CoreMedia SPI to identify audio-only playback for MSE clients
+        https://bugs.webkit.org/show_bug.cgi?id=225647
+        rdar://76138365
+
+        Reviewed by Youenn Fablet.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+          tells whether the AVSBAR is attached to an <audio> or <video> element.
+
 2021-05-12  Youenn Fablet  <[email protected]>
 
         Introduce an internal unit to render audio MediaStreamTrack(s)

Modified: trunk/Source/WebCore/PAL/ChangeLog (277364 => 277365)


--- trunk/Source/WebCore/PAL/ChangeLog	2021-05-12 08:57:38 UTC (rev 277364)
+++ trunk/Source/WebCore/PAL/ChangeLog	2021-05-12 12:47:55 UTC (rev 277365)
@@ -1,3 +1,14 @@
+2021-05-12  Jean-Yves Avenard  <[email protected]>
+
+        Adopt CoreMedia SPI to identify audio-only playback for MSE clients
+        https://bugs.webkit.org/show_bug.cgi?id=225647
+        rdar://76138365
+
+        Reviewed by Youenn Fablet.
+
+        * pal/spi/cocoa/AVFoundationSPI.h: Add forward declaration for new methods
+          while this isn't in SDK yet.
+
 2021-05-11  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r277322.

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h (277364 => 277365)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2021-05-12 08:57:38 UTC (rev 277364)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2021-05-12 12:47:55 UTC (rev 277365)
@@ -338,6 +338,11 @@
 
 #if __has_include(<AVFoundation/AVSampleBufferAudioRenderer.h>)
 #import <AVFoundation/AVSampleBufferAudioRenderer.h>
+NS_ASSUME_NONNULL_BEGIN
+@interface AVSampleBufferAudioRenderer (AVSampleBufferAudioRendererWebKitOnly)
+- (void)setIsUnaccompaniedByVisuals:(BOOL)audioOnly SPI_AVAILABLE(macos(12.0)) API_UNAVAILABLE(ios, tvos, watchos);
+@end
+NS_ASSUME_NONNULL_END
 #else
 
 NS_ASSUME_NONNULL_BEGIN
@@ -352,6 +357,7 @@
 - (void)stopRequestingMediaData;
 - (void)setVolume:(float)volume;
 - (void)setMuted:(BOOL)muted;
+- (void)setIsUnaccompaniedByVisuals:(BOOL)audioOnly SPI_AVAILABLE(macos(12.0)) API_UNAVAILABLE(ios, tvos, watchos);
 @property (nonatomic, copy) NSString *audioTimePitchAlgorithm;
 @end
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (277364 => 277365)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2021-05-12 08:57:38 UTC (rev 277364)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2021-05-12 12:47:55 UTC (rev 277365)
@@ -1169,6 +1169,12 @@
     [audioRenderer setMuted:m_player->muted()];
     [audioRenderer setVolume:m_player->volume()];
     [audioRenderer setAudioTimePitchAlgorithm:(m_player->preservesPitch() ? AVAudioTimePitchAlgorithmSpectral : AVAudioTimePitchAlgorithmVarispeed)];
+#if PLATFORM(MAC)
+    ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
+    if ([audioRenderer respondsToSelector:@selector(setIsUnaccompaniedByVisuals:)])
+        [audioRenderer setIsUnaccompaniedByVisuals:!m_player->isVideoPlayer()];
+    ALLOW_NEW_API_WITHOUT_GUARDS_END
+#endif
 
 #if HAVE(AUDIO_OUTPUT_DEVICE_UNIQUE_ID)
     auto deviceId = m_player->audioOutputDeviceIdOverride();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to