2016-05-13 13:35:48 +00:00
|
|
|
#![crate_type="dylib"]
|
|
|
|
|
2016-05-13 15:02:19 +00:00
|
|
|
extern crate libc;
|
2016-05-14 09:34:50 +00:00
|
|
|
extern crate url;
|
2016-05-14 14:04:53 +00:00
|
|
|
extern crate hyper;
|
2016-05-13 15:02:19 +00:00
|
|
|
|
2016-05-14 11:44:49 +00:00
|
|
|
#[macro_use]
|
|
|
|
pub mod utils;
|
|
|
|
pub mod rssource;
|
2016-05-14 13:31:39 +00:00
|
|
|
pub mod rssink;
|
2016-05-13 13:35:48 +00:00
|
|
|
pub mod rsfilesrc;
|
2016-05-14 14:04:53 +00:00
|
|
|
pub mod rshttpsrc;
|
2016-05-13 15:07:26 +00:00
|
|
|
pub mod rsfilesink;
|
2016-05-14 12:44:40 +00:00
|
|
|
|
|
|
|
use utils::*;
|
|
|
|
use rssource::Source;
|
|
|
|
use rsfilesrc::FileSrc;
|
2016-05-14 14:04:53 +00:00
|
|
|
use rshttpsrc::HttpSrc;
|
2016-05-14 13:31:39 +00:00
|
|
|
use rssink::Sink;
|
|
|
|
use rsfilesink::FileSink;
|
2016-05-14 12:44:40 +00:00
|
|
|
|
|
|
|
use std::os::raw::c_void;
|
2016-05-15 13:15:58 +00:00
|
|
|
use libc::c_char;
|
2016-05-14 12:44:40 +00:00
|
|
|
use std::ffi::CString;
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
fn gst_rs_source_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: extern fn() -> *mut Box<Source>,
|
2016-05-14 14:41:41 +00:00
|
|
|
protocols: *const c_char,
|
|
|
|
push_only: GBoolean) -> GBoolean;
|
2016-05-14 12:44:40 +00:00
|
|
|
}
|
|
|
|
|
2016-05-14 13:31:39 +00:00
|
|
|
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: extern fn() -> *mut Box<Sink>,
|
|
|
|
protocols: *const c_char) -> GBoolean;
|
|
|
|
}
|
|
|
|
|
2016-05-14 12:44:40 +00:00
|
|
|
#[no_mangle]
|
|
|
|
pub extern "C" fn sources_register(plugin: *const c_void) -> GBoolean {
|
|
|
|
|
|
|
|
unsafe {
|
|
|
|
gst_rs_source_register(plugin,
|
|
|
|
CString::new("rsfilesrc").unwrap().as_ptr(),
|
|
|
|
CString::new("File Source").unwrap().as_ptr(),
|
|
|
|
CString::new("Reads local files").unwrap().as_ptr(),
|
|
|
|
CString::new("Source/File").unwrap().as_ptr(),
|
|
|
|
CString::new("Sebastian Dröge <sebastian@centricular.com>").unwrap().as_ptr(),
|
|
|
|
256 + 100,
|
|
|
|
FileSrc::new_ptr,
|
2016-05-14 14:41:41 +00:00
|
|
|
CString::new("file").unwrap().as_ptr(),
|
|
|
|
GBoolean::False);
|
2016-05-14 14:04:53 +00:00
|
|
|
|
|
|
|
gst_rs_source_register(plugin,
|
|
|
|
CString::new("rshttpsrc").unwrap().as_ptr(),
|
|
|
|
CString::new("HTTP Source").unwrap().as_ptr(),
|
|
|
|
CString::new("Read HTTP/HTTPS files").unwrap().as_ptr(),
|
|
|
|
CString::new("Source/Network/HTTP").unwrap().as_ptr(),
|
|
|
|
CString::new("Sebastian Dröge <sebastian@centricular.com>").unwrap().as_ptr(),
|
|
|
|
256 + 100,
|
|
|
|
HttpSrc::new_ptr,
|
2016-05-14 14:41:41 +00:00
|
|
|
CString::new("http:https").unwrap().as_ptr(),
|
|
|
|
GBoolean::True);
|
2016-05-14 12:44:40 +00:00
|
|
|
}
|
2016-05-14 14:04:53 +00:00
|
|
|
|
2016-05-14 12:44:40 +00:00
|
|
|
return GBoolean::True;
|
|
|
|
}
|
2016-05-14 13:31:39 +00:00
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
pub extern "C" fn sinks_register(plugin: *const c_void) -> GBoolean {
|
|
|
|
|
|
|
|
unsafe {
|
|
|
|
gst_rs_sink_register(plugin,
|
|
|
|
CString::new("rsfilesink").unwrap().as_ptr(),
|
|
|
|
CString::new("File Sink").unwrap().as_ptr(),
|
|
|
|
CString::new("Writes to local files").unwrap().as_ptr(),
|
|
|
|
CString::new("Sink/File").unwrap().as_ptr(),
|
|
|
|
CString::new("Luis de Bethencourt <luisbg@osg.samsung.com>").unwrap().as_ptr(),
|
|
|
|
256 + 100,
|
|
|
|
FileSink::new_ptr,
|
|
|
|
CString::new("file").unwrap().as_ptr());
|
|
|
|
}
|
|
|
|
return GBoolean::True;
|
|
|
|
}
|