gst-plugins-rs/src/lib.rs

119 lines
4 KiB
Rust
Raw Normal View History

2016-05-15 15:54:09 +00:00
// Copyright (C) 2016 Sebastian Dröge <sebastian@centricular.com>
// 2016 Luis de Bethencourt <luisbg@osg.samsung.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-13 15:02:19 +00:00
extern crate libc;
2016-05-14 09:34:50 +00:00
extern crate url;
2016-11-14 18:57:54 +00:00
extern crate reqwest;
#[macro_use]
extern crate bitflags;
2016-11-24 14:29:43 +00:00
#[macro_use]
extern crate nom;
extern crate flavors;
2016-05-13 15:02:19 +00:00
#[macro_use]
pub mod utils;
#[macro_use]
pub mod error;
pub mod buffer;
pub mod adapter;
2016-12-23 16:10:38 +00:00
#[macro_use]
pub mod plugin;
pub mod rssource;
pub mod rssink;
2016-05-13 13:35:48 +00:00
pub mod rsfilesrc;
pub mod rshttpsrc;
2016-05-13 15:07:26 +00:00
pub mod rsfilesink;
2016-11-24 14:29:43 +00:00
pub mod rsdemuxer;
pub mod flvdemux;
2016-12-23 16:10:38 +00:00
use plugin::*;
use rssource::*;
use rsfilesrc::FileSrc;
use rshttpsrc::HttpSrc;
2016-12-23 16:10:38 +00:00
use rssink::*;
use rsfilesink::FileSink;
2016-12-23 16:10:38 +00:00
use rsdemuxer::*;
2016-11-24 14:29:43 +00:00
use flvdemux::FlvDemux;
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
source_register(plugin,
2016-12-23 16:10:38 +00:00
&SourceInfo {
name: "rshttpsrc",
long_name: "HTTP Source",
description: "Reads HTTP/HTTPS streams",
classification: "Source/Network/HTTP",
author: "Sebastian Dröge <sebastian@centricular.com>",
rank: 256 + 100,
create_instance: HttpSrc::new_boxed,
protocols: "http:https",
push_only: true,
});
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-11-24 14:29:43 +00:00
demuxer_register(plugin,
2016-12-23 16:10:38 +00:00
&DemuxerInfo {
name: "rsflvdemux",
long_name: "FLV Demuxer",
description: "Demuxes FLV Streams",
classification: "Codec/Demuxer",
author: "Sebastian Dröge <sebastian@centricular.com>",
rank: 256 + 100,
create_instance: FlvDemux::new_boxed,
input_formats: "video/x-flv",
output_formats: "ANY",
});
true
}
2016-12-23 16:10:38 +00:00
plugin_define!(b"rsplugin\0",
b"Rust Plugin\0",
plugin_init,
b"1.0\0",
b"LGPL\0",
b"rsplugin\0",
b"rsplugin\0",
b"https://github.com/sdroege/rsplugin\0",
b"2016-12-08\0");