mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-02 14:12:20 +00:00
threadshare: register plugin static in integration test
After a `cargo clean` the shared library is not yet present if the test is started with `cargo test`.
This commit is contained in:
parent
73a7be5ef5
commit
4fb18382c2
6 changed files with 16 additions and 116 deletions
|
@ -24,7 +24,7 @@ net2 = "0.2"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "gstthreadshare"
|
name = "gstthreadshare"
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
|
|
|
@ -23,35 +23,15 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
|
extern crate gstthreadshare;
|
||||||
|
|
||||||
fn init() {
|
fn init() {
|
||||||
use std::sync::{Once, ONCE_INIT};
|
use std::sync::{Once, ONCE_INIT};
|
||||||
static INIT: Once = ONCE_INIT;
|
static INIT: Once = ONCE_INIT;
|
||||||
|
|
||||||
INIT.call_once(|| {
|
INIT.call_once(|| {
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
|
gstthreadshare::plugin_register_static();
|
||||||
#[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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,35 +23,15 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
|
extern crate gstthreadshare;
|
||||||
|
|
||||||
fn init() {
|
fn init() {
|
||||||
use std::sync::{Once, ONCE_INIT};
|
use std::sync::{Once, ONCE_INIT};
|
||||||
static INIT: Once = ONCE_INIT;
|
static INIT: Once = ONCE_INIT;
|
||||||
|
|
||||||
INIT.call_once(|| {
|
INIT.call_once(|| {
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
|
gstthreadshare::plugin_register_static();
|
||||||
#[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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,35 +23,15 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
|
extern crate gstthreadshare;
|
||||||
|
|
||||||
fn init() {
|
fn init() {
|
||||||
use std::sync::{Once, ONCE_INIT};
|
use std::sync::{Once, ONCE_INIT};
|
||||||
static INIT: Once = ONCE_INIT;
|
static INIT: Once = ONCE_INIT;
|
||||||
|
|
||||||
INIT.call_once(|| {
|
INIT.call_once(|| {
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
|
gstthreadshare::plugin_register_static();
|
||||||
#[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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,35 +26,15 @@ use std::io::Write;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::{thread, time};
|
use std::{thread, time};
|
||||||
|
|
||||||
|
extern crate gstthreadshare;
|
||||||
|
|
||||||
fn init() {
|
fn init() {
|
||||||
use std::sync::{Once, ONCE_INIT};
|
use std::sync::{Once, ONCE_INIT};
|
||||||
static INIT: Once = ONCE_INIT;
|
static INIT: Once = ONCE_INIT;
|
||||||
|
|
||||||
INIT.call_once(|| {
|
INIT.call_once(|| {
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
|
gstthreadshare::plugin_register_static();
|
||||||
#[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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,35 +24,15 @@ use gst::prelude::*;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
extern crate gstthreadshare;
|
||||||
|
|
||||||
fn init() {
|
fn init() {
|
||||||
use std::sync::{Once, ONCE_INIT};
|
use std::sync::{Once, ONCE_INIT};
|
||||||
static INIT: Once = ONCE_INIT;
|
static INIT: Once = ONCE_INIT;
|
||||||
|
|
||||||
INIT.call_once(|| {
|
INIT.call_once(|| {
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
|
gstthreadshare::plugin_register_static();
|
||||||
#[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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue