mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-24 18:08:15 +00:00
togglerecord: Register plugin as a static plugin in the example
Instead of doing complicated things with the plugin path and the registry.
This commit is contained in:
parent
456db123f2
commit
4d9704cc14
1 changed files with 3 additions and 23 deletions
|
@ -23,9 +23,10 @@ use gio::prelude::*;
|
||||||
extern crate gstreamer as gst;
|
extern crate gstreamer as gst;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
|
extern crate gsttogglerecord;
|
||||||
|
|
||||||
extern crate gtk;
|
extern crate gtk;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
@ -346,28 +347,7 @@ fn main() {
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
gtk::init().unwrap();
|
gtk::init().unwrap();
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
gsttogglerecord::plugin_register_static().expect("Failed to register togglerecord plugin");
|
||||||
{
|
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
let mut path = Path::new("target/debug");
|
|
||||||
if !path.exists() {
|
|
||||||
path = Path::new("../target/debug");
|
|
||||||
}
|
|
||||||
|
|
||||||
gst::Registry::get().scan_path(path);
|
|
||||||
}
|
|
||||||
#[cfg(not(debug_assertions))]
|
|
||||||
{
|
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
let mut path = Path::new("target/release");
|
|
||||||
if !path.exists() {
|
|
||||||
path = Path::new("../target/release");
|
|
||||||
}
|
|
||||||
|
|
||||||
gst::Registry::get().scan_path(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE).unwrap();
|
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE).unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue