Title: [270814] branches/safari-610-branch/Source/WebCore
Revision
270814
Author
[email protected]
Date
2020-12-14 17:28:09 -0800 (Mon, 14 Dec 2020)

Log Message

Cherry-pick r269893. rdar://problem/72298580

    Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2]
    https://bugs.webkit.org/show_bug.cgi?id=218637
    <rdar://problem/71102126>

    Patch by Kimmo Kinnunen <[email protected]> on 2020-11-16
    Reviewed by Eric Carlson.

    Patch by Jer Noble.

    Treat internal compressed YUV pixel formats
    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and
    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as
    kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and
    kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when
    using the OpenGL shader to convert video IOSurface to a WebGL
    texture.

    Fixes cases where the decoder outputs the compressed formats.

    No new tests, adding more comprehensive test content suite is tracked
    in another bug.

    Source/WebCore:

    * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
    (WebCore::pixelRangeFromPixelFormat):
    (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):

    Source/WebCore/PAL:

    * PAL.xcodeproj/project.pbxproj:
    * pal/spi/cf/CoreVideoSPI.h: Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269893 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (270813 => 270814)


--- branches/safari-610-branch/Source/WebCore/ChangeLog	2020-12-15 01:27:49 UTC (rev 270813)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog	2020-12-15 01:28:09 UTC (rev 270814)
@@ -1,5 +1,71 @@
 2020-12-14  Alan Coon  <[email protected]>
 
+        Cherry-pick r269893. rdar://problem/72298580
+
+    Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2]
+    https://bugs.webkit.org/show_bug.cgi?id=218637
+    <rdar://problem/71102126>
+    
+    Patch by Kimmo Kinnunen <[email protected]> on 2020-11-16
+    Reviewed by Eric Carlson.
+    
+    Patch by Jer Noble.
+    
+    Treat internal compressed YUV pixel formats
+    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and
+    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as
+    kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and
+    kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when
+    using the OpenGL shader to convert video IOSurface to a WebGL
+    texture.
+    
+    Fixes cases where the decoder outputs the compressed formats.
+    
+    No new tests, adding more comprehensive test content suite is tracked
+    in another bug.
+    
+    Source/WebCore:
+    
+    * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
+    (WebCore::pixelRangeFromPixelFormat):
+    (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):
+    
+    Source/WebCore/PAL:
+    
+    * PAL.xcodeproj/project.pbxproj:
+    * pal/spi/cf/CoreVideoSPI.h: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-11-16  Kimmo Kinnunen  <[email protected]>
+
+            Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2]
+            https://bugs.webkit.org/show_bug.cgi?id=218637
+            <rdar://problem/71102126>
+
+            Reviewed by Eric Carlson.
+
+            Patch by Jer Noble.
+
+            Treat internal compressed YUV pixel formats
+            kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and
+            kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as
+            kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and
+            kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when
+            using the OpenGL shader to convert video IOSurface to a WebGL
+            texture.
+
+            Fixes cases where the decoder outputs the compressed formats.
+
+            No new tests, adding more comprehensive test content suite is tracked
+            in another bug.
+
+            * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
+            (WebCore::pixelRangeFromPixelFormat):
+            (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):
+
+2020-12-14  Alan Coon  <[email protected]>
+
         Cherry-pick r269535. rdar://problem/72298703
 
     Empty text runs can't be split any further.

Modified: branches/safari-610-branch/Source/WebCore/PAL/ChangeLog (270813 => 270814)


--- branches/safari-610-branch/Source/WebCore/PAL/ChangeLog	2020-12-15 01:27:49 UTC (rev 270813)
+++ branches/safari-610-branch/Source/WebCore/PAL/ChangeLog	2020-12-15 01:28:09 UTC (rev 270814)
@@ -1,3 +1,68 @@
+2020-12-14  Alan Coon  <[email protected]>
+
+        Cherry-pick r269893. rdar://problem/72298580
+
+    Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2]
+    https://bugs.webkit.org/show_bug.cgi?id=218637
+    <rdar://problem/71102126>
+    
+    Patch by Kimmo Kinnunen <[email protected]> on 2020-11-16
+    Reviewed by Eric Carlson.
+    
+    Patch by Jer Noble.
+    
+    Treat internal compressed YUV pixel formats
+    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and
+    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as
+    kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and
+    kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when
+    using the OpenGL shader to convert video IOSurface to a WebGL
+    texture.
+    
+    Fixes cases where the decoder outputs the compressed formats.
+    
+    No new tests, adding more comprehensive test content suite is tracked
+    in another bug.
+    
+    Source/WebCore:
+    
+    * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
+    (WebCore::pixelRangeFromPixelFormat):
+    (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):
+    
+    Source/WebCore/PAL:
+    
+    * PAL.xcodeproj/project.pbxproj:
+    * pal/spi/cf/CoreVideoSPI.h: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-11-16  Kimmo Kinnunen  <[email protected]>
+
+            Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2]
+            https://bugs.webkit.org/show_bug.cgi?id=218637
+            <rdar://problem/71102126>
+
+            Reviewed by Eric Carlson.
+
+            Patch by Jer Noble.
+
+            Treat internal compressed YUV pixel formats
+            kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and
+            kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as
+            kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and
+            kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when
+            using the OpenGL shader to convert video IOSurface to a WebGL
+            texture.
+
+            Fixes cases where the decoder outputs the compressed formats.
+
+            No new tests, adding more comprehensive test content suite is tracked
+            in another bug.
+
+            * PAL.xcodeproj/project.pbxproj:
+            * pal/spi/cf/CoreVideoSPI.h: Added.
+
 2020-11-13  Russell Epstein  <[email protected]>
 
         Cherry-pick r269208. rdar://problem/71378171

