mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
gtk4: Make winegl code compilable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1255>
This commit is contained in:
parent
d3d78846dc
commit
e58abf0705
1 changed files with 12 additions and 11 deletions
|
@ -894,7 +894,7 @@ impl PaintableSink {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let gst_gl_display =
|
let gst_display =
|
||||||
if let Some(display) = gst_gl::GLDisplay::with_type(gst_gl::GLDisplayType::WIN32) {
|
if let Some(display) = gst_gl::GLDisplay::with_type(gst_gl::GLDisplayType::WIN32) {
|
||||||
display
|
display
|
||||||
} else {
|
} else {
|
||||||
|
@ -902,10 +902,10 @@ impl PaintableSink {
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
|
||||||
gst_gl_display.filter_gl_api(gl_api);
|
gst_display.filter_gl_api(gl_api);
|
||||||
|
|
||||||
let wrapped_context =
|
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 {
|
let wrapped_context = match wrapped_context {
|
||||||
None => {
|
None => {
|
||||||
gst::error!(CAT, imp: self, "Failed to create wrapped GL context");
|
gst::error!(CAT, imp: self, "Failed to create wrapped GL context");
|
||||||
|
@ -914,7 +914,7 @@ impl PaintableSink {
|
||||||
Some(wrapped_context) => wrapped_context,
|
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();
|
let egl_display = d.egl_display().unwrap().as_ptr();
|
||||||
|
|
||||||
// TODO: On the binary distribution of GStreamer for Windows, this symbol is not there
|
// 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);
|
let gst_display =
|
||||||
if gst_gl_display.is_null() {
|
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");
|
gst::error!(CAT, imp: self, "Failed to get EGL display");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let gst_gl_display: gst_gl::GLDisplay =
|
let gst_display =
|
||||||
from_glib_full(gst_gl_display as *mut gst_gl::ffi::GstGLDisplay);
|
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 =
|
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 {
|
let wrapped_context = match wrapped_context {
|
||||||
None => {
|
None => {
|
||||||
|
@ -968,7 +969,7 @@ impl PaintableSink {
|
||||||
Some(wrapped_context) => wrapped_context,
|
Some(wrapped_context) => wrapped_context,
|
||||||
};
|
};
|
||||||
|
|
||||||
Some((gst_gl_display, wrapped_context))
|
Some((gst_display, wrapped_context))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue