Comments (7)
Hm, I see, I'm afraid I don't have too many pointers here but I'll happily review and merge something if you find a solution, just please bear in mind that prior to the patch you mentioned it was not possible to run multiple cefsrc instances concurrently in the same process, and we should try not to regress on that :)
from gstcefsrc.
Test case:
use gst::prelude::*;
use gstreamer as gst;
use sysinfo::{ProcessExt, System, SystemExt};
fn create_pipeline() -> gst::Pipeline {
let pipeline = gst::Pipeline::new(None);
let src = gst::ElementFactory::make("cefsrc", None).unwrap();
src.set_property(
"url",
&"https://webkit.org/blog-files/3d-transforms/poster-circle.html",
);
src.set_property("num-buffers", &100);
let convert = gst::ElementFactory::make("videoconvert", None).unwrap();
let queue = gst::ElementFactory::make("queue", None).unwrap();
let sink = gst::ElementFactory::make("fakevideosink", None).unwrap();
pipeline.add_many(&[&src, &convert, &queue, &sink]).unwrap();
gst::Element::link_many(&[&src, &convert, &queue, &sink]).unwrap();
pipeline.set_state(gst::State::Playing).unwrap();
pipeline
}
fn run() {
let mut sys = System::new_all();
for i in 0..2 {
println!("Creating pipeline #{}", i);
let pipeline = create_pipeline();
let bus = pipeline.bus().unwrap();
for msg in bus.iter_timed(gst::ClockTime::NONE) {
if let gst::MessageView::Eos(..) = msg.view() {
break;
}
}
bus.unset_sync_handler();
println!("Destroying pipeline");
pipeline.set_state(gst::State::Null).unwrap();
drop(pipeline);
sys.refresh_all();
let mut total = 0;
for (pid, process) in sys.processes() {
let name = process.name();
if name.starts_with("gstcefsub") {
println!("[{}] {} {:?}", pid, &name, process.disk_usage());
total += 1;
}
}
println!("Total CEF processes: {}", total);
}
}
fn main() {
gst::init().unwrap();
run();
unsafe {
gstreamer::deinit();
}
}
from gstcefsrc.
I wonder about reverting e2da7ea and spinning a GMainLoop in a new thread, tied to the src element.
from gstcefsrc.
I get your point, but I'm afraid you can't simply revert that commit, prior to it the situation was really not optimal, and you could only really have one cefsrc per process, which is arguably worse than failure to clean things up :P Still as mentioned here: e2da7ea#diff-b511dd6555eaa8cc62167e0332cbbda8f626ad7900fa3a9b092292a6c07e1ac5R326 mentions we could refine the new approach to stop and restart the UI thread as needed, I would suggest digging in that direction :) Did you find out what those 4 other processes are, and what CEF calls would get us rid of them? :)
from gstcefsrc.
we could refine the new approach to stop and restart the UI thread as needed, I would suggest digging in that direction :)
I tried that already kindof, but then the second time CefInitialize()
is called, the process crashes deep in the chromium...
Did you find out what those 4 other processes are, and what CEF calls would get us rid of them? :)
Not yet... only hint so far that I've found is that people just kill those processess using usual OS syscalls...
from gstcefsrc.
Crashes deep into chromium I'm afraid I will be little help with, however I'm curious, what happens if you only call CefQuitMessageLoop()
(and not CefShutdown
, which I believe is the pendant to CefInitialize
)?
from gstcefsrc.
Yes I tried moving the UI thread to element scope, not calling CefShutdown
either, but then on second run the MakeBrowser
task is not dispatched to the new UI thread... I suspect some global state in CEF is left dangling after the first UI thread was stopped and that messes up everything on subsequent runs...
from gstcefsrc.
Related Issues (20)
- Pipeline hangs (Windows) HOT 11
- Wayland Support HOT 1
- License HOT 3
- Sandbox HOT 6
- registering JS Callbacks using RenderProcessHandler::OnContextCreated() HOT 1
- Mixing audio and video with `matroskamux` causing deadlocks HOT 40
- Rare negotiation errors are happening between cefsrc and cefdemux HOT 3
- Not compiling on macOS Ventura on MacBook M1
- Broken Linux x64 build HOT 2
- Deadlock when mixing Audio and Video HOT 6
- trying to build for jetson nano HOT 21
- Cef Segmentation fault HOT 5
- Bad audio meta HOT 10
- [Q] what is the purpose of the audiotestsrc ? HOT 4
- cefsrc in headless environment using GPU HOT 8
- No video output with `gtk4paintablesink` and `clappersink` HOT 4
- Plugin files blacklisted but plugin still works HOT 2
- Inconsistant caps
- Ideas on making src element only generate frames when a fresh buffer is created HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gstcefsrc.