2017-02-16 15:52:27 +00:00
|
|
|
// Copyright (C) 2016-2017 Sebastian Dröge <sebastian@centricular.com>
|
2016-05-15 15:54:09 +00:00
|
|
|
//
|
2017-02-16 15:52:27 +00:00
|
|
|
// 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.
|
2016-05-15 15:54:09 +00:00
|
|
|
|
2017-07-31 13:36:35 +00:00
|
|
|
#![crate_type = "cdylib"]
|
2016-05-13 13:35:48 +00:00
|
|
|
|
2018-11-04 18:46:07 +00:00
|
|
|
extern crate glib;
|
2016-12-25 11:16:12 +00:00
|
|
|
#[macro_use]
|
2016-12-23 17:04:32 +00:00
|
|
|
extern crate gst_plugin;
|
2017-10-11 10:32:44 +00:00
|
|
|
extern crate gst_plugin_simple;
|
2017-09-15 08:54:38 +00:00
|
|
|
#[macro_use]
|
2017-09-16 17:35:01 +00:00
|
|
|
extern crate gstreamer as gst;
|
2017-09-15 08:54:38 +00:00
|
|
|
extern crate url;
|
2016-05-13 15:02:19 +00:00
|
|
|
|
2017-10-11 10:32:44 +00:00
|
|
|
use gst_plugin_simple::sink::*;
|
2018-04-05 08:35:34 +00:00
|
|
|
use gst_plugin_simple::source::*;
|
2016-12-23 17:04:32 +00:00
|
|
|
|
|
|
|
mod filesink;
|
2018-04-05 08:35:34 +00:00
|
|
|
mod filesrc;
|
2016-05-14 12:44:40 +00:00
|
|
|
|
2016-12-23 17:04:32 +00:00
|
|
|
use filesink::FileSink;
|
2018-04-05 08:35:34 +00:00
|
|
|
use filesrc::FileSrc;
|
2016-05-14 12:44:40 +00:00
|
|
|
|
2018-11-04 18:46:07 +00:00
|
|
|
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
2017-07-31 13:36:35 +00:00
|
|
|
source_register(
|
|
|
|
plugin,
|
|
|
|
SourceInfo {
|
|
|
|
name: "rsfilesrc".into(),
|
|
|
|
long_name: "File Source".into(),
|
|
|
|
description: "Reads local files".into(),
|
|
|
|
classification: "Source/File".into(),
|
|
|
|
author: "Sebastian Dröge <sebastian@centricular.com>".into(),
|
|
|
|
rank: 256 + 100,
|
|
|
|
create_instance: FileSrc::new_boxed,
|
|
|
|
protocols: vec!["file".into()],
|
|
|
|
push_only: false,
|
|
|
|
},
|
2018-11-04 18:46:07 +00:00
|
|
|
)?;
|
2016-08-22 20:03:06 +00:00
|
|
|
|
2017-07-31 13:36:35 +00:00
|
|
|
sink_register(
|
|
|
|
plugin,
|
|
|
|
SinkInfo {
|
|
|
|
name: "rsfilesink".into(),
|
|
|
|
long_name: "File Sink".into(),
|
|
|
|
description: "Writes to local files".into(),
|
|
|
|
classification: "Sink/File".into(),
|
|
|
|
author: "Luis de Bethencourt <luisbg@osg.samsung.com>".into(),
|
|
|
|
rank: 256 + 100,
|
|
|
|
create_instance: FileSink::new_boxed,
|
|
|
|
protocols: vec!["file".into()],
|
|
|
|
},
|
2018-11-04 18:46:07 +00:00
|
|
|
)?;
|
2016-08-22 20:03:06 +00:00
|
|
|
|
2018-11-04 18:46:07 +00:00
|
|
|
Ok(())
|
2016-12-08 19:48:40 +00:00
|
|
|
}
|
|
|
|
|
2017-07-31 13:36:35 +00:00
|
|
|
plugin_define!(
|
|
|
|
b"rsfile\0",
|
|
|
|
b"Rust File Plugin\0",
|
|
|
|
plugin_init,
|
|
|
|
b"1.0\0",
|
|
|
|
b"MIT/X11\0",
|
|
|
|
b"rsfile\0",
|
|
|
|
b"rsfile\0",
|
2018-11-26 10:52:09 +00:00
|
|
|
b"https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs\0",
|
2017-07-31 13:36:35 +00:00
|
|
|
b"2016-12-08\0"
|
|
|
|
);
|