Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2019-07-02 13:51:11 +0300
committerSebastian Dröge <sebastian@centricular.com>2019-07-05 17:05:47 +0300
commit4d9704cc144c376c20b3fbf03e262e15d0572658 (patch)
tree25e77edddea9c15a649679c6c0104e5e17a32fb9
parent456db123f2baf1836f59d7d577b09f9c864b6b91 (diff)
togglerecord: Register plugin as a static plugin in the example
Instead of doing complicated things with the plugin path and the registry.
-rw-r--r--gst-plugin-togglerecord/examples/gtk_recording.rs26
1 files changed, 3 insertions, 23 deletions
diff --git a/gst-plugin-togglerecord/examples/gtk_recording.rs b/gst-plugin-togglerecord/examples/gtk_recording.rs
index 2b00c8838..2f1ef403b 100644
--- a/gst-plugin-togglerecord/examples/gtk_recording.rs
+++ b/gst-plugin-togglerecord/examples/gtk_recording.rs
@@ -23,9 +23,10 @@ use gio::prelude::*;
extern crate gstreamer as gst;
use gst::prelude::*;
+extern crate gsttogglerecord;
+
extern crate gtk;
use gtk::prelude::*;
-
use std::cell::RefCell;
use std::env;
@@ -346,28 +347,7 @@ fn main() {
gst::init().unwrap();
gtk::init().unwrap();
- #[cfg(debug_assertions)]
- {
- 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);
- }
+ gsttogglerecord::plugin_register_static().expect("Failed to register togglerecord plugin");
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE).unwrap();