Skip to content
Commits on Source (16)
/target/
**/*.rs.bk
Cargo.lock
This diff is collapsed.
# gstreamer-rs [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer.svg)](https://crates.io/crates/gstreamer) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
[GStreamer](https://gstreamer.freedesktop.org/) bindings for Rust.
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
......
[package]
name = "examples"
version = "0.8.0"
version = "0.8.1"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
[dependencies]
......
......@@ -3,12 +3,9 @@ use gst::prelude::*;
extern crate gstreamer_app as gst_app;
extern crate gstreamer_audio as gst_audio;
extern crate glib;
extern crate byte_slice_cast;
use byte_slice_cast::*;
use std::u64;
use std::i16;
use std::i32;
......@@ -69,7 +66,7 @@ fn create_pipeline() -> Result<gst::Pipeline, utils::ExampleError> {
let sum: f64 = samples
.iter()
.map(|sample| {
let f = (*sample as f64) / (i16::MAX as f64);
let f = f64::from(*sample) / f64::from(i16::MAX);
f * f
})
.sum();
......@@ -92,14 +89,9 @@ fn main_loop() -> Result<(), utils::ExampleError> {
.get_bus()
.expect("Pipeline without bus. Shouldn't happen!");
loop {
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
let msg = match bus.timed_pop(u64::MAX) {
None => break,
Some(msg) => msg,
};
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
......
......@@ -3,9 +3,6 @@ use gst::prelude::*;
extern crate gstreamer_app as gst_app;
extern crate gstreamer_video as gst_video;
extern crate glib;
use std::u64;
use std::thread;
pub mod utils;
......@@ -85,14 +82,9 @@ fn main_loop() -> Result<(), utils::ExampleError> {
.get_bus()
.expect("Pipeline without bus. Shouldn't happen!");
loop {
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
let msg = match bus.timed_pop(u64::MAX) {
None => break,
Some(msg) => msg,
};
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
......
......@@ -4,7 +4,6 @@ use gst::prelude::*;
extern crate glib;
use std::env;
use std::u64;
fn main() {
gst::init().unwrap();
......@@ -13,7 +12,7 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: decodebin file_path");
panic!("Usage: decodebin file_path")
};
let pipeline = gst::Pipeline::new(None);
......@@ -81,14 +80,9 @@ fn main() {
let bus = pipeline.get_bus().unwrap();
loop {
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
let msg = match bus.timed_pop(u64::MAX) {
None => break,
Some(msg) => msg,
};
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
......
......@@ -118,7 +118,6 @@ fn create_ui(app: &gtk::Application) {
process::exit(-1);
}
}
});
vbox.pack_start(&video_window, true, true, 0);
......
extern crate gstreamer as gst;
use gst::prelude::*;
use std::u64;
use std::env;
use std::process;
......@@ -21,7 +20,7 @@ fn main() {
println!("Failed to parse pipeline: {}", err);
}
process::exit(-1);
process::exit(-1)
}
};
let bus = pipeline.get_bus().unwrap();
......@@ -29,14 +28,9 @@ fn main() {
let ret = pipeline.set_state(gst::State::Playing);
assert_ne!(ret, gst::StateChangeReturn::Failure);
loop {
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
let msg = match bus.timed_pop(u64::MAX) {
None => break,
Some(msg) => msg,
};
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
......
......@@ -5,7 +5,6 @@ extern crate gstreamer_audio as gst_audio;
extern crate byte_slice_cast;
use byte_slice_cast::*;
use std::u64;
use std::i16;
fn main() {
......@@ -37,7 +36,7 @@ fn main() {
let sum: f64 = samples
.iter()
.map(|sample| {
let f = (*sample as f64) / (i16::MAX as f64);
let f = f64::from(*sample) / f64::from(i16::MAX);
f * f
})
.sum();
......@@ -51,14 +50,9 @@ fn main() {
let ret = pipeline.set_state(gst::State::Playing);
assert_ne!(ret, gst::StateChangeReturn::Failure);
loop {
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
let msg = match bus.timed_pop(u64::MAX) {
None => break,
Some(msg) => msg,
};
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
......
......@@ -4,7 +4,6 @@ use gst::prelude::*;
extern crate glib;
use std::env;
use std::u64;
fn main() {
gst::init().unwrap();
......@@ -13,7 +12,7 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: playbin uri");
panic!("Usage: playbin uri")
};
let playbin = gst::ElementFactory::make("playbin", None).unwrap();
......@@ -65,14 +64,9 @@ fn main() {
let ret = playbin.set_state(gst::State::Playing);
assert_ne!(ret, gst::StateChangeReturn::Failure);
loop {
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
let msg = match bus.timed_pop(u64::MAX) {
None => break,
Some(msg) => msg,
};
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
......
......@@ -5,6 +5,7 @@ use gst::prelude::*;
#[cfg(feature = "gst-player")]
extern crate gstreamer_player as gst_player;
#[cfg(feature = "gst-player")]
extern crate glib;
use std::env;
......@@ -72,7 +73,7 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: player uri");
panic!("Usage: player uri")
};
match main_loop(uri) {
......
......@@ -4,7 +4,6 @@ use gst::prelude::*;
extern crate glib;
use std::env;
use std::u64;
fn main() {
gst::init().unwrap();
......@@ -13,7 +12,7 @@ fn main() {
let uri: &str = if args.len() == 2 {
args[1].as_ref()
} else {
panic!("Usage: toc file_path");
panic!("Usage: toc file_path")
};
let pipeline = gst::Pipeline::new(None);
......@@ -52,16 +51,11 @@ fn main() {
let bus = pipeline.get_bus().unwrap();
loop {
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
use gst::MessageView;
let msg = match bus.timed_pop(u64::MAX) {
None => break,
Some(msg) => msg,
};
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Eos(_) | MessageView::AsyncDone(_) => break,
MessageView::Error(err) => {
println!(
"Error from {}: {} ({:?})",
......@@ -71,7 +65,6 @@ fn main() {
);
break;
}
MessageView::AsyncDone(_) => break,
MessageView::Toc(msg_toc) => {
let (toc, updated) = msg_toc.get_toc();
println!(
......
#[cfg(feature = "tokio")]
extern crate gstreamer as gst;
#[cfg(feature = "tokio")]
use gst::prelude::*;
......
......@@ -5,10 +5,31 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.8.1] - 2017-09-15
### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding
Ref types.
### Fixed
- Constructor for gst_player::Player now works properly with GStreamer 1.12
when passing a video renderer or signal dispatcher. There was a reference
counting bug.
- Instead of returning &'static references from functions, return references
with a generic, unbound lifetime instead.
See https://github.com/rust-lang/rust/pull/42417#issue-233404573
- Various "unused external crate" warnings and clippy warnings everywhere.
### Changed
- Remove Cargo.lock from GIT, it's not very useful for library crates.
- Run everything through latest rustfmt-nightly.
- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of
u64::MAX) in the examples.
## [0.8.0] - 2017-08-31
- Initial release of the autogenerated GStreamer bindings. Older versions
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...HEAD
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1
[package]
name = "gstreamer-app"
version = "0.8.0"
version = "0.8.1"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer App library"
repository = "https://github.com/sdroege/gstreamer-rs"
license = "MIT/Apache-2.0"
readme = "README.md"
homepage = "https://gstreamer.freedesktop.org"
documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer-app"
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
......
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-app.svg)](https://crates.io/crates/gstreamer-app) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
[GStreamer](https://gstreamer.freedesktop.org/) (App library) bindings for Rust.
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
These bindings are providing a safe API that can be used to interface with
GStreamer, e.g. for writing GStreamer-based applications.
For background and motivation, see the [announcement blogpost](https://coaxion.net/blog/2017/07/writing-gstreamer-applications-in-rust/).
The bindings (since 0.8.0) are autogenerated with [gir](https://github.com/gtk-rs/gir/)
based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/)
API metadata provided by the GStreamer project. Older versions before 0.8.0 were manually
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible.
A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs
## LICENSE
gstreamer-rs and all crates contained in here are licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
http://opensource.org/licenses/MIT)
at your option.
GStreamer itself is licensed under the Lesser General Public License version
2.1 or (at your option) any later version:
https://www.gnu.org/licenses/lgpl-2.1.html
## Contribution
Any kinds of contributions are welcome as a pull request.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in gstreamer-rs by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
......@@ -10,9 +10,9 @@ extern crate libc;
extern crate glib_sys as glib_ffi;
extern crate gobject_sys as gobject_ffi;
extern crate gstreamer_sys as gst_ffi;
extern crate gstreamer_app_sys as ffi;
extern crate gstreamer as gst;
extern crate gstreamer_app_sys as ffi;
extern crate gstreamer_sys as gst_ffi;
#[macro_use]
extern crate glib;
......
......@@ -5,10 +5,31 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.8.1] - 2017-09-15
### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding
Ref types.
### Fixed
- Constructor for gst_player::Player now works properly with GStreamer 1.12
when passing a video renderer or signal dispatcher. There was a reference
counting bug.
- Instead of returning &'static references from functions, return references
with a generic, unbound lifetime instead.
See https://github.com/rust-lang/rust/pull/42417#issue-233404573
- Various "unused external crate" warnings and clippy warnings everywhere.
### Changed
- Remove Cargo.lock from GIT, it's not very useful for library crates.
- Run everything through latest rustfmt-nightly.
- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of
u64::MAX) in the examples.
## [0.8.0] - 2017-08-31
- Initial release of the autogenerated GStreamer bindings. Older versions
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...HEAD
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1
[package]
name = "gstreamer-audio"
version = "0.8.0"
version = "0.8.1"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Audio library"
repository = "https://github.com/sdroege/gstreamer-rs"
license = "MIT/Apache-2.0"
readme = "README.md"
homepage = "https://gstreamer.freedesktop.org"
documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer-audio"
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
......@@ -13,7 +14,6 @@ build = "build.rs"
[dependencies]
bitflags = "0.9"
libc = "0.2"
glib-sys = "0.4"
gobject-sys = "0.4"
gstreamer-sys = { version = "0.2", features = ["v1_8"] }
......