diff options
author | Jayson Reis <santosdosreis@gmail.com> | 2023-06-22 19:48:46 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-06-23 11:16:40 +0300 |
commit | e58abf070507a3cb0471c30ae29aaa199aa8d022 (patch) | |
tree | 148a31f3265ec37b8af7cb1d72f0197b034588d0 /video | |
parent | d3d78846dc4fca831e98e14b7a37f046a72d016a (diff) |
gtk4: Make winegl code compilable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1255>
Diffstat (limited to 'video')
-rw-r--r-- | video/gtk4/src/sink/imp.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/video/gtk4/src/sink/imp.rs b/video/gtk4/src/sink/imp.rs index 60f0591d5..4d66d4a47 100644 --- a/video/gtk4/src/sink/imp.rs +++ b/video/gtk4/src/sink/imp.rs @@ -894,7 +894,7 @@ impl PaintableSink { } unsafe { - let gst_gl_display = + let gst_display = if let Some(display) = gst_gl::GLDisplay::with_type(gst_gl::GLDisplayType::WIN32) { display } else { @@ -902,10 +902,10 @@ impl PaintableSink { return None; }; - gst_gl_display.filter_gl_api(gl_api); + gst_display.filter_gl_api(gl_api); let wrapped_context = - gst_gl::GLContext::new_wrapped(&gst_gl_display, gl_ctx, platform, gl_api); + gst_gl::GLContext::new_wrapped(&gst_display, gl_ctx, platform, gl_api); let wrapped_context = match wrapped_context { None => { gst::error!(CAT, imp: self, "Failed to create wrapped GL context"); @@ -914,7 +914,7 @@ impl PaintableSink { Some(wrapped_context) => wrapped_context, }; - Some((gst_gl_display, wrapped_context)) + Some((gst_display, wrapped_context)) } } @@ -947,18 +947,19 @@ impl PaintableSink { let egl_display = d.egl_display().unwrap().as_ptr(); // TODO: On the binary distribution of GStreamer for Windows, this symbol is not there - let gst_gl_display = gst_gl_egl::ffi::gst_gl_display_egl_from_gl_display(egl_display); - if gst_gl_display.is_null() { + let gst_display = + gst_gl_egl::ffi::gst_gl_display_egl_from_gl_display(egl_display.cast()); + if gst_display.is_null() { gst::error!(CAT, imp: self, "Failed to get EGL display"); return None; } - let gst_gl_display: gst_gl::GLDisplay = - from_glib_full(gst_gl_display as *mut gst_gl::ffi::GstGLDisplay); + let gst_display = + gst_gl::GLDisplay::from_glib_full(gst_display as *mut gst_gl::ffi::GstGLDisplay); - gst_gl_display.filter_gl_api(gl_api); + gst_display.filter_gl_api(gl_api); let wrapped_context = - gst_gl::GLContext::new_wrapped(&gst_gl_display, gl_ctx, platform, gl_api); + gst_gl::GLContext::new_wrapped(&gst_display, gl_ctx, platform, gl_api); let wrapped_context = match wrapped_context { None => { @@ -968,7 +969,7 @@ impl PaintableSink { Some(wrapped_context) => wrapped_context, }; - Some((gst_gl_display, wrapped_context)) + Some((gst_display, wrapped_context)) } } } |