mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-24 19:10:29 +00:00
Move some extern C functions into the place where they're used
This commit is contained in:
parent
742515aac1
commit
b47d7df776
1 changed files with 28 additions and 27 deletions
51
src/lib.rs
51
src/lib.rs
|
@ -41,7 +41,18 @@ use std::os::raw::c_void;
|
|||
use libc::c_char;
|
||||
use std::ffi::CString;
|
||||
|
||||
extern "C" {
|
||||
unsafe fn source_register(plugin: *const c_void,
|
||||
name: &str,
|
||||
long_name: &str,
|
||||
description: &str,
|
||||
classification: &str,
|
||||
author: &str,
|
||||
rank: i32,
|
||||
create_instance: *const c_void,
|
||||
protocols: &str,
|
||||
push_only: bool) {
|
||||
|
||||
extern "C" {
|
||||
fn gst_rs_source_register(plugin: *const c_void,
|
||||
name: *const c_char,
|
||||
long_name: *const c_char,
|
||||
|
@ -53,31 +64,8 @@ extern "C" {
|
|||
protocols: *const c_char,
|
||||
push_only: GBoolean)
|
||||
-> GBoolean;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
fn gst_rs_sink_register(plugin: *const c_void,
|
||||
name: *const c_char,
|
||||
long_name: *const c_char,
|
||||
description: *const c_char,
|
||||
classification: *const c_char,
|
||||
author: *const c_char,
|
||||
rank: i32,
|
||||
create_instance: *const c_void,
|
||||
protocols: *const c_char)
|
||||
-> GBoolean;
|
||||
}
|
||||
|
||||
unsafe fn source_register(plugin: *const c_void,
|
||||
name: &str,
|
||||
long_name: &str,
|
||||
description: &str,
|
||||
classification: &str,
|
||||
author: &str,
|
||||
rank: i32,
|
||||
create_instance: *const c_void,
|
||||
protocols: &str,
|
||||
push_only: bool) {
|
||||
let cname = CString::new(name).unwrap();
|
||||
let clong_name = CString::new(long_name).unwrap();
|
||||
let cdescription = CString::new(description).unwrap();
|
||||
|
@ -134,6 +122,19 @@ unsafe fn sink_register(plugin: *const c_void,
|
|||
rank: i32,
|
||||
create_instance: *const c_void,
|
||||
protocols: &str) {
|
||||
extern "C" {
|
||||
fn gst_rs_sink_register(plugin: *const c_void,
|
||||
name: *const c_char,
|
||||
long_name: *const c_char,
|
||||
description: *const c_char,
|
||||
classification: *const c_char,
|
||||
author: *const c_char,
|
||||
rank: i32,
|
||||
create_instance: *const c_void,
|
||||
protocols: *const c_char)
|
||||
-> GBoolean;
|
||||
}
|
||||
|
||||
let cname = CString::new(name).unwrap();
|
||||
let clong_name = CString::new(long_name).unwrap();
|
||||
let cdescription = CString::new(description).unwrap();
|
||||
|
|
Loading…
Reference in a new issue