Title: [273730] trunk
Revision
273730
Author
[email protected]
Date
2021-03-02 07:37:23 -0800 (Tue, 02 Mar 2021)

Log Message

Enable MEDIA_SOURCE in IOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=222041
Source/WebCore:

<rdar://problem/74433510>

Reviewed by Eric Carlson.

MediaSource IDLs were protected by MEDIA_SOURCE but not by MediaSource runtime flag.
Update IDLs accordingly.

Covered by existing tests.

* Modules/mediasource/AudioTrack+MediaSource.idl:
* Modules/mediasource/DOMURL+MediaSource.idl:
* Modules/mediasource/SourceBuffer.idl:
* Modules/mediasource/SourceBufferList.idl:
* Modules/mediasource/TextTrack+MediaSource.idl:
* Modules/mediasource/VideoTrack+MediaSource.idl:
* bindings/js/WebCoreBuiltinNames.h:
* html/HTMLMediaElement.idl:
Minor change to kick in binding generator.
* html/track/AudioTrack.idl:
* html/track/TextTrack.idl:
* html/track/VideoTrack.idl:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::mediaEngine):
If AVStreamDataParser is not available, MSE backend will not be available.
Update assertion accordingly.

Source/WebCore/PAL:

Reviewed by Eric Carlson.

Add missing header declarations in AVStreamDataParserSPI.h and use it for simulator.

* PAL.xcodeproj/project.pbxproj:
* pal/spi/cocoa/AVFoundationSPI.h:
* pal/spi/cocoa/AVStreamDataParserSPI.h: Added.

Source/WTF:

Reviewed by Eric Carlson.

* Scripts/Preferences/WebPreferences.yaml:
Move this settings out of ENABLE(MEDIA_SOURCE) to allow existing binding code to compile.
* wtf/PlatformEnableCocoa.h:

Tools:

<rdar://problem/74433510>

Reviewed by Eric Carlson.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetPreferencesToConsistentValues):
Disable MediaSource runtime flag on simulator since it lacks implementation of AVStreamDataParser.

LayoutTests:

Reviewed by Eric Carlson.

* fast/mediastream/MediaStream-video-element.html:
Update to sort properties lexicographically.
* fast/mediastream/MediaStream-video-element-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (273729 => 273730)


--- trunk/LayoutTests/ChangeLog	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/LayoutTests/ChangeLog	2021-03-02 15:37:23 UTC (rev 273730)
@@ -1,3 +1,14 @@
+2021-03-02  Youenn Fablet  <[email protected]>
+
+        Enable MEDIA_SOURCE in IOS Simulator
+        https://bugs.webkit.org/show_bug.cgi?id=222041
+
+        Reviewed by Eric Carlson.
+
+        * fast/mediastream/MediaStream-video-element.html:
+        Update to sort properties lexicographically.
+        * fast/mediastream/MediaStream-video-element-expected.txt:
+
 2021-03-02  Rob Buis  <[email protected]>
 
         Null check platformData when decoding

Modified: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt (273729 => 273730)


--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt	2021-03-02 15:37:23 UTC (rev 273730)
@@ -31,11 +31,11 @@
 PASS video.videoTracks[0].kind is "main"
 
 video.videoTracks[0] properties:
-  track.id = <UUID>
-  track.kind = main
-  track.label = Mock video device 1
-  track.language =
-  track.selected = true
+  id = <UUID>
+  kind = main
+  label = Mock video device 1
+  language =
+  selected = true
 
 **** check audio tracks ****
 PASS video.audioTracks.length is 1
@@ -44,11 +44,11 @@
 PASS video.audioTracks[0].kind is "main"
 
 video.audioTracks[0] properties:
-  track.id = <UUID>
-  track.kind = main
-  track.label = Mock audio device 1
-  track.language =
-  track.enabled = true
+  enabled = true
+  id = <UUID>
+  kind = main
+  label = Mock audio device 1
+  language =
 
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/fast/mediastream/MediaStream-video-element.html (273729 => 273730)


--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element.html	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element.html	2021-03-02 15:37:23 UTC (rev 273730)
@@ -44,13 +44,16 @@
 
             function checkElementTrack(track)
             {
+                let properties = [];
                 enumerateProperties(track, function(property, value) {
                      if (property == "sourceBuffer")
                         return;
                      if (property == "id")
                         value = "&lt;UUID>";
-                    debug(`  track.${property} = ${value}`);
+                     properties.push({property:property, value:value});
                 });
+                properties.sort((a, b) => { return a.property.localeCompare(b.property); });
+                properties.forEach(item => debug(`  ${item.property} = ${item.value}`));
             }
 
             function checkVideoElement()

Modified: trunk/Source/WTF/ChangeLog (273729 => 273730)


--- trunk/Source/WTF/ChangeLog	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WTF/ChangeLog	2021-03-02 15:37:23 UTC (rev 273730)
@@ -1,3 +1,14 @@
+2021-03-02  Youenn Fablet  <[email protected]>
+
+        Enable MEDIA_SOURCE in IOS Simulator
+        https://bugs.webkit.org/show_bug.cgi?id=222041
+
+        Reviewed by Eric Carlson.
+
+        * Scripts/Preferences/WebPreferences.yaml:
+        Move this settings out of ENABLE(MEDIA_SOURCE) to allow existing binding code to compile.
+        * wtf/PlatformEnableCocoa.h:
+
 2021-03-01  Truitt Savell  <[email protected]>
 
         Unreviewed, reverting r273655.

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (273729 => 273730)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2021-03-02 15:37:23 UTC (rev 273730)
@@ -1422,7 +1422,6 @@
 
 MediaSourceEnabled:
   type: bool
-  condition: ENABLE(MEDIA_SOURCE)
   defaultValue:
     WebKitLegacy:
       default: true

Modified: trunk/Source/WTF/wtf/PlatformEnableCocoa.h (273729 => 273730)


--- trunk/Source/WTF/wtf/PlatformEnableCocoa.h	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WTF/wtf/PlatformEnableCocoa.h	2021-03-02 15:37:23 UTC (rev 273730)
@@ -328,7 +328,7 @@
 #define ENABLE_MEDIA_SESSION 1
 #endif
 
-#if !defined(ENABLE_MEDIA_SOURCE) && !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) && !PLATFORM(IOS_FAMILY_SIMULATOR)
+#if !defined(ENABLE_MEDIA_SOURCE) && !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 #define ENABLE_MEDIA_SOURCE 1
 #endif
 

Modified: trunk/Source/WebCore/ChangeLog (273729 => 273730)


--- trunk/Source/WebCore/ChangeLog	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/ChangeLog	2021-03-02 15:37:23 UTC (rev 273730)
@@ -1,3 +1,33 @@
+2021-03-02  Youenn Fablet  <[email protected]>
+
+        Enable MEDIA_SOURCE in IOS Simulator
+        https://bugs.webkit.org/show_bug.cgi?id=222041
+        <rdar://problem/74433510>
+
+        Reviewed by Eric Carlson.
+
+        MediaSource IDLs were protected by MEDIA_SOURCE but not by MediaSource runtime flag.
+        Update IDLs accordingly.
+
+        Covered by existing tests.
+
+        * Modules/mediasource/AudioTrack+MediaSource.idl:
+        * Modules/mediasource/DOMURL+MediaSource.idl:
+        * Modules/mediasource/SourceBuffer.idl:
+        * Modules/mediasource/SourceBufferList.idl:
+        * Modules/mediasource/TextTrack+MediaSource.idl:
+        * Modules/mediasource/VideoTrack+MediaSource.idl:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * html/HTMLMediaElement.idl:
+        Minor change to kick in binding generator.
+        * html/track/AudioTrack.idl:
+        * html/track/TextTrack.idl:
+        * html/track/VideoTrack.idl:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::mediaEngine):
+        If AVStreamDataParser is not available, MSE backend will not be available.
+        Update assertion accordingly.
+
 2021-03-02  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Merge SimplifiedVerticalAlignment and m_useSimplifiedVerticalAlignment

Modified: trunk/Source/WebCore/Modules/mediasource/AudioTrack+MediaSource.idl (273729 => 273730)


--- trunk/Source/WebCore/Modules/mediasource/AudioTrack+MediaSource.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/Modules/mediasource/AudioTrack+MediaSource.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -26,6 +26,7 @@
 // https://w3c.github.io/media-source/#audio-track-extensions
 [
     Conditional=MEDIA_SOURCE,
+    EnabledBySetting=MediaSource,
     ImplementedBy=AudioTrackMediaSource
 ] partial interface AudioTrack {
     readonly attribute SourceBuffer? sourceBuffer;

Modified: trunk/Source/WebCore/Modules/mediasource/DOMURL+MediaSource.idl (273729 => 273730)


--- trunk/Source/WebCore/Modules/mediasource/DOMURL+MediaSource.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/Modules/mediasource/DOMURL+MediaSource.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -32,6 +32,7 @@
 // FIXME: This should be restricted to being exposed on Window.
 [
     Conditional=MEDIA_SOURCE,
+    EnabledBySetting=MediaSource,
     ImplementedBy=DOMURLMediaSource
 ] partial interface DOMURL {
     [CallWith=ScriptExecutionContext] static DOMString createObjectURL(MediaSource source);

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl (273729 => 273730)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -36,6 +36,7 @@
 [
     ActiveDOMObject,
     Conditional=MEDIA_SOURCE,
+    EnabledBySetting=MediaSource,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=Window
 ] interface SourceBuffer : EventTarget {

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl (273729 => 273730)


--- trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -32,6 +32,7 @@
     ActiveDOMObject,
     Conditional=MEDIA_SOURCE,
     GenerateIsReachable=Impl,
+    EnabledBySetting=MediaSource,
     Exposed=Window
 ] interface SourceBufferList : EventTarget {
     readonly attribute unsigned long length;

Modified: trunk/Source/WebCore/Modules/mediasource/TextTrack+MediaSource.idl (273729 => 273730)


--- trunk/Source/WebCore/Modules/mediasource/TextTrack+MediaSource.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/Modules/mediasource/TextTrack+MediaSource.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -26,6 +26,7 @@
 // https://w3c.github.io/media-source/#text-track-extensions
 [
     Conditional=MEDIA_SOURCE,
+    EnabledBySetting=MediaSource,
     ImplementedBy=TextTrackMediaSource
 ] partial interface TextTrack {
     readonly attribute SourceBuffer? sourceBuffer;

Modified: trunk/Source/WebCore/Modules/mediasource/VideoTrack+MediaSource.idl (273729 => 273730)


--- trunk/Source/WebCore/Modules/mediasource/VideoTrack+MediaSource.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/Modules/mediasource/VideoTrack+MediaSource.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -25,6 +25,7 @@
 
 [
     Conditional=MEDIA_SOURCE,
+    EnabledBySetting=MediaSource,
     ImplementedBy=VideoTrackMediaSource
 ] partial interface VideoTrack {
     readonly attribute SourceBuffer? sourceBuffer;

Modified: trunk/Source/WebCore/PAL/ChangeLog (273729 => 273730)


--- trunk/Source/WebCore/PAL/ChangeLog	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/PAL/ChangeLog	2021-03-02 15:37:23 UTC (rev 273730)
@@ -1,3 +1,16 @@
+2021-03-02  Youenn Fablet  <[email protected]>
+
+        Enable MEDIA_SOURCE in IOS Simulator
+        https://bugs.webkit.org/show_bug.cgi?id=222041
+
+        Reviewed by Eric Carlson.
+
+        Add missing header declarations in AVStreamDataParserSPI.h and use it for simulator.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/spi/cocoa/AVFoundationSPI.h:
+        * pal/spi/cocoa/AVStreamDataParserSPI.h: Added.
+
 2021-03-01  Truitt Savell  <[email protected]>
 
         Unreviewed, reverting r273655.

Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (273729 => 273730)


--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2021-03-02 15:37:23 UTC (rev 273730)
@@ -128,6 +128,7 @@
 		411A9AC12525D4CA00807D7E /* AVAssetWriterSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 411A9AC02525D4CA00807D7E /* AVAssetWriterSPI.h */; };
 		416E995323DAE6BE00E871CB /* AudioToolboxSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 416E995123DAE6BD00E871CB /* AudioToolboxSoftLink.cpp */; };
 		416E995423DAE6BE00E871CB /* AudioToolboxSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E995223DAE6BE00E871CB /* AudioToolboxSoftLink.h */; };
+		41B99E4625DD70160007829A /* AVStreamDataParserSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 41B99E4525DD70150007829A /* AVStreamDataParserSPI.h */; };
 		41E1F344248A6A000022D5DE /* VideoToolboxSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 416E995523DAEFF700E871CB /* VideoToolboxSoftLink.cpp */; };
 		442956CD218A72DF0080DB54 /* RevealSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 442956CC218A72DE0080DB54 /* RevealSPI.h */; };
 		4450FC9F21F5F602004DFA56 /* QuickLookSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4450FC9D21F5F602004DFA56 /* QuickLookSoftLink.mm */; };
