...
 
Commits (41)
...@@ -116,11 +116,6 @@ status = "generate" ...@@ -116,11 +116,6 @@ status = "generate"
name = "Gst.Bus" name = "Gst.Bus"
status = "generate" status = "generate"
trait = false trait = false
[[object.function]]
name = "remove_watch"
# Needs manual bindings and GSource support in glib-rs
ignore = true
[[object.function]] [[object.function]]
name = "add_signal_watch_full" name = "add_signal_watch_full"
# Priority # Priority
...@@ -439,6 +434,11 @@ status = "generate" ...@@ -439,6 +434,11 @@ status = "generate"
[[object]] [[object]]
name = "Gst.DeviceMonitor" name = "Gst.DeviceMonitor"
status = "generate" status = "generate"
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object.function]] [[object.function]]
name = "get_bus" name = "get_bus"
[object.function.return] [object.function.return]
...@@ -708,11 +708,19 @@ status = "generate" ...@@ -708,11 +708,19 @@ status = "generate"
name = "Gst.Stream" name = "Gst.Stream"
status = "generate" status = "generate"
trait = false trait = false
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object]] [[object]]
name = "Gst.StreamCollection" name = "Gst.StreamCollection"
status = "generate" status = "generate"
trait = false trait = false
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object]] [[object]]
name = "Gst.Plugin" name = "Gst.Plugin"
...@@ -832,6 +840,11 @@ status = "generate" ...@@ -832,6 +840,11 @@ status = "generate"
# Takes ownership # Takes ownership
ignore = true ignore = true
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object.function]] [[object.function]]
name = "set_active" name = "set_active"
[object.function.return] [object.function.return]
......
...@@ -64,3 +64,8 @@ trait = false ...@@ -64,3 +64,8 @@ trait = false
name = "GstNet.NetTimeProvider" name = "GstNet.NetTimeProvider"
status = "generate" status = "generate"
trait = false trait = false
[[object.function]]
name = "new"
# Floating reference handling
ignore = true
...@@ -4,19 +4,19 @@ version = "0.11.0" ...@@ -4,19 +4,19 @@ version = "0.11.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
[dependencies] [dependencies]
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.5"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-app = { path = "../gstreamer-app" } gstreamer-app = { version = "0.11", path = "../gstreamer-app" }
gstreamer-audio = { path = "../gstreamer-audio" } gstreamer-audio = { version = "0.11", path = "../gstreamer-audio" }
gstreamer-video = { path = "../gstreamer-video" } gstreamer-video = { version = "0.11", path = "../gstreamer-video" }
gstreamer-pbutils = { path = "../gstreamer-pbutils" } gstreamer-pbutils = { version = "0.11", path = "../gstreamer-pbutils" }
gstreamer-player = { path = "../gstreamer-player", optional = true } gstreamer-player = { version = "0.11", path = "../gstreamer-player", optional = true }
gstreamer-rtsp = { path = "../gstreamer-rtsp", optional = true } gstreamer-rtsp = { version = "0.11", path = "../gstreamer-rtsp", optional = true }
gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true } gstreamer-rtsp-server = { version = "0.11", path = "../gstreamer-rtsp-server", optional = true }
gstreamer-rtsp-server-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-rtsp-server-sys = { version = "0.5", features = ["v1_8"] }
gtk = { git = "https://github.com/gtk-rs/gtk", features = ["v3_6"], optional = true } gtk = { version = "0.4", features = ["v3_6"], optional = true }
gdk = { git = "https://github.com/gtk-rs/gdk", optional = true } gdk = { version = "0.8", optional = true }
gio = { git = "https://github.com/gtk-rs/gio", optional = true } gio = { version = "0.4", optional = true }
futures = { version = "0.1", optional = true } futures = { version = "0.1", optional = true }
tokio-core = { version = "0.1", optional = true } tokio-core = { version = "0.1", optional = true }
send-cell = "0.1" send-cell = "0.1"
...@@ -104,3 +104,6 @@ required-features = ["tokio"] ...@@ -104,3 +104,6 @@ required-features = ["tokio"]
[[bin]] [[bin]]
name = "rtsp-server-record" name = "rtsp-server-record"
required-features = ["gst-rtsp-server-record"] required-features = ["gst-rtsp-server-record"]
[[bin]]
name = "discoverer"
...@@ -5,6 +5,91 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ...@@ -5,6 +5,91 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.11.6] - 2018-08-27
### Fixed
- Build with NLL/two-phase borrows
- Explicitly define [bin] section for discoverer example to fix a cargo
warning
### Added
- Add unsafe gst::deinit() function
- Ord/PartialOrd impls on gst::Seqnum
- Getter for current pad mode
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
in a thread-safe way
## [0.11.5] - 2018-07-24
### Fixed
- `gst::Bus`'s sync handler must unref every message if
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
## [0.11.4] - 2018-07-19
### Fixed
- `gst::Caps::subtract()` does not leak its arguments anymore
- `gst::Caps::get_structure()` gracefully returns `None` if the index
is out of bounds instead of a `g_return_val_if_fail()`
- `gst::Structure::new()` has to give away ownership of the info structure
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
structure by value
- Typefind tests don't fail anymore if the system has typefind factories
without caps
### Added
- An additional assertion that ensures that miniobjects are actually
writable before creating a mutable reference
## [0.11.3] - 2018-06-08
### Added
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
- `fmt::Debug` impls for mini objects also print the pointer value now to make
it easier to track them in debug logs
- `PlayerVisualization` has accessors for the name and description fields now,
without which there is no sensible way to use them or to set a player
visualization
## [0.11.2] - 2018-05-09
### Fixed
- Work-around various floating reference handling changes between 1.12 and
1.14 to be able to run with both versions without memory leaks or other
reference count problems.
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
already previously fixed.
### Changed
- Change the appsrc need-data and all appsink callbacks to not require the
Sync bound anymore and change from Fn to FnMut. They can only be called from
a single thread at a time. This change is only done for the corresponding
callbacks, not the signals.
## [0.11.1] - 2018-04-07
### Fixed
- Fix Structure::to_string() to not run into an infinite recursion but call
the method on the contained StructureRef instead of on itself
## [0.11.0] - 2018-03-20
### Changed
- Updated everything to GStreamer 1.14.0
- Event, Message and Query types were refactored to improve usability.
Especially newly constructed queries allow to directly use the type-specific
functions to be used without first creating a view
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
original functions work with refs instead of full frames
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value
- GstPlayer has GstObject as parent class now
### Added
- GstPbutils, GstSdp, GstRtsp and GstRtspServer bindings
- GstPromise, GstAudioStreamAlign and various other 1.14 API
- GstVideoFilter and GstBufferPool bindings
- Element::call_async()
- Debug impl For Toc and TocEntry
- Various new examples (RTP FEC, RTSP server, tag usage, ...)
### Fixed
- Memory leak in gst_video::convert_sample_async()
## [0.10.2] - 2018-02-18 ## [0.10.2] - 2018-02-18
### Fixed ### Fixed
- Fix building of messages with custom fields for types that don't have a - Fix building of messages with custom fields for types that don't have a
...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v ...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible. The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD [Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 [0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 [0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 [0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
......
[package] [package]
name = "gstreamer-app" name = "gstreamer-app"
version = "0.11.0" version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer App library" description = "Rust bindings for GStreamer App library"
...@@ -15,14 +15,14 @@ build = "build.rs" ...@@ -15,14 +15,14 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.6"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.6"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-base-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-app-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-app-sys = { version = "0.5", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.5"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-base = { path = "../gstreamer-base" } gstreamer-base = { version = "0.11", path = "../gstreamer-base" }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"
......
...@@ -14,11 +14,12 @@ use gst; ...@@ -14,11 +14,12 @@ use gst;
use glib::source::CallbackGuard; use glib::source::CallbackGuard;
use glib_ffi::gpointer; use glib_ffi::gpointer;
use std::ptr; use std::ptr;
use std::cell::RefCell;
pub struct AppSinkCallbacks { pub struct AppSinkCallbacks {
eos: Option<Box<Fn(&AppSink) + Send + Sync + 'static>>, eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
new_preroll: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>, new_preroll: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
new_sample: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>, new_sample: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
callbacks: ffi::GstAppSinkCallbacks, callbacks: ffi::GstAppSinkCallbacks,
} }
...@@ -37,15 +38,15 @@ impl AppSinkCallbacks { ...@@ -37,15 +38,15 @@ impl AppSinkCallbacks {
} }
pub struct AppSinkCallbacksBuilder { pub struct AppSinkCallbacksBuilder {
eos: Option<Box<Fn(&AppSink) + Send + Sync + 'static>>, eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
new_preroll: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>, new_preroll: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
new_sample: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>, new_sample: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
} }
impl AppSinkCallbacksBuilder { impl AppSinkCallbacksBuilder {
pub fn eos<F: Fn(&AppSink) + Send + Sync + 'static>(self, eos: F) -> Self { pub fn eos<F: Fn(&AppSink) + Send + Sync + 'static>(self, eos: F) -> Self {
Self { Self {
eos: Some(Box::new(eos)), eos: Some(RefCell::new(Box::new(eos))),
..self ..self
} }
} }
...@@ -55,7 +56,7 @@ impl AppSinkCallbacksBuilder { ...@@ -55,7 +56,7 @@ impl AppSinkCallbacksBuilder {
new_preroll: F, new_preroll: F,
) -> Self { ) -> Self {
Self { Self {
new_preroll: Some(Box::new(new_preroll)), new_preroll: Some(RefCell::new(Box::new(new_preroll))),
..self ..self
} }
} }
...@@ -65,7 +66,7 @@ impl AppSinkCallbacksBuilder { ...@@ -65,7 +66,7 @@ impl AppSinkCallbacksBuilder {
new_sample: F, new_sample: F,
) -> Self { ) -> Self {
Self { Self {
new_sample: Some(Box::new(new_sample)), new_sample: Some(RefCell::new(Box::new(new_sample))),
..self ..self
} }
} }
...@@ -109,7 +110,7 @@ unsafe extern "C" fn trampoline_eos(appsink: *mut ffi::GstAppSink, callbacks: gp ...@@ -109,7 +110,7 @@ unsafe extern "C" fn trampoline_eos(appsink: *mut ffi::GstAppSink, callbacks: gp
callbacks callbacks
.eos .eos
.as_ref() .as_ref()
.map(|f| f(&from_glib_borrow(appsink))); .map(|f| (&mut *f.borrow_mut())(&from_glib_borrow(appsink)));
} }
unsafe extern "C" fn trampoline_new_preroll( unsafe extern "C" fn trampoline_new_preroll(
...@@ -122,7 +123,7 @@ unsafe extern "C" fn trampoline_new_preroll( ...@@ -122,7 +123,7 @@ unsafe extern "C" fn trampoline_new_preroll(
callbacks callbacks
.new_preroll .new_preroll
.as_ref() .as_ref()
.map(|f| f(&from_glib_borrow(appsink))) .map(|f| (&mut *f.borrow_mut())(&from_glib_borrow(appsink)))
.unwrap_or(gst::FlowReturn::Error) .unwrap_or(gst::FlowReturn::Error)
.to_glib() .to_glib()
} }
...@@ -137,7 +138,7 @@ unsafe extern "C" fn trampoline_new_sample( ...@@ -137,7 +138,7 @@ unsafe extern "C" fn trampoline_new_sample(
callbacks callbacks
.new_sample .new_sample
.as_ref() .as_ref()
.map(|f| f(&from_glib_borrow(appsink))) .map(|f| (&mut *f.borrow_mut())(&from_glib_borrow(appsink)))
.unwrap_or(gst::FlowReturn::Error) .unwrap_or(gst::FlowReturn::Error)
.to_glib() .to_glib()
} }
......
...@@ -14,9 +14,10 @@ use glib::source::CallbackGuard; ...@@ -14,9 +14,10 @@ use glib::source::CallbackGuard;
use glib_ffi::{gboolean, gpointer}; use glib_ffi::{gboolean, gpointer};
use std::ptr; use std::ptr;
use std::mem; use std::mem;
use std::cell::RefCell;
pub struct AppSrcCallbacks { pub struct AppSrcCallbacks {
need_data: Option<Box<Fn(&AppSrc, u32) + Send + Sync + 'static>>, need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>,
enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>, enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>,
seek_data: Option<Box<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>>, seek_data: Option<Box<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>>,
callbacks: ffi::GstAppSrcCallbacks, callbacks: ffi::GstAppSrcCallbacks,
...@@ -38,15 +39,15 @@ impl AppSrcCallbacks { ...@@ -38,15 +39,15 @@ impl AppSrcCallbacks {
} }
pub struct AppSrcCallbacksBuilder { pub struct AppSrcCallbacksBuilder {
need_data: Option<Box<Fn(&AppSrc, u32) + Send + Sync + 'static>>, need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>,
enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>, enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>,
seek_data: Option<Box<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>>, seek_data: Option<Box<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>>,
} }
impl AppSrcCallbacksBuilder { impl AppSrcCallbacksBuilder {
pub fn need_data<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(self, need_data: F) -> Self { pub fn need_data<F: FnMut(&AppSrc, u32) + Send + 'static>(self, need_data: F) -> Self {
Self { Self {
need_data: Some(Box::new(need_data)), need_data: Some(RefCell::new(Box::new(need_data))),
..self ..self
} }
} }
...@@ -115,7 +116,7 @@ unsafe extern "C" fn trampoline_need_data( ...@@ -115,7 +116,7 @@ unsafe extern "C" fn trampoline_need_data(
callbacks callbacks
.need_data .need_data
.as_ref() .as_ref()
.map(|f| f(&from_glib_borrow(appsrc), length)); .map(|f| (&mut *f.borrow_mut())(&from_glib_borrow(appsrc), length));
} }
unsafe extern "C" fn trampoline_enough_data(appsrc: *mut ffi::GstAppSrc, callbacks: gpointer) { unsafe extern "C" fn trampoline_enough_data(appsrc: *mut ffi::GstAppSrc, callbacks: gpointer) {
......
...@@ -5,6 +5,91 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ...@@ -5,6 +5,91 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.11.6] - 2018-08-27
### Fixed
- Build with NLL/two-phase borrows
- Explicitly define [bin] section for discoverer example to fix a cargo
warning
### Added
- Add unsafe gst::deinit() function
- Ord/PartialOrd impls on gst::Seqnum
- Getter for current pad mode
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
in a thread-safe way
## [0.11.5] - 2018-07-24
### Fixed
- `gst::Bus`'s sync handler must unref every message if
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
## [0.11.4] - 2018-07-19
### Fixed
- `gst::Caps::subtract()` does not leak its arguments anymore
- `gst::Caps::get_structure()` gracefully returns `None` if the index
is out of bounds instead of a `g_return_val_if_fail()`
- `gst::Structure::new()` has to give away ownership of the info structure
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
structure by value
- Typefind tests don't fail anymore if the system has typefind factories
without caps
### Added
- An additional assertion that ensures that miniobjects are actually
writable before creating a mutable reference
## [0.11.3] - 2018-06-08
### Added
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
- `fmt::Debug` impls for mini objects also print the pointer value now to make
it easier to track them in debug logs
- `PlayerVisualization` has accessors for the name and description fields now,
without which there is no sensible way to use them or to set a player
visualization
## [0.11.2] - 2018-05-09
### Fixed
- Work-around various floating reference handling changes between 1.12 and
1.14 to be able to run with both versions without memory leaks or other
reference count problems.
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
already previously fixed.
### Changed
- Change the appsrc need-data and all appsink callbacks to not require the
Sync bound anymore and change from Fn to FnMut. They can only be called from
a single thread at a time. This change is only done for the corresponding
callbacks, not the signals.
## [0.11.1] - 2018-04-07
### Fixed
- Fix Structure::to_string() to not run into an infinite recursion but call
the method on the contained StructureRef instead of on itself
## [0.11.0] - 2018-03-20
### Changed
- Updated everything to GStreamer 1.14.0
- Event, Message and Query types were refactored to improve usability.
Especially newly constructed queries allow to directly use the type-specific
functions to be used without first creating a view
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
original functions work with refs instead of full frames
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value
- GstPlayer has GstObject as parent class now
### Added
- GstPbutils, GstSdp, GstRtsp and GstRtspServer bindings
- GstPromise, GstAudioStreamAlign and various other 1.14 API
- GstVideoFilter and GstBufferPool bindings
- Element::call_async()
- Debug impl For Toc and TocEntry
- Various new examples (RTP FEC, RTSP server, tag usage, ...)
### Fixed
- Memory leak in gst_video::convert_sample_async()
## [0.10.2] - 2018-02-18 ## [0.10.2] - 2018-02-18
### Fixed ### Fixed
- Fix building of messages with custom fields for types that don't have a - Fix building of messages with custom fields for types that don't have a
...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v ...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible. The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD [Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 [0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 [0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 [0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
......
[package] [package]
name = "gstreamer-audio" name = "gstreamer-audio"
version = "0.11.0" version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Audio library" description = "Rust bindings for GStreamer Audio library"
...@@ -14,12 +14,12 @@ build = "build.rs" ...@@ -14,12 +14,12 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.6"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.6"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-audio-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-audio-sys = { version = "0.5", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.5"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.11", path = "../gstreamer" }
array-init = "0.0" array-init = "0.0"
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
......
...@@ -16,6 +16,7 @@ use glib; ...@@ -16,6 +16,7 @@ use glib;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrNone, ToGlib, use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrNone, ToGlib,
ToGlibPtr, ToGlibPtrMut}; ToGlibPtr, ToGlibPtrMut};
use std::fmt;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
...@@ -23,6 +24,18 @@ use array_init; ...@@ -23,6 +24,18 @@ use array_init;
pub struct AudioInfo(ffi::GstAudioInfo, [::AudioChannelPosition; 64]); pub struct AudioInfo(ffi::GstAudioInfo, [::AudioChannelPosition; 64]);
impl fmt::Debug for AudioInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.debug_struct("AudioInfo")
.field("rate", &self.rate())
.field("channels", &self.channels())
.field("positions", &self.positions())
.field("flags", &self.flags())
.field("layout", &self.layout())
.finish()
}
}
pub struct AudioInfoBuilder<'a> { pub struct AudioInfoBuilder<'a> {
format: ::AudioFormat, format: ::AudioFormat,
rate: u32, rate: u32,
......
...@@ -5,6 +5,91 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ...@@ -5,6 +5,91 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.11.6] - 2018-08-27
### Fixed
- Build with NLL/two-phase borrows
- Explicitly define [bin] section for discoverer example to fix a cargo
warning
### Added
- Add unsafe gst::deinit() function
- Ord/PartialOrd impls on gst::Seqnum
- Getter for current pad mode
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
in a thread-safe way
## [0.11.5] - 2018-07-24
### Fixed
- `gst::Bus`'s sync handler must unref every message if
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
## [0.11.4] - 2018-07-19
### Fixed
- `gst::Caps::subtract()` does not leak its arguments anymore
- `gst::Caps::get_structure()` gracefully returns `None` if the index
is out of bounds instead of a `g_return_val_if_fail()`
- `gst::Structure::new()` has to give away ownership of the info structure
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
structure by value
- Typefind tests don't fail anymore if the system has typefind factories
without caps
### Added
- An additional assertion that ensures that miniobjects are actually
writable before creating a mutable reference
## [0.11.3] - 2018-06-08
### Added
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
- `fmt::Debug` impls for mini objects also print the pointer value now to make
it easier to track them in debug logs
- `PlayerVisualization` has accessors for the name and description fields now,
without which there is no sensible way to use them or to set a player
visualization
## [0.11.2] - 2018-05-09
### Fixed
- Work-around various floating reference handling changes between 1.12 and
1.14 to be able to run with both versions without memory leaks or other
reference count problems.
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
already previously fixed.
### Changed
- Change the appsrc need-data and all appsink callbacks to not require the
Sync bound anymore and change from Fn to FnMut. They can only be called from
a single thread at a time. This change is only done for the corresponding
callbacks, not the signals.
## [0.11.1] - 2018-04-07
### Fixed
- Fix Structure::to_string() to not run into an infinite recursion but call
the method on the contained StructureRef instead of on itself
## [0.11.0] - 2018-03-20
### Changed
- Updated everything to GStreamer 1.14.0
- Event, Message and Query types were refactored to improve usability.
Especially newly constructed queries allow to directly use the type-specific
functions to be used without first creating a view
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
original functions work with refs instead of full frames
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value
- GstPlayer has GstObject as parent class now
### Added
- GstPbutils, GstSdp, GstRtsp and GstRtspServer bindings
- GstPromise, GstAudioStreamAlign and various other 1.14 API
- GstVideoFilter and GstBufferPool bindings
- Element::call_async()
- Debug impl For Toc and TocEntry
- Various new examples (RTP FEC, RTSP server, tag usage, ...)
### Fixed
- Memory leak in gst_video::convert_sample_async()
## [0.10.2] - 2018-02-18 ## [0.10.2] - 2018-02-18
### Fixed ### Fixed
- Fix building of messages with custom fields for types that don't have a - Fix building of messages with custom fields for types that don't have a
...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v ...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible. The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD [Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 [0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 [0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 [0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
......
[package] [package]
name = "gstreamer-base" name = "gstreamer-base"
version = "0.11.0" version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base library" description = "Rust bindings for GStreamer Base library"
...@@ -14,12 +14,12 @@ build = "build.rs" ...@@ -14,12 +14,12 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.6"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.6"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-base-sys = { version = "0.5", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.5"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.11", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"
......
...@@ -5,6 +5,91 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ...@@ -5,6 +5,91 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.11.6] - 2018-08-27
### Fixed
- Build with NLL/two-phase borrows
- Explicitly define [bin] section for discoverer example to fix a cargo
warning
### Added
- Add unsafe gst::deinit() function
- Ord/PartialOrd impls on gst::Seqnum
- Getter for current pad mode
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
in a thread-safe way
## [0.11.5] - 2018-07-24
### Fixed
- `gst::Bus`'s sync handler must unref every message if
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
## [0.11.4] - 2018-07-19
### Fixed
- `gst::Caps::subtract()` does not leak its arguments anymore
- `gst::Caps::get_structure()` gracefully returns `None` if the index
is out of bounds instead of a `g_return_val_if_fail()`
- `gst::Structure::new()` has to give away ownership of the info structure
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
structure by value
- Typefind tests don't fail anymore if the system has typefind factories
without caps
### Added
- An additional assertion that ensures that miniobjects are actually
writable before creating a mutable reference
## [0.11.3] - 2018-06-08
### Added
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
- `fmt::Debug` impls for mini objects also print the pointer value now to make
it easier to track them in debug logs
- `PlayerVisualization` has accessors for the name and description fields now,
without which there is no sensible way to use them or to set a player
visualization
## [0.11.2] - 2018-05-09
### Fixed
- Work-around various floating reference handling changes between 1.12 and
1.14 to be able to run with both versions without memory leaks or other
reference count problems.
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
already previously fixed.
### Changed
- Change the appsrc need-data and all appsink callbacks to not require the
Sync bound anymore and change from Fn to FnMut. They can only be called from
a single thread at a time. This change is only done for the corresponding
callbacks, not the signals.
## [0.11.1] - 2018-04-07
### Fixed
- Fix Structure::to_string() to not run into an infinite recursion but call
the method on the contained StructureRef instead of on itself
## [0.11.0] - 2018-03-20
### Changed
- Updated everything to GStreamer 1.14.0
- Event, Message and Query types were refactored to improve usability.
Especially newly constructed queries allow to directly use the type-specific
functions to be used without first creating a view
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
original functions work with refs instead of full frames
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value
- GstPlayer has GstObject as parent class now
### Added
- GstPbutils, GstSdp, GstRtsp and GstRtspServer bindings
- GstPromise, GstAudioStreamAlign and various other 1.14 API
- GstVideoFilter and GstBufferPool bindings
- Element::call_async()
- Debug impl For Toc and TocEntry
- Various new examples (RTP FEC, RTSP server, tag usage, ...)
### Fixed
- Memory leak in gst_video::convert_sample_async()
## [0.10.2] - 2018-02-18 ## [0.10.2] - 2018-02-18
### Fixed ### Fixed
- Fix building of messages with custom fields for types that don't have a - Fix building of messages with custom fields for types that don't have a
...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v ...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible. The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD [Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 [0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 [0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 [0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
......
[package] [package]
name = "gstreamer-net" name = "gstreamer-net"
version = "0.11.0" version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Net library" description = "Rust bindings for GStreamer Net library"
...@@ -13,12 +13,12 @@ keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"] ...@@ -13,12 +13,12 @@ keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
build = "build.rs" build = "build.rs"
[dependencies] [dependencies]
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.6"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.6"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-net-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-net-sys = { version = "0.5", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.5"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.11", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
use ffi; use ffi;
use glib::StaticType; use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::IsA;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::signal::connect; use glib::signal::connect;
use glib::translate::*; use glib::translate::*;
...@@ -29,15 +28,6 @@ glib_wrapper! { ...@@ -29,15 +28,6 @@ glib_wrapper! {
} }
impl NetTimeProvider { impl NetTimeProvider {
pub fn new<'a, P: IsA<gst::Clock>, Q: Into<Option<&'a str>>>(clock: &P, address: Q, port: i32) -> NetTimeProvider {
assert_initialized_main_thread!();
let address = address.into();
let address = address.to_glib_none();
unsafe {
from_glib_full(ffi::gst_net_time_provider_new(clock.to_glib_none().0, address.0, port))
}
}
pub fn get_property_active(&self) -> bool { pub fn get_property_active(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
......
...@@ -38,6 +38,7 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue ...@@ -38,6 +38,7 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
mod auto; mod auto;
pub use auto::*; pub use auto::*;
mod net_client_clock; mod net_client_clock;
mod net_time_provider;
mod ntp_clock; mod ntp_clock;
mod ptp_clock; mod ptp_clock;
......
// Copyright (C) 2018 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 ffi;
use NetTimeProvider;
use glib::IsA;
use glib::translate::*;
use gst;
impl NetTimeProvider {
pub fn new<'a, P: IsA<gst::Clock>, Q: Into<Option<&'a str>>>(clock: &P, address: Q, port: i32) -> NetTimeProvider {
assert_initialized_main_thread!();
let address = address.into();
let address = address.to_glib_none();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
unsafe {
from_glib_full(ffi::gst_net_time_provider_new(clock.to_glib_none().0, address.0, port))
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
unsafe {
from_glib_none(ffi::gst_net_time_provider_new(clock.to_glib_none().0, address.0, port))
}
}
}
}
This diff is collapsed.
[package] [package]
name = "gstreamer-pbutils" name = "gstreamer-pbutils"
version = "0.11.0" version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base Utils library" description = "Rust bindings for GStreamer Base Utils library"
...@@ -15,12 +15,12 @@ build = "build.rs" ...@@ -15,12 +15,12 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.6"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.6"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-pbutils-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-pbutils-sys = { version = "0.5", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.5"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.11", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"
......
# gstreamer-pbutils-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/) (Pbutils 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
## Table of Contents
1. [Installation](#installation)
1. [Linux/BSDs](#installation-linux)
1. [macOS](#installation-macos)
1. [Windows](#installation-windows)
1. [Getting Started](#getting-started)
1. [License](#license)
1. [Contribution](#contribution)
<a name="installation"/>
## Installation
To build the GStreamer bindings or anything depending on them, you need to
have at least GStreamer 1.8 and gst-plugins-base 1.8 installed. In addition,
some of the examples/tutorials require various GStreamer plugins to be
available, which can be found in gst-plugins-base, gst-plugins-good,
gst-plugins-bad, gst-plugins-ugly and/or gst-libav.
<a name="installation-linux"/>
### Linux/BSDs
You need to install the above mentioned packages with your distributions
package manager, or build them from source.
On Debian/Ubuntu they can be installed with
```
$ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav
```
Package names on other distributions should be similar.
Please submit a pull request with instructions for yours.
<a name="installation-macos"/>
### macOS
You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
provided by the GStreamer project.
#### Homebrew
```
$ brew install gstreamer gst-plugins-base gst-plugins-good \
gst-plugins-bad gst-plugins-ugly gst-libav
```
#### GStreamer Binaries
You need to download the *two* `.pkg` files from the GStreamer website and
install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and
`gstreamer-1.0-devel-1.12.3-x86_64.pkg`.
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
and set the `PKG_CONFIG_PATH` environment variable
```
$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
```
<a name="installation-windows"/>
### Windows
You can install GStreamer and the plugins via [MSYS2](http://www.msys2.org/)
with `pacman` or by installing the
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
the GStreamer project.
#### MSYS2 / pacman
```
$ pacman -S pkg-config mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \
mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \
mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav
```
#### GStreamer Binaries
You need to download the *two* `.msi` files for your platform from the
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.12.3.msi` and
`gstreamer-1.0-devel-x86_64-1.12.3.msi`.
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
from [here](https://sourceforge.net/projects/pkgconfiglite/))
and set the `PKG_CONFIG_PATH` environment variable
```
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
```
<a name="getting-started"/>
## Getting Started
The API reference can be found
[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is
only the Rust API reference and does not explain any of the concepts.
For getting started with GStreamer development, the best would be to follow
the [documentation](https://gstreamer.freedesktop.org/documentation/) on the
GStreamer website, especially the [Application Development
Manual](https://gstreamer.freedesktop.org/documentation/application-development/).
While being C-centric, it explains all the fundamental concepts of GStreamer
and the code examples should be relatively easily translatable to Rust. The
API is basically the same, function/struct names are the same and everything
is only more convenient (hopefully) and safer.
In addition there are
[tutorials](https://gstreamer.freedesktop.org/documentation/tutorials/) on the
GStreamer website. Many of them were ported to Rust already and the code can
be found in the
[tutorials](https://github.com/sdroege/gstreamer-rs/tree/master/tutorials)
directory.
Some further examples for various aspects of GStreamer and how to use it from
Rust can be found in the
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
directory.
<a name="license"/>
## 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
<a name="contribution"/>
## 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.
...@@ -5,6 +5,91 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ...@@ -5,6 +5,91 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.11.6] - 2018-08-27
### Fixed
- Build with NLL/two-phase borrows
- Explicitly define [bin] section for discoverer example to fix a cargo
warning
### Added
- Add unsafe gst::deinit() function
- Ord/PartialOrd impls on gst::Seqnum
- Getter for current pad mode
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
in a thread-safe way
## [0.11.5] - 2018-07-24
### Fixed
- `gst::Bus`'s sync handler must unref every message if
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
## [0.11.4] - 2018-07-19
### Fixed
- `gst::Caps::subtract()` does not leak its arguments anymore
- `gst::Caps::get_structure()` gracefully returns `None` if the index
is out of bounds instead of a `g_return_val_if_fail()`
- `gst::Structure::new()` has to give away ownership of the info structure
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
structure by value
- Typefind tests don't fail anymore if the system has typefind factories
without caps
### Added
- An additional assertion that ensures that miniobjects are actually
writable before creating a mutable reference
## [0.11.3] - 2018-06-08
### Added
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
- `fmt::Debug` impls for mini objects also print the pointer value now to make
it easier to track them in debug logs
- `PlayerVisualization` has accessors for the name and description fields now,
without which there is no sensible way to use them or to set a player
visualization
## [0.11.2] - 2018-05-09
### Fixed
- Work-around various floating reference handling changes between 1.12 and
1.14 to be able to run with both versions without memory leaks or other
reference count problems.
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
already previously fixed.
### Changed
- Change the appsrc need-data and all appsink callbacks to not require the
Sync bound anymore and change from Fn to FnMut. They can only be called from
a single thread at a time. This change is only done for the corresponding
callbacks, not the signals.
## [0.11.1] - 2018-04-07
### Fixed
- Fix Structure::to_string() to not run into an infinite recursion but call
the method on the contained StructureRef instead of on itself
## [0.11.0] - 2018-03-20
### Changed
- Updated everything to GStreamer 1.14.0
- Event, Message and Query types were refactored to improve usability.
Especially newly constructed queries allow to directly use the type-specific
functions to be used without first creating a view
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
original functions work with refs instead of full frames
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value
- GstPlayer has GstObject as parent class now
### Added
- GstPbutils, GstSdp, GstRtsp and GstRtspServer bindings
- GstPromise, GstAudioStreamAlign and various other 1.14 API
- GstVideoFilter and GstBufferPool bindings
- Element::call_async()
- Debug impl For Toc and TocEntry
- Various new examples (RTP FEC, RTSP server, tag usage, ...)
### Fixed
- Memory leak in gst_video::convert_sample_async()
## [0.10.2] - 2018-02-18 ## [0.10.2] - 2018-02-18
### Fixed ### Fixed
- Fix building of messages with custom fields for types that don't have a - Fix building of messages with custom fields for types that don't have a
...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v ...@@ -220,7 +305,15 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible. The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...HEAD [Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1 [0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0 [0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1 [0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
......
[package] [package]
name = "gstreamer-player" name = "gstreamer-player"
version = "0.11.0" version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Player library" description = "Rust bindings for GStreamer Player library"
...@@ -15,13 +15,13 @@ build = "build.rs" ...@@ -15,13 +15,13 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.6"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.6"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_12"] } gstreamer-sys = { version = "0.5", features = ["v1_12"] }
gstreamer-player-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_12"] } gstreamer-player-sys = { version = "0.5", features = ["v1_12"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.5"
gstreamer = { path = "../gstreamer", features = ["v1_12"] } gstreamer = { version = "0.11", path = "../gstreamer", features = ["v1_12"] }
gstreamer-video = { path = "../gstreamer-video", features = ["v1_12"] } gstreamer-video = { version = "0.11", path = "../gstreamer-video", features = ["v1_12"] }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"
......
...@@ -53,6 +53,7 @@ mod player_video_info; ...@@ -53,6 +53,7 @@ mod player_video_info;
mod player_video_overlay_video_renderer; mod player_video_overlay_video_renderer;
mod player_g_main_context_signal_dispatcher; mod player_g_main_context_signal_dispatcher;
mod player_visualization;
// Re-export all the traits in a prelude module, so that applications // Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts // can always "use gst::prelude::*" without getting conflicts
......
// Copyright (C) 2018 Philippe Normand <philn@igalia.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 glib::translate::*;
use std::ffi::CStr;
use PlayerVisualization;
impl PlayerVisualization {
pub fn name(&self) -> &str {
unsafe {
CStr::from_ptr((*self.to_glib_none().0).name)
.to_str()
.unwrap()
}
}
pub fn description(&self) -> &str {
unsafe {
CStr::from_ptr((*self.to_glib_none().0).description)
.to_str()
.unwrap()
}
}
}
...@@ -5,6 +5,91 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ...@@ -5,6 +5,91 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.11.6] - 2018-08-27
### Fixed
- Build with NLL/two-phase borrows
- Explicitly define [bin] section for discoverer example to fix a cargo
warning
### Added
- Add unsafe gst::deinit() function
- Ord/PartialOrd impls on gst::Seqnum
- Getter for current pad mode
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
in a thread-safe way
## [0.11.5] - 2018-07-24
### Fixed
- `gst::Bus`'s sync handler must unref every message if
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
## [0.11.4] - 2018-07-19
### Fixed
- `gst::Caps::subtract()` does not leak its arguments anymore
- `gst::Caps::get_structure()` gracefully returns `None` if the index
is out of bounds instead of a `g_return_val_if_fail()`
- `gst::Structure::new()` has to give away ownership of the info structure
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
structure by value
- Typefind tests don't fail anymore if the system has typefind factories
without caps
### Added
- An additional assertion that ensures that miniobjects are actually
writable before creating a mutable reference
## [0.11.3] - 2018-06-08
### Added
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
- `fmt::Debug` impls for mini objects also print the pointer value now to make
it easier to track them in debug logs
- `PlayerVisualization` has accessors for the name and description fields now,
without which there is no sensible way to use them or to set a player
visualization
## [0.11.2] - 2018-05-09
### Fixed
- Work-around various floating reference handling changes between 1.12 and
1.14 to be able to run with both versions without memory leaks or other
reference count problems.
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
already previously fixed.
### Changed
- Change the appsrc need-data and all appsink callbacks to not require the
Sync bound anymore and change from Fn to FnMut. They can only be called from
a single thread at a time. This change is only done for the corresponding
callbacks, not the signals.
## [0.11.1] - 2018-04-07
### Fixed
- Fix Structure::to_string() to not run into an infinite recursion but call
the method on the contained StructureRef instead of on itself
## [0.11.0] - 2018-03-20
### Changed
- Updated everything to GStreamer 1.14.0
- Event, Message and Query types were refactored to improve usability.
Especially newly constructed queries allow to directly use the type-specific
functions to be used without first creating a view
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
original functions work with refs instead of full frames
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value