-
Notifications
You must be signed in to change notification settings - Fork 45
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
cefsrc: fix CefInitialize crashing the second time #90
Conversation
Calling CefInitialize multiple times during a process lifetime is not supported: * https://magpcss.org/ceforum/viewtopic.php?f=6&t=16430 * https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=466 * https://stackoverflow.com/questions/73172139/cef-can-only-be-initialized-once-per-process-this-is-a-limitation-of-the-underl Prior to #83 we used to have a ShutdownEnforcer class, but as it was causing issues on OSX we will simply no longer shut down CEF at all. We can revisit if needed, but this is preferable to crashing. See #88 (comment) and below
cc @aiden-jeffrey :) |
Moving comment from other PR: Multiple pipelines just aren't really supported the way this element is currently written. If you run two cefsrc elements at the same time (without calling CefShutdown), Initialize never gets acalled, which means that the second cefsrc just has the properties of the first. |
To be clearer - OnBeforeCommandLineProcessing doesn't get called - which is what maps many (or all, not checked) of the gst properties into cef land. |
Oh, |
I'm happy to take that PR if you need. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM from my perspective and specific issue.
That'd be nice yes, by the way the idea would be to simply deprecate the properties, so if they're set and the environment variable is not the property value should still be used :) |
@MathieuDuponchelle Some lingering questions now that I've caught up on this:
If the app's marked as "to be shut down", then the element will not respond to the second pipeline, which leads me to item (2) above. |
Just noticing now, but when you have multiple pipelines, it looks like the first frame on subsequent runs has some data left over in the buffer from the previous instance. |
|
@aiden-jeffrey Hi, one question. In which operating system are you experiencing the crash? I've looked in the comments across the PRs but can't find the specifics on how to reproduce the issue you've been facing. |
Ubuntu 24.04. |
@MathieuDuponchelle All good. Maybe we should report these upstream (Google), it's clear that the engine as-is does not have a clean lifecycle. |
It's part of CEF's architecture that just one https://magpcss.org/ceforum/viewtopic.php?t=14648 I think the only way to support multiple CEF instances would be by re-writing |
Realistically, this would be up to the application that needs multiple instances to spawn one process per cefsrc and use some ipc mechanism to bring their output into a common pipeline if needed, I don't think we want to take on that complexity in |
Calling CefInitialize multiple times during a process lifetime is not supported:
Prior to #83 we used to have a ShutdownEnforcer class, but as it was causing issues on OSX we will simply no longer shut down CEF at all.
We can revisit if needed, but this is preferable to crashing.
See #88 (comment) and below