Title: [288053] trunk/Source/WebCore
- Revision
- 288053
- Author
- [email protected]
- Date
- 2022-01-14 23:30:01 -0800 (Fri, 14 Jan 2022)
Log Message
Unable to playback portrait videos on HTML canvas elements
https://bugs.webkit.org/show_bug.cgi?id=235238
Reviewed by Jer Noble.
We need to make sure the destination pixel buffer is IOSurface-backed.
Otherwise, VTImageRotationSession cannot rotate a pixel buffer with
a compressed pixel format.
Manually tested.
Layout tests for this exist, but unless they run on an iPhone 12 or
later HW, they won't fail. For example:
- media/video-orientation-canvas.html
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
* platform/graphics/cv/ImageRotationSessionVT.mm:
(WebCore::ImageRotationSessionVT::rotate):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (288052 => 288053)
--- trunk/Source/WebCore/ChangeLog 2022-01-15 07:00:43 UTC (rev 288052)
+++ trunk/Source/WebCore/ChangeLog 2022-01-15 07:30:01 UTC (rev 288053)
@@ -1,3 +1,25 @@
+2022-01-14 Peng Liu <[email protected]>
+
+ Unable to playback portrait videos on HTML canvas elements
+ https://bugs.webkit.org/show_bug.cgi?id=235238
+
+ Reviewed by Jer Noble.
+
+ We need to make sure the destination pixel buffer is IOSurface-backed.
+ Otherwise, VTImageRotationSession cannot rotate a pixel buffer with
+ a compressed pixel format.
+
+ Manually tested.
+
+ Layout tests for this exist, but unless they run on an iPhone 12 or
+ later HW, they won't fail. For example:
+ - media/video-orientation-canvas.html
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
+ * platform/graphics/cv/ImageRotationSessionVT.mm:
+ (WebCore::ImageRotationSessionVT::rotate):
+
2022-01-14 Frederic Wang <[email protected]>
null ptr deref in WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor()
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (288052 => 288053)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2022-01-15 07:00:43 UTC (rev 288052)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2022-01-15 07:30:01 UTC (rev 288053)
@@ -2556,7 +2556,7 @@
};
}
- if (m_imageRotationSession)
+ if (m_lastPixelBuffer && m_imageRotationSession)
m_lastPixelBuffer = m_imageRotationSession->rotate(m_lastPixelBuffer.get());
m_lastImage = nullptr;
Modified: trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm (288052 => 288053)
--- trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm 2022-01-15 07:00:43 UTC (rev 288052)
+++ trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm 2022-01-15 07:30:01 UTC (rev 288053)
@@ -102,9 +102,7 @@
(__bridge NSString *)kCVPixelBufferHeightKey: @(m_rotatedSize.height()),
(__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(m_pixelFormat),
(__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: (m_isCGImageCompatible == IsCGImageCompatible::Yes ? @YES : @NO),
-#if PLATFORM(IOS_SIMULATOR) || PLATFORM(MAC)
(__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ }
-#endif
};
CVPixelBufferPoolRef rawPool = nullptr;
@@ -119,7 +117,7 @@
RetainPtr<CVPixelBufferRef> result;
CVPixelBufferRef rawRotatedBuffer = nullptr;
auto status = CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, m_rotationPool.get(), &rawRotatedBuffer);
- if (status != kCVReturnSuccess) {
+ if (status != kCVReturnSuccess || !rawRotatedBuffer) {
RELEASE_LOG_ERROR(WebRTC, "ImageRotationSessionVT failed creating buffer from pool with error %d", status);
return nullptr;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes