Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 75467caf79bb0cbbc7441ecbe4a239829779eac3 https://github.com/WebKit/WebKit/commit/75467caf79bb0cbbc7441ecbe4a239829779eac3 Author: Jean-Yves Avenard <j...@apple.com> Date: 2024-07-30 (Tue, 30 Jul 2024)
Changed paths: A LayoutTests/media/media-vp8-webm-with-preload-expected.txt A LayoutTests/media/media-vp8-webm-with-preload.html M LayoutTests/platform/glib/TestExpectations M LayoutTests/platform/mac-wk1/TestExpectations M Source/WebCore/platform/graphics/WebMResourceClient.cpp M Source/WebCore/platform/graphics/WebMResourceClient.h M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm M Source/WebCore/platform/graphics/cocoa/VideoTrackPrivateWebM.h Log Message: ----------- Crash with multiple video tags that contains webm source https://bugs.webkit.org/show_bug.cgi?id=276717 rdar://132405520 Reviewed by Youenn Fablet. The WebM MediaPlayer ignored the preload attribute and would read the webm video in its entirety all the time. This could lead to great memory usage and eventually the page being jetsammed. We now stops loading the video if preload is set to <= metadata and will continue from where we stopped when play() is called. The `requestMediaDataWhenReady` callback was set whenever we demuxed a single sample or when a new audio or video renderer was created, flushed etc. It only needed to be set once. The dimensions of the video were determined after enqueuing the first video sample. We now read it from the container instead as it allows to reduce how much of the media we have to download to obtain the information and move the readyState to HAVE_METADATA. Added test. * LayoutTests/media/media-vp8-webm-withp-reload-expected.txt: Added. * LayoutTests/media/media-vp8-webm-with-preload.html: Added. * LayoutTests/platform/glib/TestExpectations: see webkit.org/b/277327 * LayoutTests/platform/mac-wk1/TestExpectations: webm not supported in wk1. * Source/WebCore/platform/graphics/WebMResourceClient.cpp: (WebCore::WebMResourceClient::responseReceived): * Source/WebCore/platform/graphics/WebMResourceClient.h: * Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h: * Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm: (WebCore::MediaPlayerPrivateWebM::setPreload): (WebCore::MediaPlayerPrivateWebM::doPreload): (WebCore::MediaPlayerPrivateWebM::load): (WebCore::MediaPlayerPrivateWebM::createResourceClient): (WebCore::MediaPlayerPrivateWebM::dataLengthReceived): (WebCore::MediaPlayerPrivateWebM::dataReceived): (WebCore::MediaPlayerPrivateWebM::cancelLoad): (WebCore::MediaPlayerPrivateWebM::prepareToPlay): (WebCore::MediaPlayerPrivateWebM::setNaturalSize): (WebCore::MediaPlayerPrivateWebM::setNetworkState): (WebCore::MediaPlayerPrivateWebM::maybeFinishLoading): (WebCore::MediaPlayerPrivateWebM::trackDidChangeSelected): (WebCore::MediaPlayerPrivateWebM::trackDidChangeEnabled): (WebCore::MediaPlayerPrivateWebM::didParseInitializationData): (WebCore::MediaPlayerPrivateWebM::didProvideMediaDataForTrackId): (WebCore::MediaPlayerPrivateWebM::ensureDecompressionSession): (WebCore::MediaPlayerPrivateWebM::addAudioRenderer): (WebCore::MediaPlayerPrivateWebM::configureVideoRenderer): (WebCore::MediaPlayerPrivateWebM::setVideoRenderer): * Source/WebCore/platform/graphics/cocoa/VideoTrackPrivateWebM.h: We were relying on the first video frame being enqueued to determine the dimensions of the video. We'll now instead rely on the container's track data. So we make public the width and height function. Canonical link: https://commits.webkit.org/281554@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes