Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setFrameCompletedCallback is only called once, then it crashes #7826

Closed
hannojg opened this issue May 6, 2024 · 1 comment · Fixed by #7856
Closed

setFrameCompletedCallback is only called once, then it crashes #7826

hannojg opened this issue May 6, 2024 · 1 comment · Fixed by #7856
Assignees
Labels
ios Issue/request for iOS only

Comments

@hannojg
Copy link
Contributor

hannojg commented May 6, 2024

Describe the bug

We are trying to render into an AVAssetWriter, for that we need to know when the frame is completed.
We are trying to use swapChain->setFrameCompletedCallback for that purpose.
The frame callback is called once, but after that we get an assertion error:

Assertion failed: (mInvoker && mInvocable), function operator(), file Invocable.h, line 134.

To Reproduce

  1. Set a frame completed callback using the metal backend:
auto swapChain = _engine->createSwapChain(nativeWindow, SwapChain::CONFIG_APPLE_CVPIXELBUFFER);
  swapChain->setFrameCompletedCallback(
                                       nullptr, [](SwapChain* UTILS_NONNULL swapChain) {
                                           // note: we pass a completely empty callback, and it still crashes
                                       });

Expected behavior

The callback gets called continuously while rendering.

Screenshots

Screenshot 2024-05-06 at 13 30 13

Logs
If applicable, copy full logs from your console here. Please do not
use screenshots of logs, copy them as text, use gist or attach an uncompressed file.

Desktop (please complete the following information):

  • OS: iOS
  • GPU: Apple GPU
  • Backend: Metal

Smartphone (please complete the following information):

  • Device: iPhone 13 Pro
  • OS: iOS 17.4

Additional context

n/a

@hannojg
Copy link
Contributor Author

hannojg commented May 6, 2024

cc @mrousavy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios Issue/request for iOS only
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants