Title: [264659] trunk/Source
Revision
264659
Author
jer.no...@apple.com
Date
2020-07-21 09:36:35 -0700 (Tue, 21 Jul 2020)

Log Message

[Cocoa] Adopt VTRegisterSupplementalVideoDecoderIfAvailable
https://bugs.webkit.org/show_bug.cgi?id=214585
<rdar://problem/65863651>

Reviewed by Youenn Fablet.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/cocoa/VP9UtilitiesCocoa.h:
* platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::registerSupplementalVP9Decoder):

Source/WebKit:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::enableVP9Decoder):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264658 => 264659)


--- trunk/Source/WebCore/ChangeLog	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebCore/ChangeLog	2020-07-21 16:36:35 UTC (rev 264659)
@@ -1,3 +1,18 @@
+2020-07-21  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Adopt VTRegisterSupplementalVideoDecoderIfAvailable
+        https://bugs.webkit.org/show_bug.cgi?id=214585
+        <rdar://problem/65863651>
+
+        Reviewed by Youenn Fablet.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/cocoa/VideoToolboxSoftLink.cpp:
+        * platform/cocoa/VideoToolboxSoftLink.h:
+        * platform/graphics/cocoa/VP9UtilitiesCocoa.h:
+        * platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
+        (WebCore::registerSupplementalVP9Decoder):
+
 2020-07-21  Zalan Bujtas  <za...@apple.com>
 
         [UI Events] Make mousemove cancelable

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (264658 => 264659)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-07-21 16:36:35 UTC (rev 264659)
@@ -4160,6 +4160,7 @@
 		CD92F5182261038200F87BB3 /* FullscreenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CD92F5162261038200F87BB3 /* FullscreenManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD94A5DD1F71D5D800F525C5 /* CDMClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD94A5DB1F71CBB000F525C5 /* CDMClearKey.cpp */; };
 		CD94A5DE1F72F57B00F525C5 /* CDMClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD94A5C91F71CA9D00F525C5 /* CDMClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CD9CC58524C6BBEB00CD3C64 /* VP9Utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = CD6FE5BA24BCE7B6009FCDA4 /* VP9Utilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD9D82761C7AE535006FF066 /* TextureCacheCV.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9D82741C7AE535006FF066 /* TextureCacheCV.h */; };
 		CD9D827A1C7B8EE1006FF066 /* VideoTextureCopierCV.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9D82781C7B8EE1006FF066 /* VideoTextureCopierCV.h */; };
 		CD9DE17517AAC74C00EA386D /* JSMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9DE17317AAC74C00EA386D /* JSMediaSource.h */; };
@@ -4182,6 +4183,7 @@
 		CDAB6D2917C7DE6C00C60B34 /* MediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2717C7DE6C00C60B34 /* MediaControlsHost.h */; };
 		CDAB6D2E17C814EE00C60B34 /* JSMediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2C17C814EE00C60B34 /* JSMediaControlsHost.h */; };
 		CDAB6D3117C9259500C60B34 /* UserAgentScripts.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2F17C9259500C60B34 /* UserAgentScripts.h */; };
+		CDAC068324C6A95A002F727F /* VP9UtilitiesCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = CD6FE5B724BCE645009FCDA4 /* VP9UtilitiesCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CDB6354923F6023A00C0F9DE /* WebAVPlayerController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA29A2C1CBF73FC00901CCF /* WebAVPlayerController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CDB7045A1F7465A1003923DF /* CDMFairPlayStreaming.h in Headers */ = {isa = PBXBuildFile; fileRef = CDB704581F7465A1003923DF /* CDMFairPlayStreaming.h */; };
 		CDB7045B1F7465A1003923DF /* CDMFairPlayStreaming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB704591F7465A1003923DF /* CDMFairPlayStreaming.cpp */; };
@@ -30037,6 +30039,7 @@
 				830030F81B7D3B7800ED3AAC /* CachedHTMLCollection.h in Headers */,
 				BCB16C1C0979C3BD00467741 /* CachedImage.h in Headers */,
 				319FBD5F15D2F464009640A6 /* CachedImageClient.h in Headers */,
+				CDAC068324C6A95A002F727F /* VP9UtilitiesCocoa.h in Headers */,
 				E307DED01D81E4C700141CAF /* CachedModuleScriptLoader.h in Headers */,
 				E307DED11D81E4CB00141CAF /* CachedModuleScriptLoaderClient.h in Headers */,
 				510184690B08602A004A825F /* CachedPage.h in Headers */,
@@ -31109,6 +31112,7 @@
 				519DBC6F1DC011A700329BF5 /* IDBGetAllRecordsData.h in Headers */,
 				519DBC721DC10F5200329BF5 /* IDBGetAllResult.h in Headers */,
 				5105F0691D4BA9D900FB80BC /* IDBGetRecordData.h in Headers */,
+				CD9CC58524C6BBEB00CD3C64 /* VP9Utilities.h in Headers */,
 				5185FC8F1BB4C4E80012898F /* IDBGetResult.h in Headers */,
 				5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */,
 				51F798F01BE880E7008AE491 /* IDBIndexInfo.h in Headers */,

Modified: trunk/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp (264658 => 264659)


--- trunk/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp	2020-07-21 16:36:35 UTC (rev 264659)
@@ -49,6 +49,7 @@
 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, VideoToolbox, VTCreateCGImageFromCVPixelBuffer, OSStatus, (CVPixelBufferRef pixelBuffer, CFDictionaryRef options, CGImageRef* imageOut), (pixelBuffer, options, imageOut))
 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, VideoToolbox, VTCopyHEVCDecoderCapabilitiesDictionary, CFDictionaryRef, (), ())
 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, VideoToolbox, VTGetHEVCCapabilitesForFormatDescription, OSStatus, (CMVideoFormatDescriptionRef formatDescription, CFDictionaryRef decoderCapabilitiesDict, Boolean* isDecodable, Boolean* mayBePlayable), (formatDescription, decoderCapabilitiesDict, isDecodable, mayBePlayable))
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, VideoToolbox, VTRegisterSupplementalVideoDecoderIfAvailable, void, (CMVideoCodecType codecType), (codecType))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, VideoToolbox, VTSelectAndCreateVideoDecoderInstance, OSStatus, (CMVideoCodecType codecType, CFAllocatorRef allocator, CFDictionaryRef videoDecoderSpecification, VTVideoDecoderRef *decoderInstanceOut), (codecType, allocator, videoDecoderSpecification, decoderInstanceOut))
 SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, VideoToolbox, kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder, CFStringRef)
 SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, VideoToolbox, kVTDecompressionPropertyKey_PixelBufferPool, CFStringRef)

Modified: trunk/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.h (264658 => 264659)


--- trunk/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.h	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.h	2020-07-21 16:36:35 UTC (rev 264659)
@@ -121,3 +121,4 @@
 #define VTPixelBufferConformerIsConformantPixelBuffer softLink_VideoToolbox_VTPixelBufferConformerIsConformantPixelBuffer
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, VideoToolbox, VTPixelBufferConformerCopyConformedPixelBuffer, OSStatus, (VTPixelBufferConformerRef conformer, CVPixelBufferRef sourceBuffer, Boolean ensureModifiable, CVPixelBufferRef* conformedBufferOut), (conformer, sourceBuffer, ensureModifiable, conformedBufferOut))
 #define VTPixelBufferConformerCopyConformedPixelBuffer softLink_VideoToolbox_VTPixelBufferConformerCopyConformedPixelBuffer
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(WebCore, VideoToolbox, VTRegisterSupplementalVideoDecoderIfAvailable, void, (CMVideoCodecType codecType), (codecType))

Modified: trunk/Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h (264658 => 264659)


--- trunk/Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h	2020-07-21 16:36:35 UTC (rev 264659)
@@ -38,6 +38,7 @@
 WEBCORE_EXPORT extern void setOverrideVP9ScreenSizeAndScaleForTesting(float width, float height, float scale);
 WEBCORE_EXPORT extern void resetOverrideVP9ScreenSizeAndScaleForTesting();
 
+WEBCORE_EXPORT extern void registerSupplementalVP9Decoder();
 extern bool validateVPParameters(VPCodecConfigurationRecord&, MediaCapabilitiesInfo&, const VideoConfiguration&);
 
 }

Modified: trunk/Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm (264658 => 264659)


--- trunk/Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm	2020-07-21 16:36:35 UTC (rev 264659)
@@ -96,6 +96,12 @@
     return ResolutionCategory::R_480p;
 }
 
+void registerSupplementalVP9Decoder()
+{
+    if (canLoad_VideoToolbox_VTRegisterSupplementalVideoDecoderIfAvailable())
+        softLink_VideoToolbox_VTRegisterSupplementalVideoDecoderIfAvailable(kCMVideoCodecType_VP9);
+}
+
 bool validateVPParameters(VPCodecConfigurationRecord& codecConfiguration, MediaCapabilitiesInfo& info, const VideoConfiguration& videoConfiguration)
 {
     OSStatus status = VTSelectAndCreateVideoDecoderInstance(kCMVideoCodecType_VP9, kCFAllocatorDefault, nullptr, nullptr);

Modified: trunk/Source/WebKit/ChangeLog (264658 => 264659)


--- trunk/Source/WebKit/ChangeLog	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebKit/ChangeLog	2020-07-21 16:36:35 UTC (rev 264659)
@@ -1,3 +1,14 @@
+2020-07-21  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Adopt VTRegisterSupplementalVideoDecoderIfAvailable
+        https://bugs.webkit.org/show_bug.cgi?id=214585
+        <rdar://problem/65863651>
+
+        Reviewed by Youenn Fablet.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::enableVP9Decoder):
+
 2020-07-21  Michael Catanzaro  <mcatanz...@gnome.org>
 
         [GTK] WebKitSettings:enable-private-browsing missing G_PARAM_DEPRECATED

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (264658 => 264659)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2020-07-21 16:35:55 UTC (rev 264658)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2020-07-21 16:36:35 UTC (rev 264659)
@@ -189,6 +189,10 @@
 #include "AudioSessionRoutingArbitrator.h"
 #endif
 
+#if PLATFORM(COCOA)
+#include <WebCore/VP9UtilitiesCocoa.h>
+#endif
+
 #define RELEASE_LOG_SESSION_ID (m_sessionID ? m_sessionID->toUInt64() : 0)
 #define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
 #define RELEASE_LOG_ERROR_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
@@ -1955,6 +1959,10 @@
 
     m_vp9DecoderEnabled = true;
     LibWebRTCProvider::registerWebKitVP9Decoder();
+
+#if PLATFORM(COCOA)
+    WebCore::registerSupplementalVP9Decoder();
+#endif
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to