Modified: branches/safari-610-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (270813 => 270814)


--- branches/safari-610-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2020-12-15 01:27:49 UTC (rev 270813)
+++ branches/safari-610-branch/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2020-12-15 01:28:09 UTC (rev 270814)
@@ -377,6 +377,7 @@
 		C138EA1A2436447200656DF1 /* CoreServicesSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoreServicesSPI.h; sourceTree = "<group>"; };
 		C15CBB3223F34A1200300CC7 /* NSUserDefaultsSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSUserDefaultsSPI.h; sourceTree = "<group>"; };
 		C2147A4A1EFD0AA600056FA5 /* CopyPALHeaders.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CopyPALHeaders.xcconfig; sourceTree = "<group>"; };
+		CD17B268255F1625008430F9 /* CoreVideoSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoreVideoSPI.h; sourceTree = "<group>"; };
 		CDACB35E23873E480018D7CE /* MediaToolboxSoftLink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaToolboxSoftLink.cpp; sourceTree = "<group>"; };
 		CDACB35F23873E480018D7CE /* MediaToolboxSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaToolboxSoftLink.h; sourceTree = "<group>"; };
 		CDF91112220E4EEC001EA39E /* CelestialSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CelestialSPI.h; sourceTree = "<group>"; };
@@ -431,6 +432,7 @@
 				0C2DA06A1F33CA8400DBC317 /* CFUtilitiesSPI.h */,
 				0C2DA06B1F33CA8400DBC317 /* CoreAudioSPI.h */,
 				0C2DA06C1F33CA8400DBC317 /* CoreMediaSPI.h */,
+				CD17B268255F1625008430F9 /* CoreVideoSPI.h */,
 			);
 			path = cf;
 			sourceTree = "<group>";

Added: branches/safari-610-branch/Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h (0 => 270814)


--- branches/safari-610-branch/Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h	                        (rev 0)
+++ branches/safari-610-branch/Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h	2020-12-15 01:28:09 UTC (rev 270814)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <CoreVideo/CoreVideo.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+#include <CoreVideo/CVPixelBufferPrivate.h>
+#else
+enum {
+    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange = '&8v0',
+    kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange = '&8f0',
+};
+#endif

Modified: branches/safari-610-branch/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp (270813 => 270814)


--- branches/safari-610-branch/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp	2020-12-15 01:27:49 UTC (rev 270813)
+++ branches/safari-610-branch/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp	2020-12-15 01:28:09 UTC (rev 270814)
@@ -28,6 +28,7 @@
 
 #include "FourCC.h"
 #include "Logging.h"
+#include <pal/spi/cf/CoreVideoSPI.h>
 #include <pal/spi/cocoa/IOSurfaceSPI.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/StdMap.h>
@@ -198,6 +199,7 @@
     case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange:
     case kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange:
     case kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange:
+    case kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange:
         return PixelRange::Video;
     case kCVPixelFormatType_420YpCbCr8PlanarFullRange:
     case kCVPixelFormatType_420YpCbCr8BiPlanarFullRange:
@@ -206,6 +208,7 @@
     case kCVPixelFormatType_420YpCbCr10BiPlanarFullRange:
     case kCVPixelFormatType_422YpCbCr10BiPlanarFullRange:
     case kCVPixelFormatType_444YpCbCr10BiPlanarFullRange:
+    case kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange:
         return PixelRange::Full;
     default:
         return PixelRange::Unknown;
@@ -811,7 +814,10 @@
 
     // FIXME: This currently only supports '420v' and '420f' pixel formats. Investigate supporting more pixel formats.
     OSType pixelFormat = CVPixelBufferGetPixelFormatType(image);
-    if (pixelFormat != kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange && pixelFormat != kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) {
+    if (pixelFormat != kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
+        && pixelFormat != kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
+        && pixelFormat != kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange
+        && pixelFormat != kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange) {
         LOG(WebGL, "VideoTextureCopierCV::copyVideoTextureToPlatformTexture(%p) - Asked to copy an unsupported pixel format ('%s').", this, FourCC(pixelFormat).toString().utf8().data());
         return false;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to