Bug 228560 - [Cocoa] Remove support for AVAssetImageGenerator
Summary: [Cocoa] Remove support for AVAssetImageGenerator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on: 228620 228677
Blocks:
  Show dependency treegraph
 
Reported: 2021-07-28 11:30 PDT by Jer Noble
Modified: 2021-08-06 08:09 PDT (History)
15 users (show)

See Also:


Attachments
Patch (13.40 KB, patch)
2021-07-28 13:39 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (13.41 KB, patch)
2021-07-28 13:46 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (13.42 KB, patch)
2021-07-28 14:17 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (13.64 KB, patch)
2021-07-28 15:11 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (18.80 KB, patch)
2021-07-28 23:18 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (16.74 KB, patch)
2021-07-28 23:37 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (16.75 KB, patch)
2021-07-29 21:59 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (21.25 KB, patch)
2021-07-31 18:22 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (24.58 KB, patch)
2021-07-31 19:22 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (26.32 KB, patch)
2021-07-31 19:43 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (26.45 KB, patch)
2021-08-02 08:11 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (13.17 KB, patch)
2021-08-04 12:35 PDT, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff
Patch for landing (13.03 KB, patch)
2021-08-04 17:30 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (13.03 KB, patch)
2021-08-05 13:00 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2021-07-28 11:30:18 PDT
[Cocoa] Remove support for AVAssetImageGenerator
Comment 1 Jer Noble 2021-07-28 13:39:31 PDT
Created attachment 434458 [details]
Patch
Comment 2 Jer Noble 2021-07-28 13:46:57 PDT
Created attachment 434460 [details]
Patch
Comment 3 Jer Noble 2021-07-28 14:17:09 PDT
Created attachment 434467 [details]
Patch
Comment 4 Eric Carlson 2021-07-28 15:01:43 PDT
Comment on attachment 434467 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434467&action=review

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2387
> +    if ([m_videoOutput respondsToSelector:@selector(requestNotificationOfMediaDataChangeAsSoonAsPossible)])
> +        [m_videoOutput requestNotificationOfMediaDataChangeAsSoonAsPossible];

As discussed, it might be worth logging an error if it doesn't support this selector
Comment 5 Jer Noble 2021-07-28 15:11:31 PDT
Created attachment 434471 [details]
Patch for landing
Comment 6 Jer Noble 2021-07-28 23:18:37 PDT
Created attachment 434498 [details]
Patch for landing
Comment 7 EWS Watchlist 2021-07-28 23:19:19 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 8 Jer Noble 2021-07-28 23:37:59 PDT
Created attachment 434499 [details]
Patch for landing
Comment 9 Jer Noble 2021-07-29 16:31:09 PDT
The mac-AS-debug-wk2 test failure will be fixed by bug #228620.
Comment 10 EWS 2021-07-29 20:04:51 PDT
ChangeLog entry in LayoutTests/imported/w3c/ChangeLog contains OOPS!.
Comment 11 EWS 2021-07-29 20:13:27 PDT
ChangeLog entry in LayoutTests/imported/w3c/ChangeLog contains OOPS!.
Comment 12 Jer Noble 2021-07-29 21:59:17 PDT
Created attachment 434605 [details]
Patch for landing
Comment 13 Jer Noble 2021-07-30 11:45:08 PDT
After running tests on a mac-AS-debug-wk2 and catching some of the timeouts & using the Web Inspector, I'm confident that the test failures are unrelated to my patch. The failures, when caught, appear to be a result of `testRunner.notifyDone()` not causing the test contents to be dumped. In all the results I've caught, the DOM includes `"TEST COMPLETE"`, but WKTR is still waiting for results to be dumped.

I have caught other flaky tests that are stuck in AVPlayerItem -seekToTime:toleranceBefore:toleranceAfter:completionHandler: being stuck without the completionHandler being called. Calling -cancelPendingSeeks through lldb causes the test to "unstick" and run to completion. Also unrelated to this patch.
Comment 14 EWS 2021-07-30 11:49:54 PDT
Committed r280488 (240120@main): <https://commits.webkit.org/240120@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434605 [details].
Comment 15 Radar WebKit Bug Importer 2021-07-30 11:50:34 PDT
<rdar://problem/81336280>
Comment 16 Truitt Savell 2021-07-30 14:41:26 PDT
It looks like the changes in https://trac.webkit.org/changeset/280488/webkit

broke 10 media/modern-media-controls/ tests causing them to time out

tracking in https://bugs.webkit.org/show_bug.cgi?id=228660
Comment 17 WebKit Commit Bot 2021-07-31 00:50:30 PDT
Re-opened since this is blocked by bug 228677
Comment 18 Jer Noble 2021-07-31 18:22:23 PDT
Created attachment 434709 [details]
Patch
Comment 19 Jer Noble 2021-07-31 19:22:38 PDT
Created attachment 434710 [details]
Patch for landing
Comment 20 Jer Noble 2021-07-31 19:43:27 PDT
Created attachment 434711 [details]
Patch for landing
Comment 21 EWS 2021-08-01 13:37:19 PDT
ChangeLog entry in LayoutTests/imported/w3c/ChangeLog contains OOPS!.
Comment 22 Jer Noble 2021-08-02 08:11:27 PDT
Created attachment 434751 [details]
Patch for landing
Comment 23 EWS 2021-08-02 08:39:28 PDT
Committed r280531 (240163@main): <https://commits.webkit.org/240163@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434751 [details].
Comment 24 Ryan Haddad 2021-08-02 13:08:56 PDT
(In reply to EWS from comment #23)
> Committed r280531 (240163@main): <https://commits.webkit.org/240163@main>
It appears that we are seeing modern-media-controls layout test timeouts again:

https://build.webkit.org/results/Apple-BigSur-Release-AppleSilicon-WK2-Tests/r280531%20(2978)/results.html
Comment 25 Ryan Haddad 2021-08-03 18:11:06 PDT
Reverted r280531 and r280589 for reason:

caused

Committed r280624 (240237@main): <https://commits.webkit.org/240237@main>
Comment 26 Jer Noble 2021-08-04 12:35:17 PDT
Created attachment 434926 [details]
Patch
Comment 27 Eric Carlson 2021-08-04 14:42:40 PDT
Comment on attachment 434926 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434926&action=review

> Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:-132
> -        tearDownVideoRendering();

Last changed in 2011!

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2429
>      m_videoOutputDelegate = adoptNS([[WebCoreAVFPullDelegate alloc] init]);
> +    [m_videoOutputDelegate setParent:*this];

Nit: since you pass a reference, and so never need to clear the parent, you could add an initializer and pass it there.

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2513
> +    updateLastImage(UpdateType::UpdateSynchronously);

Is it OK to ignore the old warning about not doing this synchronously?

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2566
> +    bool satisfied = timeoutTimer.isActive();

Isn't there is a (very) small chance that this will be wrong because you check the timer after the logging above?

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2568
> +        INFO_LOG(LOGIDENTIFIER, "timed out");

Why not log this as an error so it always shows up in logs?
Comment 28 Jer Noble 2021-08-04 16:46:14 PDT
(In reply to Eric Carlson from comment #27)
> Comment on attachment 434926 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=434926&action=review
> 
> > Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:-132
> > -        tearDownVideoRendering();
> 
> Last changed in 2011!

:-D

> > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2429
> >      m_videoOutputDelegate = adoptNS([[WebCoreAVFPullDelegate alloc] init]);
> > +    [m_videoOutputDelegate setParent:*this];
> 
> Nit: since you pass a reference, and so never need to clear the parent, you
> could add an initializer and pass it there.

Good idea. I'll make it the same signature as WebCoreAVFLoaderDelegate.

> > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2513
> > +    updateLastImage(UpdateType::UpdateSynchronously);
> 
> Is it OK to ignore the old warning about not doing this synchronously?

Lol yes. Because later on in updateLastImage(), it used to call into AVAssetImageGenerator, which is super synchronous.

Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2566
> > +    bool satisfied = timeoutTimer.isActive();
> 
> Isn't there is a (very) small chance that this will be wrong because you
> check the timer after the logging above?

I don't think so? The timer's time might be up, but it hasn't fired yet (because it has to run on the main run-loop).

> > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2568
> > +        INFO_LOG(LOGIDENTIFIER, "timed out");
> 
> Why not log this as an error so it always shows up in logs?

Will do.
Comment 29 Jer Noble 2021-08-04 17:30:50 PDT
Created attachment 434955 [details]
Patch for landing
Comment 30 Jer Noble 2021-08-05 13:00:55 PDT
Created attachment 435016 [details]
Patch for landing
Comment 31 Jer Noble 2021-08-05 14:16:21 PDT
<rdar://81542859>
Comment 32 Jer Noble 2021-08-06 07:46:46 PDT
Looks like the EWS failures are due to https://trac.webkit.org/changeset/280702/webkit. Landing.
Comment 33 EWS 2021-08-06 08:09:27 PDT
Committed r280723 (240314@main): <https://commits.webkit.org/240314@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435016 [details].