mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-10-31 22:58:51 +00:00
gtk4: Update for GLDisplay
object lock requirements
This commit is contained in:
parent
6f26e3bf79
commit
5c2de6aeb6
1 changed files with 14 additions and 10 deletions
|
@ -732,17 +732,20 @@ impl PaintableSink {
|
||||||
"Successfully deactivated GL Context after fill_info"
|
"Successfully deactivated GL Context after fill_info"
|
||||||
);
|
);
|
||||||
|
|
||||||
let gst_context = match display.create_context(Some(app_ctx)) {
|
let display_object_guard = display.object_lock();
|
||||||
Ok(gst_context) => gst_context,
|
let gst_context =
|
||||||
Err(err) => {
|
match gst_gl::GLDisplay::create_context(&display_object_guard, Some(app_ctx)) {
|
||||||
gst::error!(CAT, imp: self, "Could not create GL context: {err}");
|
Ok(gst_context) => gst_context,
|
||||||
*app_ctx_guard = None;
|
Err(err) => {
|
||||||
*display_guard = None;
|
gst::error!(CAT, imp: self, "Could not create GL context: {err}");
|
||||||
return false;
|
drop(display_object_guard);
|
||||||
}
|
*app_ctx_guard = None;
|
||||||
};
|
*display_guard = None;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
match display.add_context(&gst_context) {
|
match gst_gl::GLDisplay::add_context(&display_object_guard, &gst_context) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
let mut gst_ctx_guard = self.gst_context.lock().unwrap();
|
let mut gst_ctx_guard = self.gst_context.lock().unwrap();
|
||||||
gst::info!(CAT, imp: self, "Successfully initialized GL Context");
|
gst::info!(CAT, imp: self, "Successfully initialized GL Context");
|
||||||
|
@ -751,6 +754,7 @@ impl PaintableSink {
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
gst::error!(CAT, imp: self, "Could not add GL context to display");
|
gst::error!(CAT, imp: self, "Could not add GL context to display");
|
||||||
|
drop(display_object_guard);
|
||||||
*app_ctx_guard = None;
|
*app_ctx_guard = None;
|
||||||
*display_guard = None;
|
*display_guard = None;
|
||||||
false
|
false
|
||||||
|
|
Loading…
Reference in a new issue