@@ -335,6 +336,7 @@
 		416E995223DAE6BE00E871CB /* AudioToolboxSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSoftLink.h; sourceTree = "<group>"; };
 		416E995523DAEFF700E871CB /* VideoToolboxSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoToolboxSoftLink.cpp; sourceTree = "<group>"; };
 		416E995623DAEFF700E871CB /* VideoToolboxSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoToolboxSoftLink.h; sourceTree = "<group>"; };
+		41B99E4525DD70150007829A /* AVStreamDataParserSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVStreamDataParserSPI.h; sourceTree = "<group>"; };
 		442956CC218A72DE0080DB54 /* RevealSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RevealSPI.h; sourceTree = "<group>"; };
 		4450FC9D21F5F602004DFA56 /* QuickLookSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QuickLookSoftLink.mm; sourceTree = "<group>"; };
 		4450FC9E21F5F602004DFA56 /* QuickLookSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickLookSoftLink.h; sourceTree = "<group>"; };
@@ -490,6 +492,7 @@
 				411A9AC02525D4CA00807D7E /* AVAssetWriterSPI.h */,
 				0C7785701F45130F00F4EBB6 /* AVFoundationSPI.h */,
 				0C2DA1221F3BEB4900DBC317 /* AVKitSPI.h */,
+				41B99E4525DD70150007829A /* AVStreamDataParserSPI.h */,
 				29CDEB9E2548D055007C07B7 /* AXSpeechManagerSPI.h */,
 				0C2DA1231F3BEB4900DBC317 /* CFNSURLConnectionSPI.h */,
 				7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */,
@@ -817,6 +820,7 @@
 				077E87B2226A460300A2AFF0 /* AVFoundationSoftLink.h in Headers */,
 				0C7785891F45130F00F4EBB6 /* AVFoundationSPI.h in Headers */,
 				0C2DA13E1F3BEB4900DBC317 /* AVKitSPI.h in Headers */,
+				41B99E4625DD70160007829A /* AVStreamDataParserSPI.h in Headers */,
 				29CDEBA62548D57F007C07B7 /* AXSpeechManagerSPI.h in Headers */,
 				CDF91113220E4EEC001EA39E /* CelestialSPI.h in Headers */,
 				0C2DA06D1F33CA8400DBC317 /* CFLocaleSPI.h in Headers */,

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


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2021-03-02 15:37:23 UTC (rev 273730)
@@ -41,8 +41,12 @@
 #import <AVFoundation/AVPlayerLayer_Private.h>
 
 #if ENABLE(MEDIA_SOURCE)
