mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
glupload: panic if target OS is not Linux
For now this is the only OS supported by this test.
This commit is contained in:
parent
07ddf2f370
commit
c378167573
1 changed files with 50 additions and 44 deletions
|
@ -29,8 +29,6 @@ use failure::Error;
|
|||
extern crate failure_derive;
|
||||
|
||||
extern crate glutin;
|
||||
use glutin::os::unix::RawHandle;
|
||||
use glutin::os::ContextTraitExt;
|
||||
use glutin::ContextTrait;
|
||||
|
||||
#[path = "../examples-common.rs"]
|
||||
|
@ -350,6 +348,11 @@ impl App {
|
|||
|
||||
let combined_context_ = combined_context.clone();
|
||||
let context = combined_context_.context();
|
||||
|
||||
if cfg!(target_os = "linux") {
|
||||
use glutin::os::unix::RawHandle;
|
||||
use glutin::os::ContextTraitExt;
|
||||
|
||||
let egl_context = match unsafe { context.raw_handle() } {
|
||||
RawHandle::Egl(egl_context) => egl_context as usize,
|
||||
_ => panic!("Invalid platform"),
|
||||
|
@ -401,6 +404,9 @@ impl App {
|
|||
|
||||
gst::BusSyncReply::Pass
|
||||
});
|
||||
} else {
|
||||
panic!("This example only has Linux support");
|
||||
}
|
||||
|
||||
Ok(App {
|
||||
pipeline,
|
||||
|
|
Loading…
Reference in a new issue