mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-03 05:49:31 +00:00
628 lines
18 KiB
Rust
628 lines
18 KiB
Rust
// Copyright (C) 2016-2017 Sebastian Dröge <sebastian@centricular.com>
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
// option. This file may not be copied, modified, or distributed
|
|
// except according to those terms.
|
|
|
|
use libc::c_char;
|
|
use std::ffi::{CStr, CString};
|
|
use std::ptr;
|
|
use std::mem;
|
|
use std::u64;
|
|
|
|
use std::panic::{self, AssertUnwindSafe};
|
|
|
|
use std::sync::Mutex;
|
|
use std::sync::atomic::{AtomicBool, Ordering};
|
|
|
|
use url::Url;
|
|
|
|
use slog::Logger;
|
|
|
|
use plugin::Plugin;
|
|
use utils::*;
|
|
use error::*;
|
|
use buffer::*;
|
|
use miniobject::*;
|
|
use log::*;
|
|
use caps::*;
|
|
|
|
use glib_ffi;
|
|
use gobject_ffi;
|
|
use gst_ffi;
|
|
use gst_base_ffi;
|
|
|
|
#[derive(Debug)]
|
|
pub enum SourceError {
|
|
Failure,
|
|
OpenFailed,
|
|
NotFound,
|
|
ReadFailed,
|
|
SeekFailed,
|
|
}
|
|
|
|
impl ToGError for SourceError {
|
|
fn to_gerror(&self) -> (u32, i32) {
|
|
match *self {
|
|
SourceError::Failure => (gst_library_error_domain(), 1),
|
|
SourceError::OpenFailed => (gst_resource_error_domain(), 5),
|
|
SourceError::NotFound => (gst_resource_error_domain(), 3),
|
|
SourceError::ReadFailed => (gst_resource_error_domain(), 9),
|
|
SourceError::SeekFailed => (gst_resource_error_domain(), 11),
|
|
}
|
|
}
|
|
}
|
|
|
|
pub struct SourceWrapper {
|
|
raw: *mut gst_ffi::GstElement,
|
|
logger: Logger,
|
|
uri: Mutex<(Option<Url>, bool)>,
|
|
uri_validator: Box<UriValidator>,
|
|
source: Mutex<Box<Source>>,
|
|
panicked: AtomicBool,
|
|
}
|
|
|
|
pub trait Source {
|
|
fn uri_validator(&self) -> Box<UriValidator>;
|
|
|
|
fn is_seekable(&self) -> bool;
|
|
fn get_size(&self) -> Option<u64>;
|
|
|
|
fn start(&mut self, uri: Url) -> Result<(), ErrorMessage>;
|
|
fn stop(&mut self) -> Result<(), ErrorMessage>;
|
|
fn fill(&mut self, offset: u64, length: u32, buffer: &mut Buffer) -> Result<(), FlowError>;
|
|
fn seek(&mut self, start: u64, stop: Option<u64>) -> Result<(), ErrorMessage>;
|
|
}
|
|
|
|
impl SourceWrapper {
|
|
fn new(raw: *mut gst_ffi::GstElement, source: Box<Source>) -> SourceWrapper {
|
|
SourceWrapper {
|
|
raw: raw,
|
|
logger: Logger::root(
|
|
GstDebugDrain::new(
|
|
Some(unsafe { &Element::new(raw) }),
|
|
"rssrc",
|
|
0,
|
|
"Rust source base class",
|
|
),
|
|
o!(),
|
|
),
|
|
uri: Mutex::new((None, false)),
|
|
uri_validator: source.uri_validator(),
|
|
source: Mutex::new(source),
|
|
panicked: AtomicBool::new(false),
|
|
}
|
|
}
|
|
|
|
fn set_uri(&self, uri_str: Option<&str>) -> Result<(), UriError> {
|
|
let uri_storage = &mut self.uri.lock().unwrap();
|
|
|
|
debug!(self.logger, "Setting URI {:?}", uri_str);
|
|
|
|
if uri_storage.1 {
|
|
return Err(UriError::new(
|
|
UriErrorKind::BadState,
|
|
Some("Already started".to_string()),
|
|
));
|
|
}
|
|
|
|
uri_storage.0 = None;
|
|
|
|
if let Some(uri_str) = uri_str {
|
|
match Url::parse(uri_str) {
|
|
Ok(uri) => {
|
|
try!((self.uri_validator)(&uri));
|
|
uri_storage.0 = Some(uri);
|
|
Ok(())
|
|
}
|
|
Err(err) => Err(UriError::new(
|
|
UriErrorKind::BadUri,
|
|
Some(format!("Failed to parse URI '{}': {}", uri_str, err)),
|
|
)),
|
|
}
|
|
} else {
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
fn get_uri(&self) -> Option<String> {
|
|
let uri_storage = &self.uri.lock().unwrap();
|
|
uri_storage.0.as_ref().map(|uri| String::from(uri.as_str()))
|
|
}
|
|
|
|
fn is_seekable(&self) -> bool {
|
|
let source = &self.source.lock().unwrap();
|
|
source.is_seekable()
|
|
}
|
|
|
|
fn get_size(&self) -> u64 {
|
|
let source = &self.source.lock().unwrap();
|
|
source.get_size().unwrap_or(u64::MAX)
|
|
}
|
|
|
|
fn start(&self) -> bool {
|
|
debug!(self.logger, "Starting");
|
|
|
|
// Don't keep the URI locked while we call start later
|
|
let uri = match *self.uri.lock().unwrap() {
|
|
(Some(ref uri), ref mut started) => {
|
|
*started = true;
|
|
uri.clone()
|
|
}
|
|
(None, _) => {
|
|
error!(self.logger, "No URI given");
|
|
self.post_message(&error_msg!(SourceError::OpenFailed, ["No URI given"]));
|
|
return false;
|
|
}
|
|
};
|
|
|
|
let source = &mut self.source.lock().unwrap();
|
|
match source.start(uri) {
|
|
Ok(..) => {
|
|
trace!(self.logger, "Started successfully");
|
|
true
|
|
}
|
|
Err(ref msg) => {
|
|
error!(self.logger, "Failed to start: {:?}", msg);
|
|
|
|
self.uri.lock().unwrap().1 = false;
|
|
self.post_message(msg);
|
|
false
|
|
}
|
|
}
|
|
}
|
|
|
|
fn stop(&self) -> bool {
|
|
let source = &mut self.source.lock().unwrap();
|
|
|
|
debug!(self.logger, "Stopping");
|
|
|
|
match source.stop() {
|
|
Ok(..) => {
|
|
trace!(self.logger, "Stopped successfully");
|
|
self.uri.lock().unwrap().1 = false;
|
|
true
|
|
}
|
|
Err(ref msg) => {
|
|
error!(self.logger, "Failed to stop: {:?}", msg);
|
|
|
|
self.post_message(msg);
|
|
false
|
|
}
|
|
}
|
|
}
|
|
|
|
fn fill(&self, offset: u64, length: u32, buffer: &mut Buffer) -> gst_ffi::GstFlowReturn {
|
|
let source = &mut self.source.lock().unwrap();
|
|
|
|
trace!(
|
|
self.logger,
|
|
"Filling buffer {:?} with offset {} and length {}",
|
|
buffer,
|
|
offset,
|
|
length
|
|
);
|
|
|
|
match source.fill(offset, length, buffer) {
|
|
Ok(()) => gst_ffi::GST_FLOW_OK,
|
|
Err(flow_error) => {
|
|
error!(self.logger, "Failed to fill: {:?}", flow_error);
|
|
match flow_error {
|
|
FlowError::NotNegotiated(ref msg) | FlowError::Error(ref msg) => {
|
|
self.post_message(msg)
|
|
}
|
|
_ => (),
|
|
}
|
|
flow_error.to_native()
|
|
}
|
|
}
|
|
}
|
|
|
|
fn seek(&self, start: u64, stop: Option<u64>) -> bool {
|
|
let source = &mut self.source.lock().unwrap();
|
|
|
|
debug!(self.logger, "Seeking to {:?}-{:?}", start, stop);
|
|
|
|
match source.seek(start, stop) {
|
|
Ok(..) => true,
|
|
Err(ref msg) => {
|
|
error!(self.logger, "Failed to seek {:?}", msg);
|
|
self.post_message(msg);
|
|
false
|
|
}
|
|
}
|
|
}
|
|
|
|
fn post_message(&self, msg: &ErrorMessage) {
|
|
unsafe {
|
|
msg.post(self.raw);
|
|
}
|
|
}
|
|
}
|
|
|
|
unsafe fn source_set_uri(
|
|
ptr: *const RsSrc,
|
|
uri_ptr: *const c_char,
|
|
cerr: *mut *mut glib_ffi::GError,
|
|
) -> glib_ffi::gboolean {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
|
|
panic_to_error!(wrap, glib_ffi::GFALSE, {
|
|
let uri_str = if uri_ptr.is_null() {
|
|
None
|
|
} else {
|
|
Some(CStr::from_ptr(uri_ptr).to_str().unwrap())
|
|
};
|
|
|
|
match wrap.set_uri(uri_str) {
|
|
Err(err) => {
|
|
error!(wrap.logger, "Failed to set URI {:?}", err);
|
|
err.into_gerror(cerr);
|
|
glib_ffi::GFALSE
|
|
}
|
|
Ok(_) => glib_ffi::GTRUE,
|
|
}
|
|
})
|
|
}
|
|
|
|
unsafe fn source_get_uri(ptr: *const RsSrc) -> *mut c_char {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
|
|
panic_to_error!(wrap, ptr::null_mut(), {
|
|
match wrap.get_uri() {
|
|
Some(uri_str) => glib_ffi::g_strndup(uri_str.as_ptr() as *const c_char, uri_str.len()),
|
|
None => ptr::null_mut(),
|
|
}
|
|
})
|
|
}
|
|
|
|
unsafe extern "C" fn source_is_seekable(ptr: *mut gst_base_ffi::GstBaseSrc) -> glib_ffi::gboolean {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
|
|
panic_to_error!(wrap, glib_ffi::GFALSE, {
|
|
if wrap.is_seekable() {
|
|
glib_ffi::GTRUE
|
|
} else {
|
|
glib_ffi::GFALSE
|
|
}
|
|
})
|
|
}
|
|
|
|
unsafe extern "C" fn source_get_size(
|
|
ptr: *mut gst_base_ffi::GstBaseSrc,
|
|
size: *mut u64,
|
|
) -> glib_ffi::gboolean {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
|
|
panic_to_error!(wrap, glib_ffi::GFALSE, {
|
|
*size = wrap.get_size();
|
|
glib_ffi::GTRUE
|
|
})
|
|
}
|
|
|
|
unsafe extern "C" fn source_start(ptr: *mut gst_base_ffi::GstBaseSrc) -> glib_ffi::gboolean {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
|
|
panic_to_error!(wrap, glib_ffi::GFALSE, {
|
|
if wrap.start() {
|
|
glib_ffi::GTRUE
|
|
} else {
|
|
glib_ffi::GFALSE
|
|
}
|
|
})
|
|
}
|
|
|
|
unsafe extern "C" fn source_stop(ptr: *mut gst_base_ffi::GstBaseSrc) -> glib_ffi::gboolean {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
|
|
panic_to_error!(wrap, glib_ffi::GTRUE, {
|
|
if wrap.stop() {
|
|
glib_ffi::GTRUE
|
|
} else {
|
|
glib_ffi::GFALSE
|
|
}
|
|
})
|
|
}
|
|
|
|
unsafe extern "C" fn source_fill(
|
|
ptr: *mut gst_base_ffi::GstBaseSrc,
|
|
offset: u64,
|
|
length: u32,
|
|
buffer: *mut gst_ffi::GstBuffer,
|
|
) -> gst_ffi::GstFlowReturn {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
let buffer: &mut Buffer = <Buffer as MiniObject>::from_mut_ptr(buffer);
|
|
|
|
panic_to_error!(wrap, gst_ffi::GST_FLOW_ERROR, {
|
|
wrap.fill(offset, length, buffer)
|
|
})
|
|
}
|
|
|
|
unsafe extern "C" fn source_seek(
|
|
ptr: *mut gst_base_ffi::GstBaseSrc,
|
|
segment: *mut gst_ffi::GstSegment,
|
|
) -> glib_ffi::gboolean {
|
|
let src = &*(ptr as *const RsSrc);
|
|
let wrap: &SourceWrapper = &*src.wrap;
|
|
|
|
let start = (*segment).start;
|
|
let stop = (*segment).stop;
|
|
|
|
panic_to_error!(wrap, glib_ffi::GFALSE, {
|
|
if wrap.seek(start, if stop == u64::MAX { None } else { Some(stop) }) {
|
|
glib_ffi::GTRUE
|
|
} else {
|
|
glib_ffi::GFALSE
|
|
}
|
|
})
|
|
}
|
|
|
|
pub struct SourceInfo {
|
|
pub name: String,
|
|
pub long_name: String,
|
|
pub description: String,
|
|
pub classification: String,
|
|
pub author: String,
|
|
pub rank: u32,
|
|
pub create_instance: fn(Element) -> Box<Source>,
|
|
pub protocols: Vec<String>,
|
|
pub push_only: bool,
|
|
}
|
|
|
|
#[repr(C)]
|
|
struct RsSrc {
|
|
parent: gst_base_ffi::GstPushSrc,
|
|
wrap: *mut SourceWrapper,
|
|
source_info: *const SourceInfo,
|
|
}
|
|
|
|
#[repr(C)]
|
|
struct RsSrcClass {
|
|
parent_class: gst_base_ffi::GstPushSrcClass,
|
|
source_info: *const SourceInfo,
|
|
protocols: *const Vec<*const c_char>,
|
|
parent_vtable: glib_ffi::gconstpointer,
|
|
}
|
|
|
|
unsafe extern "C" fn source_finalize(obj: *mut gobject_ffi::GObject) {
|
|
let src = &mut *(obj as *mut RsSrc);
|
|
|
|
drop(Box::from_raw(src.wrap));
|
|
|
|
let src_klass = &**(obj as *const *const RsSrcClass);
|
|
let parent_klass = &*(src_klass.parent_vtable as *const gobject_ffi::GObjectClass);
|
|
parent_klass.finalize.map(|f| f(obj));
|
|
}
|
|
|
|
unsafe extern "C" fn source_set_property(
|
|
obj: *mut gobject_ffi::GObject,
|
|
id: u32,
|
|
value: *mut gobject_ffi::GValue,
|
|
_pspec: *mut gobject_ffi::GParamSpec,
|
|
) {
|
|
let src = &*(obj as *const RsSrc);
|
|
|
|
match id {
|
|
1 => {
|
|
let uri_ptr = gobject_ffi::g_value_get_string(value);
|
|
source_set_uri(src, uri_ptr, ptr::null_mut());
|
|
}
|
|
_ => unreachable!(),
|
|
}
|
|
}
|
|
|
|
unsafe extern "C" fn source_get_property(
|
|
obj: *mut gobject_ffi::GObject,
|
|
id: u32,
|
|
value: *mut gobject_ffi::GValue,
|
|
_pspec: *mut gobject_ffi::GParamSpec,
|
|
) {
|
|
let src = &*(obj as *const RsSrc);
|
|
|
|
match id {
|
|
1 => {
|
|
let uri_ptr = source_get_uri(src);
|
|
gobject_ffi::g_value_take_string(value, uri_ptr);
|
|
}
|
|
_ => unreachable!(),
|
|
}
|
|
}
|
|
|
|
unsafe extern "C" fn source_class_init(klass: glib_ffi::gpointer, klass_data: glib_ffi::gpointer) {
|
|
let src_klass = &mut *(klass as *mut RsSrcClass);
|
|
let source_info = &*(klass_data as *const SourceInfo);
|
|
|
|
{
|
|
let gobject_klass = &mut src_klass
|
|
.parent_class
|
|
.parent_class
|
|
.parent_class
|
|
.parent_class
|
|
.parent_class;
|
|
gobject_klass.set_property = Some(source_set_property);
|
|
gobject_klass.get_property = Some(source_get_property);
|
|
gobject_klass.finalize = Some(source_finalize);
|
|
|
|
let name_cstr = CString::new("uri").unwrap();
|
|
let nick_cstr = CString::new("URI").unwrap();
|
|
let blurb_cstr = CString::new("URI to read from").unwrap();
|
|
|
|
gobject_ffi::g_object_class_install_property(
|
|
klass as *mut gobject_ffi::GObjectClass,
|
|
1,
|
|
gobject_ffi::g_param_spec_string(
|
|
name_cstr.as_ptr(),
|
|
nick_cstr.as_ptr(),
|
|
blurb_cstr.as_ptr(),
|
|
ptr::null_mut(),
|
|
gobject_ffi::G_PARAM_READWRITE,
|
|
),
|
|
);
|
|
}
|
|
|
|
{
|
|
let element_klass = &mut src_klass.parent_class.parent_class.parent_class;
|
|
|
|
let longname_cstr = CString::new(source_info.long_name.clone()).unwrap();
|
|
let classification_cstr = CString::new(source_info.description.clone()).unwrap();
|
|
let description_cstr = CString::new(source_info.classification.clone()).unwrap();
|
|
let author_cstr = CString::new(source_info.author.clone()).unwrap();
|
|
|
|
gst_ffi::gst_element_class_set_static_metadata(
|
|
element_klass,
|
|
longname_cstr.into_raw(),
|
|
classification_cstr.into_raw(),
|
|
description_cstr.into_raw(),
|
|
author_cstr.into_raw(),
|
|
);
|
|
|
|
let caps = Caps::new_any();
|
|
let templ_name = CString::new("src").unwrap();
|
|
let pad_template = gst_ffi::gst_pad_template_new(
|
|
templ_name.into_raw(),
|
|
gst_ffi::GST_PAD_SRC,
|
|
gst_ffi::GST_PAD_ALWAYS,
|
|
caps.as_ptr() as *mut gst_ffi::GstCaps,
|
|
);
|
|
gst_ffi::gst_element_class_add_pad_template(element_klass, pad_template);
|
|
}
|
|
|
|
{
|
|
let basesrc_klass = &mut src_klass.parent_class.parent_class;
|
|
basesrc_klass.start = Some(source_start);
|
|
basesrc_klass.stop = Some(source_stop);
|
|
basesrc_klass.is_seekable = Some(source_is_seekable);
|
|
basesrc_klass.get_size = Some(source_get_size);
|
|
basesrc_klass.fill = Some(source_fill);
|
|
basesrc_klass.do_seek = Some(source_seek);
|
|
}
|
|
|
|
src_klass.source_info = source_info;
|
|
let mut protocols = Box::new(Vec::with_capacity(source_info.protocols.len()));
|
|
for p in &source_info.protocols {
|
|
let p_cstr = CString::new(p.clone().into_bytes()).unwrap();
|
|
protocols.push(p_cstr.into_raw() as *const c_char);
|
|
}
|
|
protocols.push(ptr::null());
|
|
src_klass.protocols = Box::into_raw(protocols) as *const Vec<*const c_char>;
|
|
src_klass.parent_vtable = gobject_ffi::g_type_class_peek_parent(klass);
|
|
}
|
|
|
|
unsafe extern "C" fn source_init(
|
|
instance: *mut gobject_ffi::GTypeInstance,
|
|
klass: glib_ffi::gpointer,
|
|
) {
|
|
let src = &mut *(instance as *mut RsSrc);
|
|
let src_klass = &*(klass as *const RsSrcClass);
|
|
let source_info = &*src_klass.source_info;
|
|
|
|
src.source_info = source_info;
|
|
|
|
let wrap = Box::new(SourceWrapper::new(
|
|
&mut src.parent.parent.element,
|
|
(source_info.create_instance)(Element::new(&mut src.parent.parent.element)),
|
|
));
|
|
src.wrap = Box::into_raw(wrap);
|
|
|
|
gst_base_ffi::gst_base_src_set_blocksize(&mut src.parent.parent, 4096);
|
|
}
|
|
|
|
unsafe extern "C" fn source_uri_handler_get_type(_type: glib_ffi::GType) -> gst_ffi::GstURIType {
|
|
gst_ffi::GST_URI_SRC
|
|
}
|
|
|
|
unsafe extern "C" fn source_uri_handler_get_protocols(
|
|
type_: glib_ffi::GType,
|
|
) -> *const *const c_char {
|
|
let klass = gobject_ffi::g_type_class_peek(type_);
|
|
let src_klass = &*(klass as *const RsSrcClass);
|
|
(*src_klass.protocols).as_ptr()
|
|
}
|
|
|
|
unsafe extern "C" fn source_uri_handler_get_uri(
|
|
uri_handler: *mut gst_ffi::GstURIHandler,
|
|
) -> *mut c_char {
|
|
source_get_uri(uri_handler as *const RsSrc)
|
|
}
|
|
|
|
unsafe extern "C" fn source_uri_handler_set_uri(
|
|
uri_handler: *mut gst_ffi::GstURIHandler,
|
|
uri: *const c_char,
|
|
err: *mut *mut glib_ffi::GError,
|
|
) -> glib_ffi::gboolean {
|
|
source_set_uri(uri_handler as *const RsSrc, uri, err)
|
|
}
|
|
|
|
unsafe extern "C" fn source_uri_handler_init(
|
|
iface: glib_ffi::gpointer,
|
|
_iface_data: glib_ffi::gpointer,
|
|
) {
|
|
let uri_handler_iface = &mut *(iface as *mut gst_ffi::GstURIHandlerInterface);
|
|
|
|
uri_handler_iface.get_type = Some(source_uri_handler_get_type);
|
|
uri_handler_iface.get_protocols = Some(source_uri_handler_get_protocols);
|
|
uri_handler_iface.get_uri = Some(source_uri_handler_get_uri);
|
|
uri_handler_iface.set_uri = Some(source_uri_handler_set_uri);
|
|
}
|
|
|
|
pub fn source_register(plugin: &Plugin, source_info: SourceInfo) {
|
|
unsafe {
|
|
let parent_type = if source_info.push_only {
|
|
gst_base_ffi::gst_push_src_get_type()
|
|
} else {
|
|
gst_base_ffi::gst_base_src_get_type()
|
|
};
|
|
let mut type_name = String::from("RsSrc-");
|
|
type_name.push_str(&source_info.name);
|
|
let type_name_cstr = CString::new(type_name.into_bytes()).unwrap();
|
|
|
|
let name_cstr = CString::new(source_info.name.clone().into_bytes()).unwrap();
|
|
let rank = source_info.rank;
|
|
|
|
let source_info = Box::new(source_info);
|
|
let source_info_ptr = Box::into_raw(source_info) as glib_ffi::gpointer;
|
|
|
|
let type_info = gobject_ffi::GTypeInfo {
|
|
class_size: mem::size_of::<RsSrcClass>() as u16,
|
|
base_init: None,
|
|
base_finalize: None,
|
|
class_init: Some(source_class_init),
|
|
class_finalize: None,
|
|
class_data: source_info_ptr,
|
|
instance_size: mem::size_of::<RsSrc>() as u16,
|
|
n_preallocs: 0,
|
|
instance_init: Some(source_init),
|
|
value_table: ptr::null(),
|
|
};
|
|
|
|
let type_ = gobject_ffi::g_type_register_static(
|
|
parent_type,
|
|
type_name_cstr.as_ptr(),
|
|
&type_info,
|
|
gobject_ffi::GTypeFlags::empty(),
|
|
);
|
|
|
|
let iface_info = gobject_ffi::GInterfaceInfo {
|
|
interface_init: Some(source_uri_handler_init),
|
|
interface_finalize: None,
|
|
interface_data: ptr::null_mut(),
|
|
};
|
|
gobject_ffi::g_type_add_interface_static(
|
|
type_,
|
|
gst_ffi::gst_uri_handler_get_type(),
|
|
&iface_info,
|
|
);
|
|
|
|
gst_ffi::gst_element_register(plugin.as_ptr(), name_cstr.as_ptr(), rank, type_);
|
|
}
|
|
}
|