Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280623 => 280624)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-04 01:10:53 UTC (rev 280624)
@@ -1,3 +1,20 @@
+2021-08-03 Ryan Haddad <[email protected]>
+
+ Unreviewed, reverting r280531 and r280589.
+
+ caused
+
+ Reverted changesets:
+
+ "[Cocoa] Remove support for AVAssetImageGenerator"
+ https://bugs.webkit.org/show_bug.cgi?id=228560
+ https://commits.webkit.org/r280531
+
+ "REGRESSION (r280531): multiple modern-media-controls tests
+ have become flaky timeouts"
+ https://bugs.webkit.org/show_bug.cgi?id=228714
+ https://commits.webkit.org/r280589
+
2021-08-03 Youenn Fablet <[email protected]>
ReadableStream's pipeTo() and pipeThrough() don't handle options in spec-perfect way
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html (280623 => 280624)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html 2021-08-04 01:10:53 UTC (rev 280624)
@@ -26,7 +26,7 @@
t.step(function() {
var video = document.getElementById("contained");
- video.src = ""
+ video.src = ""
assert_ratio(video, 2.5);
}, "contain:size aspect ratio");
@@ -37,7 +37,7 @@
video = document.createElement("video");
video.setAttribute("width", "250");
video.setAttribute("height", "100");
- video.src = ""
+ video.src = ""
document.body.appendChild(video);
// Videos default to a size of 300x150px and calculate their aspect ratio
// based on that before the video is loaded. So this should be 2, ignoring
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_loop_base.html (280623 => 280624)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_loop_base.html 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_loop_base.html 2021-08-04 01:10:53 UTC (rev 280624)
@@ -33,7 +33,7 @@
media.addEventListener("seeking", startTest, false);
media.loop = true;
- media.src = "" + "?" + new Date() + Math.random();
+ media.src = "" + "?" + new Date() + Math.random();
media.play();
</script>
</body>
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/media/16x16-green.mp4 (280623 => 280624)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/media/16x16-green.mp4 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/media/16x16-green.mp4 2021-08-04 01:10:53 UTC (rev 280624)
@@ -1,7 +0,0 @@
-������ ftypisom������isomiso2avc1mp41������free����\xA9mdat\xFF\xFBP\xC4��\xC0��\xA4������ ����4\x80����LAME3.99.5UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUULAME3.99.5UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU����\xA0\xFF\xFF\x9C\xDCE\xE9\xBD\xE6\xD9H\xB7\x96,\xD8 \xD9#\xEE\xEFx264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69
qpstep=4 ip_ratio=1.4
0 aq=1:1.00��\x80������e\x88\x84��+\xFF\xFE\xD8\xE7\xF3,\x93\x97z\xB7\x90t\xBB\xC6\xD1\xFF\xFBR\xC4]\x83\xC0��\xA4������ ����4\x80����UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUULAME3.99.5UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\xFF\xFBRġ\x83\xC0��\xA4������ ����4\x80����UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUULAME3.99.5UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\xFF\xFBRġ\x83\xC0��\xA4������ ����4\x80����UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUULAME3.99.5UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\xFF\xFBRġ\x83\xC0��\xA4������ ����4\x80����UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\xFF
\xFBRġ\x83\xC0��\xA4������ ����4\x80����UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU����
-moov������lmvhd����������������������������\xE8������\x9C����������������������������������������������������������������������������������������@����������������������������������������������������������������-trak������\tkhd������������������������������������������\x9C����������������������������������������������������������������������������������������@����������������������������$edts������elst��������������������\x82����Q����������\x85mdia������ mdhd����������������������������\xACD����\xD1U\xC4����������-hdlr����������������soun������������������������SoundHandler������0minf������smhd����������������������$dinf������dref��������������������url ������������\xF4stbl������`stsd��������������������Pmp4a������������������������������������������\xACD����������,esds��������\x80\x80\x80����\x80\x80\x80-k����������\xFB\x89����\xFB\x89\x80\x80\x80������ stts������������������������\x80����������Q������(stsc��������������������������������
������������������������,stsz����������������������������\xD0������\xD1������\xD1������\xD1������\xD1������\xD1������stco��������������������0����\xBC����'trak������\tkhd������������������������������������������(��������������������������������������������������������������������������������������������@������������������������$edts������elst��������������������(������������������\x9Fmdia������ mdhd����������������������������2��������U\xC4����������-hdlr����������������vide������������������������VideoHandler������Jminf������vmhd����������������������������$dinf����
��dref��������������������url ����������
-stbl������\xA6stsd��������������������\x96avc1����������������������������������������������������H������H��������������������������������������������������������������������������������\xFF\xFF������0avcCd��
-\xFF\xE1��gd��
-\xAC\xD9^\xC0D������������\xC8<H\x96X��h\xEB\xE3\xCB"\xC0������pasp������������������stts��������������������������������stsc��������������������������������������stsz������������\xBC������������stco��������������������������budta������Zmeta��������������!hdlr����������������mdirappl������������������������-ilst������%\xA9too������data��������������Lavf57.56.100
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (280623 => 280624)
--- trunk/Source/WebCore/ChangeLog 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebCore/ChangeLog 2021-08-04 01:10:53 UTC (rev 280624)
@@ -1,3 +1,20 @@
+2021-08-03 Ryan Haddad <[email protected]>
+
+ Unreviewed, reverting r280531 and r280589.
+
+ caused
+
+ Reverted changesets:
+
+ "[Cocoa] Remove support for AVAssetImageGenerator"
+ https://bugs.webkit.org/show_bug.cgi?id=228560
+ https://commits.webkit.org/r280531
+
+ "REGRESSION (r280531): multiple modern-media-controls tests
+ have become flaky timeouts"
+ https://bugs.webkit.org/show_bug.cgi?id=228714
+ https://commits.webkit.org/r280589
+
2021-08-03 Alex Christensen <[email protected]>
Null check self.session after calling _cancel instead of before
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (280623 => 280624)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2021-08-04 01:10:53 UTC (rev 280624)
@@ -819,8 +819,6 @@
if (!m_player)
return;
- m_player->acceleratedRenderingStateChanged();
-
size_t extraMemoryCost = m_player->extraMemoryCost();
if (extraMemoryCost > m_reportedExtraMemoryCost) {
JSC::VM& vm = commonVM();
@@ -5056,9 +5054,6 @@
if (m_videoFullscreenMode == VideoFullscreenModePictureInPicture)
return true;
- if (!m_inActiveDocument)
- return false;
-
auto* renderer = this->renderer();
return is<RenderVideo>(renderer)
&& downcast<RenderVideo>(*renderer).view().compositor().canAccelerateVideoRendering(downcast<RenderVideo>(*renderer));
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (280623 => 280624)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2021-08-04 01:10:53 UTC (rev 280624)
@@ -105,7 +105,7 @@
MediaPlayerPrivateAVFoundation::MediaRenderingMode MediaPlayerPrivateAVFoundation::preferredRenderingMode() const
{
- if (assetStatus() == MediaPlayerAVAssetStatusUnknown)
+ if (!m_visible || assetStatus() == MediaPlayerAVAssetStatusUnknown)
return MediaRenderingNone;
if (supportsAcceleratedRendering() && m_player->renderingCanBeAccelerated())
@@ -125,14 +125,12 @@
if (preferredMode == MediaRenderingNone)
preferredMode = MediaRenderingToContext;
- if (currentMode == preferredMode)
+ if (currentMode == preferredMode && currentMode != MediaRenderingNone)
return;
- ALWAYS_LOG(LOGIDENTIFIER, "preferredMode: ", preferredMode, ", currentMode: ", currentMode);
+ if (currentMode != MediaRenderingNone)
+ tearDownVideoRendering();
- if (currentMode == MediaRenderingToLayer)
- destroyVideoLayer();
-
switch (preferredMode) {
case MediaRenderingNone:
case MediaRenderingToContext:
@@ -143,6 +141,10 @@
createVideoLayer();
break;
}
+
+ // If using a movie layer, inform the client so the compositing tree is updated.
+ if (currentMode == MediaRenderingToLayer || preferredMode == MediaRenderingToLayer)
+ m_player->renderingModeChanged();
}
void MediaPlayerPrivateAVFoundation::tearDownVideoRendering()
@@ -441,6 +443,9 @@
m_isAllowedToRender = true;
setUpVideoRendering();
+
+ if (currentRenderingMode() == MediaRenderingToLayer || preferredRenderingMode() == MediaRenderingToLayer)
+ m_player->renderingModeChanged();
}
bool MediaPlayerPrivateAVFoundation::supportsFullscreen() const
@@ -466,20 +471,6 @@
m_resolvedOrigin = SecurityOrigin::create(m_resolvedURL);
}
-void MediaPlayerPrivateAVFoundation::renderingModeChanged()
-{
- scheduleUpdateStates();
- m_player->renderingModeChanged();
-}
-
-void MediaPlayerPrivateAVFoundation::scheduleUpdateStates()
-{
- queueTaskOnEventLoop([weakThis = makeWeakPtr(*this)] {
- if (weakThis)
- weakThis->updateStates();
- });
-}
-
void MediaPlayerPrivateAVFoundation::updateStates()
{
if (m_ignoreLoadStateChanges)
@@ -552,21 +543,11 @@
}
}
- // Do not advance to HaveCurrentData unless there is a decoded frame available for display
- if (newReadyState >= MediaPlayer::ReadyState::HaveCurrentData
- && m_readyState < MediaPlayer::ReadyState::HaveCurrentData
- && m_cachedHasVideo && !hasAvailableVideoFrame()) {
- newReadyState = MediaPlayer::ReadyState::HaveMetadata;
- m_delayingReadyState = true;
- ALWAYS_LOG(LOGIDENTIFIER, "!hasAvailableVideoFrame(), lowering readyState to ", newReadyState);
- } else
- m_delayingReadyState = false;
-
if (isReadyForVideoSetup() && currentRenderingMode() != preferredRenderingMode())
setUpVideoRendering();
if (!m_haveReportedFirstVideoFrame && m_cachedHasVideo && hasAvailableVideoFrame()) {
- if (newReadyState < MediaPlayer::ReadyState::HaveCurrentData)
+ if (m_readyState < MediaPlayer::ReadyState::HaveCurrentData)
newReadyState = MediaPlayer::ReadyState::HaveCurrentData;
m_haveReportedFirstVideoFrame = true;
m_player->firstVideoFrameAvailable();
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (280623 => 280624)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2021-08-04 01:10:53 UTC (rev 280624)
@@ -271,7 +271,6 @@
static const HashSet<String, ASCIICaseInsensitiveHash>& staticMIMETypeList();
protected:
- void scheduleUpdateStates();
void updateStates();
void setHasVideo(bool);
@@ -321,8 +320,6 @@
void setResolvedURL(URL&&);
const URL& resolvedURL() const { return m_resolvedURL; }
- void renderingModeChanged();
-
private:
MediaPlayer* m_player;
@@ -371,7 +368,6 @@
bool m_characteristicsChanged;
bool m_shouldMaintainAspectRatio;
bool m_seeking;
- bool m_delayingReadyState { false };
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (280623 => 280624)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2021-08-04 01:10:53 UTC (rev 280624)
@@ -460,8 +460,6 @@
if (m_avfWrapper)
m_avfWrapper->createAVCFVideoLayer();
-
- renderingModeChanged();
}
void MediaPlayerPrivateAVFoundationCF::destroyVideoLayer()
@@ -470,8 +468,6 @@
LOG(Media, "MediaPlayerPrivateAVFoundationCF::destroyVideoLayer(%p) - destroying %p", this, videoLayer(m_avfWrapper));
if (m_avfWrapper)
m_avfWrapper->destroyVideoLayer();
-
- renderingModeChanged();
}
bool MediaPlayerPrivateAVFoundationCF::hasAvailableVideoFrame() const
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (280623 => 280624)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2021-08-04 01:10:53 UTC (rev 280624)
@@ -118,8 +118,6 @@
MediaTime currentMediaTime() const final;
- void outputMediaDataWillChange();
-
private:
#if ENABLE(ENCRYPTED_MEDIA)
void cdmInstanceAttached(CDMInstance&) final;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (280623 => 280624)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-08-04 01:10:53 UTC (rev 280624)
@@ -67,6 +67,7 @@
#import "WebCoreCALayerExtras.h"
#import "WebCoreNSURLExtras.h"
#import "WebCoreNSURLSession.h"
+#import <AVFoundation/AVAssetImageGenerator.h>
#import <AVFoundation/AVAssetTrack.h>
#import <AVFoundation/AVMediaSelectionGroup.h>
#import <AVFoundation/AVMetadataItem.h>
@@ -195,7 +196,6 @@
@interface WebCoreAVFPullDelegate : NSObject<AVPlayerItemOutputPullDelegate> {
BinarySemaphore m_semaphore;
}
-- (void)setParent:(WebCore::MediaPlayerPrivateAVFoundationObjC&)parent;
- (void)outputMediaDataWillChange:(AVPlayerItemOutput *)sender;
- (void)outputSequenceWasFlushed:(AVPlayerItemOutput *)output;
@@ -561,7 +561,7 @@
bool MediaPlayerPrivateAVFoundationObjC::hasContextRenderer() const
{
- return m_videoOutput;
+ return m_videoOutput || m_imageGenerator;
}
void MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer()
@@ -569,11 +569,37 @@
createVideoOutput();
}
+void MediaPlayerPrivateAVFoundationObjC::createImageGenerator()
+{
+ INFO_LOG(LOGIDENTIFIER);
+
+ if (!m_avAsset || m_imageGenerator)
+ return;
+
+ m_imageGenerator = [PAL::getAVAssetImageGeneratorClass() assetImageGeneratorWithAsset:m_avAsset.get()];
+
+ [m_imageGenerator.get() setApertureMode:AVAssetImageGeneratorApertureModeCleanAperture];
+ [m_imageGenerator.get() setAppliesPreferredTrackTransform:YES];
+ [m_imageGenerator.get() setRequestedTimeToleranceBefore:PAL::kCMTimeZero];
+ [m_imageGenerator.get() setRequestedTimeToleranceAfter:PAL::kCMTimeZero];
+}
+
void MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer()
{
destroyVideoOutput();
+ destroyImageGenerator();
}
+void MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator()
+{
+ if (!m_imageGenerator)
+ return;
+
+ INFO_LOG(LOGIDENTIFIER);
+
+ m_imageGenerator = 0;
+}
+
void MediaPlayerPrivateAVFoundationObjC::createVideoLayer()
{
if (!m_avPlayer || m_haveBeenAskedToCreateLayer)
@@ -593,7 +619,7 @@
if (!m_videoOutput)
createVideoOutput();
- renderingModeChanged();
+ player()->renderingModeChanged();
});
}
@@ -632,8 +658,6 @@
m_videoLayerManager->didDestroyVideoLayer();
m_videoLayer = nil;
-
- renderingModeChanged();
}
MediaTime MediaPlayerPrivateAVFoundationObjC::getStartDate() const
@@ -1789,6 +1813,8 @@
// the video output, too.
if (videoOutputHasAvailableFrame() || (m_videoOutput && m_lastPixelBuffer))
paintWithVideoOutput(context, rect);
+ else
+ paintWithImageGenerator(context, rect);
END_BLOCK_OBJC_EXCEPTIONS
setDelayCallbacks(false);
@@ -1812,6 +1838,38 @@
paintCurrentFrameInContext(context, rect);
}
+void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext& context, const FloatRect& rect)
+{
+ INFO_LOG(LOGIDENTIFIER);
+
+ RetainPtr<CGImageRef> image = createImageForTimeInRect(currentTime(), rect);
+ if (image) {
+ GraphicsContextStateSaver stateSaver(context);
+ context.translate(rect.x(), rect.y() + rect.height());
+ context.scale(FloatSize(1.0f, -1.0f));
+ context.setImageInterpolationQuality(InterpolationQuality::Low);
+ IntRect paintRect(IntPoint(0, 0), IntSize(rect.width(), rect.height()));
+ CGContextDrawImage(context.platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
+ }
+}
+
+RetainPtr<CGImageRef> MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect(float time, const FloatRect& rect)
+{
+ if (!m_imageGenerator)
+ createImageGenerator();
+ ASSERT(m_imageGenerator);
+
+ MonotonicTime start = MonotonicTime::now();
+
+ [m_imageGenerator.get() setMaximumSize:CGSize(rect.size())];
+ RetainPtr<CGImageRef> rawImage = adoptCF([m_imageGenerator.get() copyCGImageAtTime:PAL::CMTimeMakeWithSeconds(time, 600) actualTime:nil error:nil]);
+ RetainPtr<CGImageRef> image = adoptCF(CGImageCreateCopyWithColorSpace(rawImage.get(), sRGBColorSpaceRef()));
+
+ INFO_LOG(LOGIDENTIFIER, "creating image took ", (MonotonicTime::now() - start).seconds());
+
+ return image;
+}
+
void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& supportedTypes)
{
supportedTypes = AVAssetMIMETypeCache::singleton().supportedTypes();
@@ -2382,18 +2440,11 @@
}
m_videoOutputDelegate = adoptNS([[WebCoreAVFPullDelegate alloc] init]);
- [m_videoOutputDelegate setParent:*this];
[m_videoOutput setDelegate:m_videoOutputDelegate.get() queue:globalPullDelegateQueue()];
- [m_videoOutput requestNotificationOfMediaDataChangeWithAdvanceInterval:0];
[m_avPlayerItem.get() addOutput:m_videoOutput.get()];
}
-void MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange()
-{
- updateStates();
-}
-
void MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput()
{
if (!m_videoOutput)
@@ -2488,6 +2539,12 @@
FloatRect imageRect { FloatPoint::zero(), m_lastImage->size() };
context.drawNativeImage(*m_lastImage, imageRect.size(), outputRect, imageRect);
+
+ // If we have created an AVAssetImageGenerator in the past due to m_videoOutput not having an available
+ // video frame, destroy it now that it is no longer needed.
+ if (m_imageGenerator)
+ destroyImageGenerator();
+
}
RetainPtr<CVPixelBufferRef> MediaPlayerPrivateAVFoundationObjC::pixelBufferForCurrentTime()
@@ -3842,25 +3899,14 @@
@end
-@implementation WebCoreAVFPullDelegate {
- WeakPtr<WebCore::MediaPlayerPrivateAVFoundationObjC> _parent;
-}
+@implementation WebCoreAVFPullDelegate
@synthesize semaphore = m_semaphore;
-- (void)setParent:(WebCore::MediaPlayerPrivateAVFoundationObjC&)parent
-{
- _parent = makeWeakPtr(parent);
-}
-
- (void)outputMediaDataWillChange:(AVPlayerItemVideoOutput *)output
{
UNUSED_PARAM(output);
m_semaphore.signal();
- RunLoop::main().dispatch([parent = _parent] {
- if (parent)
- parent->outputMediaDataWillChange();
- });
}
- (void)outputSequenceWasFlushed:(AVPlayerItemVideoOutput *)output
Modified: trunk/Source/WebKit/ChangeLog (280623 => 280624)
--- trunk/Source/WebKit/ChangeLog 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebKit/ChangeLog 2021-08-04 01:10:53 UTC (rev 280624)
@@ -1,3 +1,20 @@
+2021-08-03 Ryan Haddad <[email protected]>
+
+ Unreviewed, reverting r280531 and r280589.
+
+ caused
+
+ Reverted changesets:
+
+ "[Cocoa] Remove support for AVAssetImageGenerator"
+ https://bugs.webkit.org/show_bug.cgi?id=228560
+ https://commits.webkit.org/r280531
+
+ "REGRESSION (r280531): multiple modern-media-controls tests
+ have become flaky timeouts"
+ https://bugs.webkit.org/show_bug.cgi?id=228714
+ https://commits.webkit.org/r280589
+
2021-08-03 Brent Fulgham <[email protected]>
[iOS] Allow check for nvram "emu" state on internal OS builds
Modified: trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp (280623 => 280624)
--- trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp 2021-08-04 00:02:49 UTC (rev 280623)
+++ trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp 2021-08-04 01:10:53 UTC (rev 280624)
@@ -455,7 +455,7 @@
void MediaPlayerPrivateRemote::acceleratedRenderingStateChanged()
{
if (auto player = makeRefPtr(m_player.get()))
- connection().send(Messages::RemoteMediaPlayerProxy::AcceleratedRenderingStateChanged(player->renderingCanBeAccelerated()), m_id);
+ connection().send(Messages::RemoteMediaPlayerProxy::AcceleratedRenderingStateChanged(player->supportsAcceleratedRendering()), m_id);
}
#if ENABLE(WIRELESS_PLAYBACK_TARGET)