+#if PLATFORM(IOS_FAMILY_SIMULATOR)
+#import "AVStreamDataParserSPI.h"
+#else
 #import <AVFoundation/AVStreamDataParser.h>
 #endif
+#endif
 
 #if PLATFORM(IOS_FAMILY)
 #import <AVFoundation/AVAudioSession_Private.h>

Added: trunk/Source/WebCore/PAL/pal/spi/cocoa/AVStreamDataParserSPI.h (0 => 273730)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AVStreamDataParserSPI.h	                        (rev 0)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AVStreamDataParserSPI.h	2021-03-02 15:37:23 UTC (rev 273730)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol AVStreamDataParserOutputHandling;
+@class AVStreamDataParserInternal;
+
+@interface AVStreamDataParser : NSObject {
+@private
+    AVStreamDataParserInternal *_parser;
+}
+
+- (void)setDelegate:(nullable id<AVStreamDataParserOutputHandling>)delegate;
+- (void)appendStreamData:(NSData *)data;
+typedef NS_ENUM(NSUInteger, AVStreamDataParserStreamDataFlags) {
+    AVStreamDataParserStreamDataDiscontinuity = 1 << 0,
+};
+- (void)appendStreamData:(NSData *)data withFlags:(AVStreamDataParserStreamDataFlags)flags;
+- (void)providePendingMediaData;
+- (void)setShouldProvideMediaData:(BOOL)shouldProvideMediaData forTrackID:(CMPersistentTrackID)trackID;
+- (BOOL)shouldProvideMediaDataForTrackID:(CMPersistentTrackID)trackID;
+@end
+
+@protocol AVStreamDataParserOutputHandling <NSObject>
+typedef NS_ENUM(NSUInteger, AVStreamDataParserOutputMediaDataFlags) {
+    AVStreamDataParserOutputMediaDataReserved = 1 << 0
+};
+@optional
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didParseStreamDataAsAsset:(AVAsset *)asset withDiscontinuity:(BOOL)withDiscontinuity;
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didFailToParseStreamDataWithError:(NSError *)err;
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didProvideMediaData:(CMSampleBufferRef)mediaData forTrackID:(CMPersistentTrackID)trackID mediaType:(AVMediaType)mediaType flags:(AVStreamDataParserOutputMediaDataFlags)flags;
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didReachEndOfTrackWithTrackID:(CMPersistentTrackID)trackID mediaType:(AVMediaType)mediaType;
+- (void)streamDataParserWillProvideContentKeyRequestInitializationData:(AVStreamDataParser *)streamDataParser forTrackID:(CMPersistentTrackID)trackID;
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didProvideContentKeyRequestInitializationData:(NSData *)contentKeyRequestInitializationData forTrackID:(CMPersistentTrackID)trackID;
+
+@end
+
+@interface AVStreamDataParser (AVStreamDataParserTypeSupport)
++ (NSString *)outputMIMECodecParameterForInputMIMECodecParameter:(NSString *)inputMIMECodecParameter;
+
+@end
+
+@interface AVStreamDataParser (AVStreamDataParserContentKeyEligibility) <AVContentKeyRecipient>
+@end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (273729 => 273730)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2021-03-02 15:37:23 UTC (rev 273730)
@@ -254,6 +254,8 @@
     macro(SpeechRecognitionEvent) \
     macro(SpeechRecognitionResult) \
     macro(SpeechRecognitionResultList) \
+    macro(SourceBuffer) \
+    macro(SourceBufferList) \
     macro(StaticRange) \
     macro(StereoPannerNode) \
     macro(StylePropertyMapReadOnly) \
@@ -369,6 +371,8 @@
     macro(isDisturbed) \
     macro(isLoading) \
     macro(isSecureContext) \
+    macro(kind) \
+    macro(language) \
     macro(localStreams) \
     macro(location) \
     macro(makeDOMException) \

Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (273729 => 273730)


--- trunk/Source/WebCore/html/HTMLMediaElement.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -23,7 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-
 typedef (
 #if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM
     MediaStream or

Modified: trunk/Source/WebCore/html/track/AudioTrack.idl (273729 => 273730)


--- trunk/Source/WebCore/html/track/AudioTrack.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/html/track/AudioTrack.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -31,9 +31,9 @@
     Exposed=Window
 ] interface AudioTrack {
     readonly attribute DOMString id;
-    [ConditionallyReadWrite=MEDIA_SOURCE] attribute DOMString kind;
+    [SettingsConditionallyReadWrite=MediaSource] attribute DOMString kind;
     readonly attribute DOMString label;
-    [ConditionallyReadWrite=MEDIA_SOURCE] attribute DOMString language;
+    [SettingsConditionallyReadWrite=MediaSource] attribute DOMString language;
 
     attribute boolean enabled;
 };

Modified: trunk/Source/WebCore/html/track/TextTrack.idl (273729 => 273730)


--- trunk/Source/WebCore/html/track/TextTrack.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/html/track/TextTrack.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -37,7 +37,7 @@
     readonly attribute DOMString id;
     [ImplementedAs=kindForBindings] attribute TextTrackKind kind;
     readonly attribute DOMString label;
-    [ConditionallyReadWrite=MEDIA_SOURCE] attribute DOMString language;
+    [SettingsConditionallyReadWrite=MediaSource] attribute DOMString language;
     readonly attribute DOMString inBandMetadataTrackDispatchType;
 
     attribute TextTrackMode mode;

Modified: trunk/Source/WebCore/html/track/VideoTrack.idl (273729 => 273730)


--- trunk/Source/WebCore/html/track/VideoTrack.idl	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/html/track/VideoTrack.idl	2021-03-02 15:37:23 UTC (rev 273730)
@@ -30,9 +30,9 @@
     Exposed=Window
 ] interface VideoTrack {
     readonly attribute DOMString id;
-    [ConditionallyReadWrite=MEDIA_SOURCE] attribute DOMString kind;
+    [SettingsConditionallyReadWrite=MediaSource] attribute DOMString kind;
     readonly attribute DOMString label;
-    [ConditionallyReadWrite=MEDIA_SOURCE] attribute DOMString language;
+    [SettingsConditionallyReadWrite=MediaSource] attribute DOMString language;
 
     attribute boolean selected;
 };

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (273729 => 273730)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2021-03-02 15:37:23 UTC (rev 273730)
@@ -325,7 +325,11 @@
     });
 
     if (currentIndex == notFound) {
+#if PLATFORM(IOS_FAMILY_SIMULATOR)
+        ASSERT(identifier == MediaPlayerEnums::MediaEngineIdentifier::AVFoundationMSE);
+#else
         ASSERT_NOT_REACHED();
+#endif
         return nullptr;
     }
 

Modified: trunk/Tools/ChangeLog (273729 => 273730)


--- trunk/Tools/ChangeLog	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Tools/ChangeLog	2021-03-02 15:37:23 UTC (rev 273730)
@@ -1,3 +1,15 @@
+2021-03-02  Youenn Fablet  <[email protected]>
+
+        Enable MEDIA_SOURCE in IOS Simulator
+        https://bugs.webkit.org/show_bug.cgi?id=222041
+        <rdar://problem/74433510>
+
+        Reviewed by Eric Carlson.
+
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformResetPreferencesToConsistentValues):
+        Disable MediaSource runtime flag on simulator since it lacks implementation of AVStreamDataParser.
+
 2021-03-02  Aakash Jain  <[email protected]>
 
         Move WebGL test bot to Big Sur (follow-up fix)

Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (273729 => 273730)


--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2021-03-02 15:12:30 UTC (rev 273729)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2021-03-02 15:37:23 UTC (rev 273730)
@@ -150,6 +150,7 @@
     WKPreferencesSetContentChangeObserverEnabled(preferences, false);
 #if PLATFORM(IOS_FAMILY_SIMULATOR)
     WKPreferencesSetVP9DecoderEnabled(preferences, false);
+    WKPreferencesSetMediaSourceEnabled(preferences, false);
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to