2016-05-15 15:54:09 +00:00
|
|
|
// Copyright (C) 2016 Sebastian Dröge <sebastian@centricular.com>
|
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Library General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Library General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
|
|
// License along with this library; if not, write to the
|
|
|
|
// Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
// Boston, MA 02110-1301, USA.
|
|
|
|
|
2016-08-22 20:03:45 +00:00
|
|
|
#![crate_type="cdylib"]
|
2016-05-13 13:35:48 +00:00
|
|
|
|
2016-05-14 09:34:50 +00:00
|
|
|
extern crate url;
|
2016-09-17 12:31:10 +00:00
|
|
|
#[macro_use]
|
2016-12-23 17:04:32 +00:00
|
|
|
extern crate gst_plugin;
|
2016-05-13 15:02:19 +00:00
|
|
|
|
2016-12-23 17:04:32 +00:00
|
|
|
use gst_plugin::plugin::*;
|
|
|
|
use gst_plugin::source::*;
|
|
|
|
use gst_plugin::sink::*;
|
|
|
|
|
|
|
|
mod filesrc;
|
|
|
|
mod filesink;
|
2016-05-14 12:44:40 +00:00
|
|
|
|
2016-12-23 17:04:32 +00:00
|
|
|
use filesrc::FileSrc;
|
|
|
|
use filesink::FileSink;
|
2016-05-14 12:44:40 +00:00
|
|
|
|
2016-12-23 16:10:38 +00:00
|
|
|
fn plugin_init(plugin: &Plugin) -> bool {
|
2016-08-22 20:03:06 +00:00
|
|
|
source_register(plugin,
|
2016-12-23 16:10:38 +00:00
|
|
|
&SourceInfo {
|
|
|
|
name: "rsfilesrc",
|
|
|
|
long_name: "File Source",
|
|
|
|
description: "Reads local files",
|
|
|
|
classification: "Source/File",
|
|
|
|
author: "Sebastian Dröge <sebastian@centricular.com>",
|
|
|
|
rank: 256 + 100,
|
|
|
|
create_instance: FileSrc::new_boxed,
|
|
|
|
protocols: "file",
|
|
|
|
push_only: false,
|
|
|
|
});
|
2016-08-22 20:03:06 +00:00
|
|
|
|
|
|
|
sink_register(plugin,
|
2016-12-23 16:10:38 +00:00
|
|
|
&SinkInfo {
|
|
|
|
name: "rsfilesink",
|
|
|
|
long_name: "File Sink",
|
|
|
|
description: "Writes to local files",
|
|
|
|
classification: "Sink/File",
|
|
|
|
author: "Luis de Bethencourt <luisbg@osg.samsung.com>",
|
|
|
|
rank: 256 + 100,
|
|
|
|
create_instance: FileSink::new_boxed,
|
|
|
|
protocols: "file",
|
|
|
|
});
|
2016-08-22 20:03:06 +00:00
|
|
|
|
2016-12-23 16:10:38 +00:00
|
|
|
true
|
2016-12-08 19:48:40 +00:00
|
|
|
}
|
|
|
|
|
2016-12-23 17:04:32 +00:00
|
|
|
plugin_define!(b"rsfile\0",
|
|
|
|
b"Rust File Plugin\0",
|
2016-12-23 16:10:38 +00:00
|
|
|
plugin_init,
|
|
|
|
b"1.0\0",
|
|
|
|
b"LGPL\0",
|
2016-12-23 17:04:32 +00:00
|
|
|
b"rsfile\0",
|
|
|
|
b"rsfile\0",
|
2016-12-23 16:10:38 +00:00
|
|
|
b"https://github.com/sdroege/rsplugin\0",
|
|
|
|
b"2016-12-08\0");
|