- Revision
- 269893
- Author
- [email protected]
- Date
- 2020-11-16 21:23:24 -0800 (Mon, 16 Nov 2020)
Log Message
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.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (269892 => 269893)
--- trunk/Source/WebCore/ChangeLog 2020-11-17 04:33:06 UTC (rev 269892)
+++ trunk/Source/WebCore/ChangeLog 2020-11-17 05:23:24 UTC (rev 269893)
@@ -1,3 +1,30 @@
+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-11-16 Sam Weinig <[email protected]>
Standardize enums that are used by Settings in preperation for autogeneration
Modified: trunk/Source/WebCore/PAL/ChangeLog (269892 => 269893)
--- trunk/Source/WebCore/PAL/ChangeLog 2020-11-17 04:33:06 UTC (rev 269892)
+++ trunk/Source/WebCore/PAL/ChangeLog 2020-11-17 05:23:24 UTC (rev 269893)
@@ -1,3 +1,29 @@
+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-11 Eric Carlson <[email protected]>
USB microphone not recognized iOS Safari
Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (269892 => 269893)
--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2020-11-17 04:33:06 UTC (rev 269892)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2020-11-17 05:23:24 UTC (rev 269893)
@@ -381,6 +381,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>"; };
CD6122CA2559B6AC00FC657A /* OutputContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OutputContext.h; sourceTree = "<group>"; };
CD6122CB2559B6AC00FC657A /* OutputContext.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = OutputContext.mm; sourceTree = "<group>"; };
CD6122CE2559B8F200FC657A /* OutputDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OutputDevice.h; sourceTree = "<group>"; };
@@ -443,6 +444,7 @@
0C2DA06A1F33CA8400DBC317 /* CFUtilitiesSPI.h */,
0C2DA06B1F33CA8400DBC317 /* CoreAudioSPI.h */,
0C2DA06C1F33CA8400DBC317 /* CoreMediaSPI.h */,
+ CD17B268255F1625008430F9 /* CoreVideoSPI.h */,
);
path = cf;
sourceTree = "<group>";
Added: trunk/Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h (0 => 269893)
--- trunk/Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h 2020-11-17 05:23:24 UTC (rev 269893)
@@ -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: trunk/Source/WebCore/platform/graphics/cv/GraphicsContextGLCVANGLE.cpp (269892 => 269893)
--- trunk/Source/WebCore/platform/graphics/cv/GraphicsContextGLCVANGLE.cpp 2020-11-17 04:33:06 UTC (rev 269892)
+++ trunk/Source/WebCore/platform/graphics/cv/GraphicsContextGLCVANGLE.cpp 2020-11-17 05:23:24 UTC (rev 269893)
@@ -30,6 +30,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>
@@ -146,6 +147,7 @@
case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange:
case kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange:
case kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange:
+ case kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange:
return PixelRange::Video;
case kCVPixelFormatType_420YpCbCr8PlanarFullRange:
case kCVPixelFormatType_420YpCbCr8BiPlanarFullRange:
@@ -154,6 +156,7 @@
case kCVPixelFormatType_420YpCbCr10BiPlanarFullRange:
case kCVPixelFormatType_422YpCbCr10BiPlanarFullRange:
case kCVPixelFormatType_444YpCbCr10BiPlanarFullRange:
+ case kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange:
return PixelRange::Full;
default:
return PixelRange::Unknown;
@@ -578,7 +581,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, "GraphicsContextGLCVANGLE::copyVideoTextureToPlatformTexture(%p) - Asked to copy an unsupported pixel format ('%s').", this, FourCC(pixelFormat).toString().utf8().data());
return false;
}