Compare commits

...

41 commits
main ... 0.11

Author SHA1 Message Date
Sebastian Dröge
82c022f882 Update versions to 0.11.6 2018-08-27 10:01:22 +03:00
Sebastian Dröge
3b2db07526 Update CHANGELOG.md for 0.11.6 2018-08-27 10:01:09 +03:00
Sebastian Dröge
64a4a55387 Implement Pad::sticky_events_foreach() 2018-08-27 09:25:10 +03:00
Sebastian Dröge
7b9daf3094 Add getter for the current pad mode 2018-08-27 09:25:02 +03:00
Arun Raghavan
12b5c2887f examples: Explicitly define [bin] section for discoverer 2018-08-27 09:24:14 +03:00
Sebastian Dröge
4959fae043 Implement Ord/PartialOrd on Seqnum 2018-08-27 09:23:15 +03:00
Philippe Normand
bf4defb6a3 gstreamer: Implement deinit() function
This function is especially usefull when using the leaks tracer. It was removed
in commit e7a0543c.
2018-08-27 09:22:55 +03:00
Sebastian Dröge
5c2addb37b Fix build with two-phase-borrows/NLL 2018-08-27 09:20:51 +03:00
Sebastian Dröge
f162735145 Update versions to 0.11.5 2018-07-24 15:53:24 +03:00
Sebastian Dröge
42a8aeeabb Update CHANGELOG.md for 0.11.5 2018-07-24 15:52:31 +03:00
Sebastian Dröge
8a4370022a Unref the message in sync bus handlers if Drop is returned 2018-07-24 15:36:10 +03:00
Sebastian Dröge
1855a1adbd Update versions to 0.11.4 2018-07-19 18:39:27 +03:00
Sebastian Dröge
75dec4b0b1 Update CHANGELOG.md for 0.11.4 2018-07-19 18:39:13 +03:00
Sebastian Dröge
9295137a10 Caps::subtract() does not take ownership of its arguments 2018-07-19 18:33:32 +03:00
Sebastian Dröge
3f8a087fd4 Gracefully return None in Caps::get_structure() if the index is too high 2018-07-19 18:31:50 +03:00
Sebastian Dröge
332ab9690f Fix typefind test if typefind factories without caps are available 2018-07-19 18:31:43 +03:00
Sebastian Dröge
bc23d6a6cd Ensure that miniobjects are writable before creating a mutable borrow 2018-07-19 18:31:34 +03:00
François Laignel
d20bceb68f 0.11: Fix memory issue building a Sample with an info Structure
This is a workaround to get the fix from PR #113 on branch 0.11 without
breaking the API.
2018-06-12 11:41:53 +03:00
Sebastian Dröge
f9d7c57905 Update versions to 0.11.3 2018-06-08 10:25:41 +03:00
Sebastian Dröge
e1cf5bf9dc Update CHANGELOG.md for 0.11.3 2018-06-08 10:25:24 +03:00
Sebastian Dröge
f444a80e47 Re-add player_g_main_context_signal_dispatcher in player's lib.rs
This was accidentially removed while merging a change from master
2018-06-08 10:21:55 +03:00
Sebastian Dröge
25a887ad48 Print more fields in the VideoInfo fmt::Debug impl 2018-06-08 10:19:56 +03:00
Sebastian Dröge
6f59ceb5e1 Implement fmt::Debug for AudioInfo 2018-06-08 10:19:55 +03:00
Thibault Saunier
8671731002 Print pointer value when formatting debug strings 2018-06-08 10:09:54 +03:00
Thibault Saunier
dd9b507e67 video_info: Implement fmt::Debug 2018-06-08 10:09:28 +03:00
Philippe Normand
d4317c6445 GstPlayer: Expose PlayerVisualization name and description
The name is the identifier of the visualization that has to be passed to
gstreamer_player::Player::set_visualization().

Fixes #111
2018-06-04 20:49:02 +03:00
Sebastian Dröge
f86941c14f Add Bus::remove_watch()
It was accidentially ignored before
2018-05-19 14:19:50 +03:00
Sebastian Dröge
a81c45eaee Update versions to 0.11.2 2018-05-09 12:44:31 +03:00
Sebastian Dröge
d13aa1ebb1 Update CHANGELOG.md for 0.11.2 2018-05-09 12:44:03 +03:00
Sebastian Dröge
3282c77a6d Further work-arounds for floating reference handling changes between 1.12 and 1.14
This fixes various memory-safety issues caused by broken reference
counting. We have to handle pre-1.14 and post-1.14 differently in
constructors.

See https://bugzilla.gnome.org/show_bug.cgi?id=743062#c30
2018-05-09 12:37:32 +03:00
Sebastian Dröge
5cb03ab2ef appsrc need-data and all appsink callbacks can only be called from a single thread at a time
As such, make them FnMut and remove the Sync requirement from them. We
can only do this for the callbacks and not the signals, because the
signals can in theory be emitted from anybody (outside the object!)
at any time.
2018-05-09 12:35:55 +03:00
Sebastian Dröge
8a6725cdb0 Also update version of gstreamer to 0.11.1 2018-04-07 20:33:27 +03:00
Sebastian Dröge
b392092e8d Update versions to 0.11.1 2018-04-07 20:22:24 +03:00
Sebastian Dröge
7b772a2799 Update CHANGELOG.md for 0.11.1 2018-04-07 20:21:36 +03:00
Sebastian Dröge
6868eddcb6 Change Structure/StructureRef to_string() to the minimal required fix
And add a comment to why we need it. No other struct with a to_string()
function is affected.

https://github.com/sdroege/gstreamer-rs/issues/101
2018-04-07 13:41:06 +03:00
Sebastian Dröge
9427e75fa4 Add Display impl for StructureRef too 2018-04-07 13:41:05 +03:00
Sebastian Dröge
7c01e1e46f Fix infinite recursion in Structure::to_string()
Instead of StructureRef's to_string(), we were calling
ToString::to_string() in the Display impl. Which then called into itself
again.

Fixes https://github.com/sdroege/gstreamer-rs/issues/101
2018-04-07 13:41:03 +03:00
Guillaume Desmottes
92341e92ca WIP: test Structure string conversions 2018-04-07 13:41:00 +03:00
Sebastian Dröge
a8e2fac47d Add CHANGELOG.md/README.md to pbutils 2018-03-20 13:03:26 +02:00
Sebastian Dröge
7dbe49f609 Update CHANGELOG.md for 0.11.0 2018-03-20 12:47:48 +02:00
Sebastian Dröge
4c13502eec Update versions of all dependencies and point to releases instead of GIT 2018-03-20 12:36:39 +02:00
59 changed files with 1977 additions and 216 deletions

View file

@ -116,11 +116,6 @@ status = "generate"
name = "Gst.Bus"
status = "generate"
trait = false
[[object.function]]
name = "remove_watch"
# Needs manual bindings and GSource support in glib-rs
ignore = true
[[object.function]]
name = "add_signal_watch_full"
# Priority
@ -439,6 +434,11 @@ status = "generate"
[[object]]
name = "Gst.DeviceMonitor"
status = "generate"
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object.function]]
name = "get_bus"
[object.function.return]
@ -708,11 +708,19 @@ status = "generate"
name = "Gst.Stream"
status = "generate"
trait = false
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object]]
name = "Gst.StreamCollection"
status = "generate"
trait = false
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object]]
name = "Gst.Plugin"
@ -832,6 +840,11 @@ status = "generate"
# Takes ownership
ignore = true
[[object.function]]
name = "new"
# Work-around for 1.14 switch from transfer-floating to transfer-full
ignore = true
[[object.function]]
name = "set_active"
[object.function.return]

View file

@ -64,3 +64,8 @@ trait = false
name = "GstNet.NetTimeProvider"
status = "generate"
trait = false
[[object.function]]
name = "new"
# Floating reference handling
ignore = true

View file

@ -4,19 +4,19 @@ version = "0.11.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
[dependencies]
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
gstreamer-app = { path = "../gstreamer-app" }
gstreamer-audio = { path = "../gstreamer-audio" }
gstreamer-video = { path = "../gstreamer-video" }
gstreamer-pbutils = { path = "../gstreamer-pbutils" }
gstreamer-player = { path = "../gstreamer-player", optional = true }
gstreamer-rtsp = { path = "../gstreamer-rtsp", optional = true }
gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true }
gstreamer-rtsp-server-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gtk = { git = "https://github.com/gtk-rs/gtk", features = ["v3_6"], optional = true }
gdk = { git = "https://github.com/gtk-rs/gdk", optional = true }
gio = { git = "https://github.com/gtk-rs/gio", optional = true }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-app = { version = "0.11", path = "../gstreamer-app" }
gstreamer-audio = { version = "0.11", path = "../gstreamer-audio" }
gstreamer-video = { version = "0.11", path = "../gstreamer-video" }
gstreamer-pbutils = { version = "0.11", path = "../gstreamer-pbutils" }
gstreamer-player = { version = "0.11", path = "../gstreamer-player", optional = true }
gstreamer-rtsp = { version = "0.11", path = "../gstreamer-rtsp", optional = true }
gstreamer-rtsp-server = { version = "0.11", path = "../gstreamer-rtsp-server", optional = true }
gstreamer-rtsp-server-sys = { version = "0.5", features = ["v1_8"] }
gtk = { version = "0.4", features = ["v3_6"], optional = true }
gdk = { version = "0.8", optional = true }
gio = { version = "0.4", optional = true }
futures = { version = "0.1", optional = true }
tokio-core = { version = "0.1", optional = true }
send-cell = "0.1"
@ -104,3 +104,6 @@ required-features = ["tokio"]
[[bin]]
name = "rtsp-server-record"
required-features = ["gst-rtsp-server-record"]
[[bin]]
name = "discoverer"

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-app"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer App library"
@ -15,14 +15,14 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-app-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
gstreamer-base = { path = "../gstreamer-base" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-base-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-app-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-base = { version = "0.11", path = "../gstreamer-base" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -14,11 +14,12 @@ use gst;
use glib::source::CallbackGuard;
use glib_ffi::gpointer;
use std::ptr;
use std::cell::RefCell;
pub struct AppSinkCallbacks {
eos: Option<Box<Fn(&AppSink) + Send + Sync + 'static>>,
new_preroll: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>,
new_sample: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>,
eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
new_preroll: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
new_sample: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
callbacks: ffi::GstAppSinkCallbacks,
}
@ -37,15 +38,15 @@ impl AppSinkCallbacks {
}
pub struct AppSinkCallbacksBuilder {
eos: Option<Box<Fn(&AppSink) + Send + Sync + 'static>>,
new_preroll: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>,
new_sample: Option<Box<Fn(&AppSink) -> gst::FlowReturn + Send + Sync + 'static>>,
eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
new_preroll: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
new_sample: Option<RefCell<Box<FnMut(&AppSink) -> gst::FlowReturn + Send + 'static>>>,
}
impl AppSinkCallbacksBuilder {
pub fn eos<F: Fn(&AppSink) + Send + Sync + 'static>(self, eos: F) -> Self {
Self {
eos: Some(Box::new(eos)),
eos: Some(RefCell::new(Box::new(eos))),
..self
}
}
@ -55,7 +56,7 @@ impl AppSinkCallbacksBuilder {
new_preroll: F,
) -> Self {
Self {
new_preroll: Some(Box::new(new_preroll)),
new_preroll: Some(RefCell::new(Box::new(new_preroll))),
..self
}
}
@ -65,7 +66,7 @@ impl AppSinkCallbacksBuilder {
new_sample: F,
) -> Self {
Self {
new_sample: Some(Box::new(new_sample)),
new_sample: Some(RefCell::new(Box::new(new_sample))),
..self
}
}
@ -109,7 +110,7 @@ unsafe extern "C" fn trampoline_eos(appsink: *mut ffi::GstAppSink, callbacks: gp
callbacks
.eos
.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(
@ -122,7 +123,7 @@ unsafe extern "C" fn trampoline_new_preroll(
callbacks
.new_preroll
.as_ref()
.map(|f| f(&from_glib_borrow(appsink)))
.map(|f| (&mut *f.borrow_mut())(&from_glib_borrow(appsink)))
.unwrap_or(gst::FlowReturn::Error)
.to_glib()
}
@ -137,7 +138,7 @@ unsafe extern "C" fn trampoline_new_sample(
callbacks
.new_sample
.as_ref()
.map(|f| f(&from_glib_borrow(appsink)))
.map(|f| (&mut *f.borrow_mut())(&from_glib_borrow(appsink)))
.unwrap_or(gst::FlowReturn::Error)
.to_glib()
}

View file

@ -14,9 +14,10 @@ use glib::source::CallbackGuard;
use glib_ffi::{gboolean, gpointer};
use std::ptr;
use std::mem;
use std::cell::RefCell;
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>>,
seek_data: Option<Box<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>>,
callbacks: ffi::GstAppSrcCallbacks,
@ -38,15 +39,15 @@ impl AppSrcCallbacks {
}
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>>,
seek_data: Option<Box<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>>,
}
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 {
need_data: Some(Box::new(need_data)),
need_data: Some(RefCell::new(Box::new(need_data))),
..self
}
}
@ -115,7 +116,7 @@ unsafe extern "C" fn trampoline_need_data(
callbacks
.need_data
.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) {

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-audio"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Audio library"
@ -14,12 +14,12 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-audio-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-audio-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
array-init = "0.0"
[build-dependencies.rustdoc-stripper]

View file

@ -16,6 +16,7 @@ use glib;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrNone, ToGlib,
ToGlibPtr, ToGlibPtrMut};
use std::fmt;
use std::mem;
use std::ptr;
@ -23,6 +24,18 @@ use array_init;
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> {
format: ::AudioFormat,
rate: u32,

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-base"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base library"
@ -14,12 +14,12 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-base-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-net"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Net library"
@ -13,12 +13,12 @@ keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
build = "build.rs"
[dependencies]
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-net-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-net-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -5,7 +5,6 @@
use ffi;
use glib::StaticType;
use glib::Value;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
@ -29,15 +28,6 @@ glib_wrapper! {
}
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 {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());

View file

@ -38,6 +38,7 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
mod auto;
pub use auto::*;
mod net_client_clock;
mod net_time_provider;
mod ntp_clock;
mod ptp_clock;

View file

@ -0,0 +1,34 @@
// 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))
}
}
}
}

View file

@ -0,0 +1,322 @@
# Changelog
All notable changes to this project will be documented in this file.
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.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
### Fixed
- Fix building of messages with custom fields for types that don't have a
GstStructure
### Added
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref(), which work with
VideoFrameRefs instead of full VideoFrames
- Getters for the BaseSrc/Sink/Transform configured segment
- Document the gstreamer-player-1.0 dependency in the README.md
## [0.10.1] - 2018-01-03
### Fixed
- Don't require &mut self for TagSetterExtManual::add()
### Added
- A TagSetter example application
- Bindings for gst_video::convert_sample() and ::convert_sample_async()
- Bindings for gst_video::VideoRectangle
- Debug impl for Sample and ::with_buffer_list() constructor
- A borrowing version of VideoFrame: VideoFrameRef
- Bindings for GstVideoFilter
### Changed
- Deprecated Sample::get_info() in favour of ::get_structure()
- Player has gst::Object as another parent class now
## [0.10.0] - 2017-12-22
### Fixed
- Various clippy warnings
- Memory leak of the tag list in Toc::merge_tags()
- Property getters use Values of the correct type
- Event::get_structure(), Message::get_structure() and
Query::get_structure() can return None for the structure
- Various other nullability fixes all over the API, changing functions to
accept Option<> or returning Option<>, or only plain types
- Functions taking paths/filenames now actually take Paths instead of &strs
- Element::remove_pad() is not giving away a new reference to the pad
anymore, which caused a memory leak of all pads ever removed
- Precision handling in ClockTime's Display impl
- Video/AudioInfo are only Send, not Sync
### Added
- Various enums now also derive useful traits like Copy, Clone and Hash in
addition to PartialEq, Eq and Debug
- TagList::merge() and insert() for combining tag lists
- EventType gained many useful functions to work with event types and
a PartialOrd impl to check expected event order of event types where it matters
- MessageRef/EventRef/QueryRef implement ToOwned
- Bindings for Registry and PluginFeature
- Event::set_running_time_offset() for adjusting the offset while events
pass through the pipeline
- Event/Message GroupIds and Seqnums now have a newtype wrapper around u32
instead of the plain value, making usage of them slightly more typesafe.
Also add an "invalid" value for both, as exists in latest GStreamer now.
- FormattedValue, GenericFormattedValue and related types were
implemented now, which allows more convenient and type-safe usage of
formatted values (time, bytes, etc)
- Bindings for force-keyunit and still-frame events were added
- MappedBuffer/BufferMap now implement various other useful traits, including
AsRef<[u8]>, AsMut, Deref, DerefMut, Debug, PartialEq and Eq
- Add VideoMultiviewFramePacking enum, and use it in Player
- Bindings for the GStreamer Net library, including PTP/NTP/network client
clocks and the GStreamer NetClock provider for network synchronization of
pipelines
- IteratorError implements std::error:Error
- Plugin::add_dependency() and ::add_dependency_simple() was added
- Rank and TypeFindProbability implement PartialOrd/Ord now
- Bindings for TypeFind, TypeFindFactory and the typefind helpers
- StreamCollection::iter() for iterating over all contained streams
- ErrorMessage type that can be used e.g. in a Result for passing an error
message from somewhere to upper layers to then be posted on an element the
same way gst_element_error!() would've done
### Changed
- Sample::new(), TagList::add(), Structure::set() and similar
functions take the values (ToSendValue impls) by reference instead of value.
They were not consumed by the function before.
- The Debug impls of various types, including Event/Buffer/Message/Query/Structure
were improved to print all the fields, similar to what GST_PTR_FORMAT would
do in C
- Switched to lazy_static 1.0
- Gap event and Duration tag are using ClockTimes now, as well as various
Player signals
- Segment is now based on a generic type FormattedSegment that can
take any format (time, bytes, etc) or a GenericFormattedValue for more
type-safety and convenience. Also functions for "casting" between a generic
segment and a segment with a specific format exist on this now
- AppSrc and AppSink now have a builder for the callbacks, making it
unnecessary to always provide all callbacks even if only one is actually
needed
- Various functions that returned bool for errors, are now returning a Result
- Player configuration is now a custom type with more convenient API
- Player VideoInfo uses a Fraction instead of (u32,u32) for the framerate and
pixel-aspect-ratio
- VideoFrame API has more consistent API between writable and read-only
variants
- Buffer::copy_into() was added, and ::copy_region() now takes a
BufferCopyFlags parameter instead of always using the default flags
- ChildProxy::set_child_property() takes a &ToValue now to follow the API of
Object::set_property() and improve usability
- Proxy/GhostPad default pad functions use the correct specific pad type now
instead of a generic Pad
- Bus::add_signal_watch_full() takes a Priority for the priority instead of u32
- Clock::(un)adjust_with_calibration() takes no clock parameter anymore
### Removed
- FormatValue was removed in favour of GenericFormattedValue and the
connected traits and specific format impls
## [0.9.1] - 2017-11-26
### Fixed
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
`PadLinkError`/`PadLinkSuccess` too
## [0.9.0] - 2017-11-26
### Added
- Bindings for (outputting to) the GStreamer logging system
- Bindings for the GStreamer base library
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
functions
- Bindings for `StaticCaps` and `StaticPadTemplate`
- Bindings for `deep-notify` signal on `Object`
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
from an element with context information (file, line, module, etc.) similar
to the C `GST_ELEMENT_ERROR` macro
- Support for setting custom fields in `Messages`/`Events` during construction
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
`AsMut<[u8]>`
- Support for using the `Read` trait on `Adapter`
- Functions for getting all sink/src/all pads of an `Element`, and all children
of a `Bin`
- Builder for `Caps` and `Structures` in addition to the existing functions
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
- Rust ports of the basic tutorials 1 to 8 from
https://gstreamer.freedesktop.org/documentation/tutorials/
- "Getting started" and "Installation" sections to the README.md
- "dox" feature for generating documentation for all available configurations
### Fixed
- `StackTraceFlags` are only available since 1.12
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
examples and tutorials, to be able to show a window or anything else
### Changed
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
and other traits as needed and ensures that no accidential calculations with
`CLOCK_TIME_NONE` can happen
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
`Seek` events now return a `FormatValue` type. This contains the actual
`Format` together with the value and does any required conversions. This
also makes it harder to accidentially mix e.g. values in bytes and time
- `PadProbeId` does not implement `Clone`/`Copy` anymore
- Property notify watches return a custom type instead of ulong
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
`glib::Error` now. Using arbitrary ones does not work
- `Iterator` bindings were completely rewritten and provide the item type as a
generic type parameter now, greatly simplifying its usage
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
`Structures`, as their content must be possible to send to different threads
safely
- `Message::get_src()` can return `None`
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
- Moved `copy()` from `GstRc` directly to `MiniObject`
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
implement an `into_result()` function that splits them into a `Result` with
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
accidentially ignore errors.
- Error enums implement the `Error` trait
- Many examples use the `failure` crate for error handling now, cleaning up the
error handling code quite a bit
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
## [0.8.2] - 2017-11-11
### Fixed
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
GstRc<BufferRef> already implements StaticType if BufferRef does, and
without this it was not possible to use Buffers in GValues.
- Free memory of the appsink/appsrc callbacks with the correct type. It was
crashing because of using the wrong type before.
- Fix documentation URLs in Cargo.toml.
### Added
- Installation instructions and links to documentation for getting started to
README.md.
## [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.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.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.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0
[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-pbutils"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base Utils library"
@ -15,12 +15,12 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-pbutils-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-pbutils-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

170
gstreamer-pbutils/README.md Normal file
View file

@ -0,0 +1,170 @@
# 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.

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-player"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Player library"
@ -15,13 +15,13 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_12"] }
gstreamer-player-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_12"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer", features = ["v1_12"] }
gstreamer-video = { path = "../gstreamer-video", features = ["v1_12"] }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_12"] }
gstreamer-player-sys = { version = "0.5", features = ["v1_12"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer", features = ["v1_12"] }
gstreamer-video = { version = "0.11", path = "../gstreamer-video", features = ["v1_12"] }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -53,6 +53,7 @@ mod player_video_info;
mod player_video_overlay_video_renderer;
mod player_g_main_context_signal_dispatcher;
mod player_visualization;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts

View file

@ -0,0 +1,30 @@
// 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()
}
}
}

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-rtsp-server"
version = "0.11.0"
version = "0.11.6"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer RTSP Server library"
@ -16,18 +16,18 @@ build = "build.rs"
bitflags = "1.0"
libc = "0.2"
lazy_static = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gio-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-rtsp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-rtsp-server-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-net-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gio = { git = "https://github.com/gtk-rs/gio" }
gstreamer = { path = "../gstreamer" }
gstreamer-rtsp = { path = "../gstreamer-rtsp" }
gstreamer-net = { path = "../gstreamer-net" }
glib-sys = "0.6"
gio-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-rtsp-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-rtsp-server-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-net-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gio = "0.4"
gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-rtsp = { version = "0.11", path = "../gstreamer-rtsp" }
gstreamer-net = { version = "0.11", path = "../gstreamer-net" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-rtsp"
version = "0.11.0"
version = "0.11.6"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Rtsp library"
@ -15,16 +15,16 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gio-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-rtsp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-sdp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gio = { git = "https://github.com/gtk-rs/gio" }
gstreamer = { path = "../gstreamer" }
gstreamer-sdp = { path = "../gstreamer-sdp" }
glib-sys = "0.6"
gobject-sys = "0.6"
gio-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-rtsp-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-sdp-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gio = "0.4"
gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-sdp = { version = "0.11", path = "../gstreamer-sdp" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-sdp"
version = "0.11.0"
version = "0.11.6"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Sdp library"
@ -15,12 +15,12 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-sdp-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-sdp-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer-video"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Video library"
@ -15,14 +15,14 @@ build = "build.rs"
[dependencies]
bitflags = "1.0"
libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
gstreamer-video-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
gstreamer-base = { path = "../gstreamer-base" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-base-sys = { version = "0.5", features = ["v1_8"] }
gstreamer-video-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-base = { version = "0.11", path = "../gstreamer-base" }
[build-dependencies.rustdoc-stripper]
version = "0.1"

View file

@ -190,6 +190,35 @@ impl ::VideoMultiviewFramePacking {
pub struct VideoInfo(pub(crate) ffi::GstVideoInfo);
impl fmt::Debug for VideoInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
let mut b = f.debug_struct("VideoInfo");
b.field("format", &self.format())
.field("width", &self.width())
.field("height", &self.height())
.field("interlace_mode", &self.interlace_mode())
.field("flags", &self.flags())
.field("size", &self.size())
.field("views", &self.views())
.field("chroma_site", &self.chroma_site())
.field("colorimetry", &self.colorimetry())
.field("par", &self.par())
.field("fps", &self.fps())
.field("offset", &self.offset())
.field("stride", &self.stride())
.field("multiview_mode", &self.multiview_mode())
.field("multiview_flags", &self.multiview_flags());
#[cfg(any(feature = "v1_12", feature = "dox"))]
{
b.field("field_order", &self.field_order());
};
b.finish()
}
}
pub struct VideoInfoBuilder<'a> {
format: ::VideoFormat,
width: u32,

View file

@ -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),
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
### Fixed
- 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
(< 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.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.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

View file

@ -1,6 +1,6 @@
[package]
name = "gstreamer"
version = "0.11.0"
version = "0.11.6"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer"
@ -16,10 +16,10 @@ build = "build.rs"
bitflags = "1.0"
cfg-if = "0.1"
libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" }
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" }
glib-sys = "0.6"
gobject-sys = "0.6"
gstreamer-sys = { version = "0.5", features = ["v1_8"] }
glib = "0.5"
num-rational = { version = "0.1.38", default-features = false, features = [] }
lazy_static = "1.0"
futures = { version = "0.1", optional = true }

View file

@ -20,21 +20,6 @@ glib_wrapper! {
}
}
impl BufferPool {
pub fn new() -> BufferPool {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_buffer_pool_new())
}
}
}
impl Default for BufferPool {
fn default() -> Self {
Self::new()
}
}
unsafe impl Send for BufferPool {}
unsafe impl Sync for BufferPool {}

View file

@ -98,6 +98,12 @@ impl Bus {
}
}
pub fn remove_watch(&self) -> bool {
unsafe {
from_glib(ffi::gst_bus_remove_watch(self.to_glib_none().0))
}
}
pub fn set_flushing(&self, flushing: bool) {
unsafe {
ffi::gst_bus_set_flushing(self.to_glib_none().0, flushing.to_glib());

View file

@ -30,21 +30,6 @@ glib_wrapper! {
}
}
impl DeviceMonitor {
pub fn new() -> DeviceMonitor {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_device_monitor_new())
}
}
}
impl Default for DeviceMonitor {
fn default() -> Self {
Self::new()
}
}
unsafe impl Send for DeviceMonitor {}
unsafe impl Sync for DeviceMonitor {}

View file

@ -29,18 +29,6 @@ glib_wrapper! {
}
impl Stream {
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn new<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b Caps>>>(stream_id: P, caps: Q, type_: StreamType, flags: StreamFlags) -> Stream {
assert_initialized_main_thread!();
let stream_id = stream_id.into();
let stream_id = stream_id.to_glib_none();
let caps = caps.into();
let caps = caps.to_glib_none();
unsafe {
from_glib_full(ffi::gst_stream_new(stream_id.0, caps.0, type_.to_glib(), flags.to_glib()))
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn get_caps(&self) -> Option<Caps> {
unsafe {

View file

@ -27,16 +27,6 @@ glib_wrapper! {
}
impl StreamCollection {
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn new<'a, P: Into<Option<&'a str>>>(upstream_id: P) -> StreamCollection {
assert_initialized_main_thread!();
let upstream_id = upstream_id.into();
let upstream_id = upstream_id.to_glib_none();
unsafe {
from_glib_full(ffi::gst_stream_collection_new(upstream_id.0))
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn add_stream(&self, stream: &Stream) -> bool {
unsafe {

View file

@ -390,6 +390,7 @@ impl ToOwned for BufferRef {
impl fmt::Debug for BufferRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Buffer")
.field("ptr", unsafe { &self.as_ptr() } )
.field("pts", &self.get_pts().to_string())
.field("dts", &self.get_dts().to_string())
.field("duration", &self.get_duration().to_string())

View file

@ -205,6 +205,29 @@ impl PartialEq for BufferPoolAcquireParams {
impl Eq for BufferPoolAcquireParams {}
impl BufferPool {
pub fn new() -> BufferPool {
assert_initialized_main_thread!();
let (major, minor, _, _) = ::version();
if (major, minor) > (1, 12) {
unsafe {
from_glib_full(ffi::gst_buffer_pool_new())
}
} else {
// Work-around for 1.14 switching from transfer-floating to transfer-full
unsafe {
from_glib_none(ffi::gst_buffer_pool_new())
}
}
}
}
impl Default for BufferPool {
fn default() -> Self {
Self::new()
}
}
pub trait BufferPoolExtManual {
fn get_config(&self) -> BufferPoolConfig;
fn set_config(&self, config: BufferPoolConfig) -> Result<(), glib::error::BoolError>;

View file

@ -117,6 +117,7 @@ impl fmt::Debug for BufferListRef {
.unwrap_or((::ClockTime::none(), ::ClockTime::none()));
f.debug_struct("BufferList")
.field("ptr", unsafe { &self.as_ptr() } )
.field("buffers", &self.len())
.field("pts", &pts.to_string())
.field("dts", &dts.to_string())

View file

@ -53,7 +53,13 @@ unsafe extern "C" fn trampoline_sync(
let _guard = CallbackGuard::new();
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
let f: &&(Fn(&Bus, &Message) -> BusSyncReply + Send + Sync + 'static) = transmute(func);
f(&from_glib_borrow(bus), &Message::from_glib_borrow(msg)).to_glib()
let res = f(&from_glib_borrow(bus), &Message::from_glib_borrow(msg)).to_glib();
if res == ffi::GST_BUS_DROP {
ffi::gst_mini_object_unref(msg as *mut _);
}
res
}
unsafe extern "C" fn destroy_closure_sync(ptr: gpointer) {

View file

@ -90,7 +90,7 @@ impl GstRc<CapsRef> {
pub fn subtract(caps: Self, other: Self) -> Self {
skip_assert_initialized!();
unsafe { from_glib_full(ffi::gst_caps_subtract(caps.into_ptr(), other.into_ptr())) }
unsafe { from_glib_full(ffi::gst_caps_subtract(caps.as_mut_ptr(), other.as_mut_ptr())) }
}
pub fn truncate(caps: Self) -> Self {
@ -128,6 +128,10 @@ impl CapsRef {
}
pub fn get_structure(&self, idx: u32) -> Option<&StructureRef> {
if idx >= self.get_size() {
return None;
}
unsafe {
let structure = ffi::gst_caps_get_structure(self.as_ptr(), idx);
if structure.is_null() {
@ -141,6 +145,10 @@ impl CapsRef {
}
pub fn get_mut_structure(&mut self, idx: u32) -> Option<&mut StructureRef> {
if idx >= self.get_size() {
return None;
}
unsafe {
let structure = ffi::gst_caps_get_structure(self.as_ptr(), idx);
if structure.is_null() {

View file

@ -0,0 +1,34 @@
// 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 DeviceMonitor;
use ffi;
use glib::translate::*;
impl DeviceMonitor {
pub fn new() -> DeviceMonitor {
assert_initialized_main_thread!();
let (major, minor, _, _) = ::version();
if (major, minor) > (1, 12) {
unsafe {
from_glib_full(ffi::gst_device_monitor_new())
}
} else {
// Work-around for 1.14 switching from transfer-floating to transfer-full
unsafe {
from_glib_none(ffi::gst_device_monitor_new())
}
}
}
}
impl Default for DeviceMonitor {
fn default() -> Self {
Self::new()
}
}

View file

@ -58,6 +58,27 @@ impl From<u32> for Seqnum {
}
}
impl cmp::PartialOrd for Seqnum {
fn partial_cmp(&self, other: &Seqnum) -> Option<cmp::Ordering> {
Some(self.cmp(other))
}
}
impl cmp::Ord for Seqnum {
fn cmp(&self, other: &Seqnum) -> cmp::Ordering {
unsafe {
let ret = ffi::gst_util_seqnum_compare(self.0, other.0);
if ret < 0 {
cmp::Ordering::Less
} else if ret > 0 {
cmp::Ordering::Greater
} else {
cmp::Ordering::Equal
}
}
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct GroupId(pub u32);
pub const GROUP_ID_INVALID: GroupId = GroupId(0);
@ -440,6 +461,7 @@ impl glib::types::StaticType for EventRef {
impl fmt::Debug for EventRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Event")
.field("ptr", unsafe { &self.as_ptr() } )
.field("type", &unsafe {
let type_ = ffi::gst_event_type_get_name((*self.as_ptr()).type_);
CStr::from_ptr(type_).to_str().unwrap()

View file

@ -432,7 +432,7 @@ where
callback_guard!();
let value = value as *const gobject_ffi::GValue;
let func = func as *const &mut (FnMut(T) -> bool);
let func = func as *mut &mut (FnMut(T) -> bool);
let value = &*(value as *const glib::Value);
let value = value.get::<T>().unwrap();
@ -448,7 +448,7 @@ where
for<'a> T: FromValueOptional<'a> + 'static,
{
callback_guard!();
let func = func as *const &mut (FnMut(T));
let func = func as *mut &mut (FnMut(T));
let value = &*(value as *const glib::Value);
let value = value.get::<T>().unwrap();
@ -464,7 +464,7 @@ where
for<'a> T: FromValueOptional<'a> + 'static,
{
callback_guard!();
let func = func as *const &mut (FnMut(U, T) -> Result<U, U>);
let func = func as *mut &mut (FnMut(U, T) -> Result<U, U>);
let value = &*(value as *const glib::Value);
let value = value.get::<T>().unwrap();

View file

@ -128,6 +128,7 @@ mod ghost_pad;
mod child_proxy;
mod tag_setter;
mod iterator;
mod device_monitor;
mod device_provider;
mod parse_context;
mod enums;
@ -169,6 +170,8 @@ pub use clock_time::ClockTime;
mod plugin;
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub mod stream_collection;
#[cfg(any(feature = "v1_10", feature = "dox"))]
mod stream;
mod typefind;
pub use typefind::*;
@ -213,6 +216,10 @@ pub fn init() -> Result<(), glib::Error> {
}
}
pub unsafe fn deinit() {
ffi::gst_deinit();
}
pub const BUFFER_OFFSET_NONE: u64 = ffi::GST_BUFFER_OFFSET_NONE;
pub const CLOCK_TIME_NONE: ClockTime = ClockTime(None);

View file

@ -357,6 +357,7 @@ impl glib::types::StaticType for MessageRef {
impl fmt::Debug for MessageRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Message")
.field("ptr", unsafe { &self.as_ptr() } )
.field("type", &unsafe {
let type_ = ffi::gst_message_type_get_name((*self.as_ptr()).type_);
CStr::from_ptr(type_).to_str().unwrap()

View file

@ -34,7 +34,7 @@ impl<T: MiniObject> GstRc<T> {
ffi::gst_mini_object_ref(ptr as *mut ffi::GstMiniObject);
GstRc {
obj: T::from_mut_ptr(ptr as *mut T::GstType) as *mut T,
obj: ptr as *mut T::GstType as *mut T,
borrowed: false,
phantom: PhantomData,
}
@ -44,7 +44,7 @@ impl<T: MiniObject> GstRc<T> {
assert!(!ptr.is_null());
GstRc {
obj: T::from_mut_ptr(ptr as *mut T::GstType) as *mut T,
obj: ptr as *mut T::GstType as *mut T,
borrowed: false,
phantom: PhantomData,
}
@ -54,7 +54,7 @@ impl<T: MiniObject> GstRc<T> {
assert!(!ptr.is_null());
GstRc {
obj: T::from_mut_ptr(ptr as *mut T::GstType) as *mut T,
obj: ptr as *mut T::GstType as *mut T,
borrowed: true,
phantom: PhantomData,
}
@ -186,6 +186,7 @@ where
unsafe fn from_mut_ptr<'a>(ptr: *mut Self::GstType) -> &'a mut Self {
assert!(!ptr.is_null());
assert_ne!(ffi::gst_mini_object_is_writable(ptr as *mut ffi::GstMiniObject), glib_ffi::GFALSE);
&mut *(ptr as *mut Self)
}

View file

@ -222,6 +222,13 @@ pub trait PadExtManual {
fn query_position<T: SpecificFormattedValue>(&self) -> Option<T>;
fn query_position_generic(&self, format: Format) -> Option<GenericFormattedValue>;
fn get_mode(&self) -> ::PadMode;
fn sticky_events_foreach<F: FnMut(Event) -> Result<Option<Event>, Option<Event>>>(
&self,
func: F,
);
}
impl<O: IsA<Pad>> PadExtManual for O {
@ -850,6 +857,58 @@ impl<O: IsA<Pad>> PadExtManual for O {
}
}
}
fn get_mode(&self) -> ::PadMode {
unsafe {
let stash = self.to_glib_none();
let ptr: &ffi::GstPad = &*stash.0;
from_glib(ptr.mode)
}
}
fn sticky_events_foreach<F: FnMut(Event) -> Result<Option<Event>, Option<Event>>>(
&self,
func: F,
) {
unsafe extern "C" fn trampoline(
_pad: *mut ffi::GstPad,
event: *mut *mut ffi::GstEvent,
user_data: glib_ffi::gpointer,
) -> glib_ffi::gboolean {
let func =
user_data as *mut &mut (FnMut(Event) -> Result<Option<Event>, Option<Event>>);
let res = (*func)(from_glib_full(*event));
match res {
Ok(Some(ev)) => {
*event = ev.into_ptr();
glib_ffi::GTRUE
}
Err(Some(ev)) => {
*event = ev.into_ptr();
glib_ffi::GFALSE
}
Ok(None) => {
*event = ptr::null_mut();
glib_ffi::GTRUE
}
Err(None) => {
*event = ptr::null_mut();
glib_ffi::GFALSE
}
}
}
unsafe {
let mut func = func;
let func_obj: &mut (FnMut(Event) -> Result<Option<Event>, Option<Event>>) = &mut func;
let func_ptr = &func_obj
as *const &mut (FnMut(Event) -> Result<Option<Event>, Option<Event>>)
as glib_ffi::gpointer;
ffi::gst_pad_sticky_events_foreach(self.to_glib_none().0, Some(trampoline), func_ptr);
}
}
}
unsafe extern "C" fn trampoline_pad_probe(

View file

@ -208,6 +208,7 @@ impl glib::types::StaticType for QueryRef {
impl fmt::Debug for QueryRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Query")
.field("ptr", unsafe { &self.as_ptr() })
.field("type", &unsafe {
let type_ = ffi::gst_query_type_get_name((*self.as_ptr()).type_);
CStr::from_ptr(type_).to_str().unwrap()

View file

@ -40,13 +40,13 @@ impl GstRc<SampleRef> {
) -> Self {
assert_initialized_main_thread!();
unsafe {
let info = info.map(|i| i.as_ptr()).unwrap_or(ptr::null());
let info = info.map(|i| ffi::gst_structure_copy(i.as_ptr())).unwrap_or(ptr::null_mut());
from_glib_full(ffi::gst_sample_new(
buffer.to_glib_none().0,
caps.to_glib_none().0,
mut_override(segment.to_glib_none().0),
mut_override(info),
info,
))
}
}
@ -122,3 +122,28 @@ impl fmt::Debug for SampleRef {
unsafe impl Sync for SampleRef {}
unsafe impl Send for SampleRef {}
#[cfg(test)]
mod tests {
#[test]
fn test_sample_new_with_info() {
use GenericFormattedValue;
use Sample;
use Structure;
::init().unwrap();
let info = Structure::builder("sample.info")
.field("f3", &123i32)
.build();
let sample = Sample::new::<GenericFormattedValue>(
None,
None,
None,
Some(info.as_ref()),
);
assert!(sample.get_info().is_some());
}
}

37
gstreamer/src/stream.rs Normal file
View file

@ -0,0 +1,37 @@
// 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 Stream;
use StreamFlags;
use StreamType;
use Caps;
use ffi;
use glib::translate::*;
impl Stream {
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn new<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b Caps>>>(stream_id: P, caps: Q, type_: StreamType, flags: StreamFlags) -> Stream {
assert_initialized_main_thread!();
let stream_id = stream_id.into();
let stream_id = stream_id.to_glib_none();
let caps = caps.into();
let caps = caps.to_glib_none();
let (major, minor, _, _) = ::version();
if (major, minor) > (1, 12) {
unsafe {
from_glib_full(ffi::gst_stream_new(stream_id.0, caps.0, type_.to_glib(), flags.to_glib()))
}
} else {
// Work-around for 1.14 switching from transfer-floating to transfer-full
unsafe {
from_glib_none(ffi::gst_stream_new(stream_id.0, caps.0, type_.to_glib(), flags.to_glib()))
}
}
}
}

View file

@ -8,6 +8,8 @@
use StreamCollection;
use Stream;
use ffi;
use glib::translate::*;
pub struct Iter<'a> {
collection: &'a StreamCollection,
@ -65,6 +67,23 @@ impl<'a> DoubleEndedIterator for Iter<'a> {
impl<'a> ExactSizeIterator for Iter<'a> {}
impl StreamCollection {
pub fn new<'a, P: Into<Option<&'a str>>>(upstream_id: P) -> StreamCollection {
assert_initialized_main_thread!();
let upstream_id = upstream_id.into();
let upstream_id = upstream_id.to_glib_none();
let (major, minor, _, _) = ::version();
if (major, minor) > (1, 12) {
unsafe {
from_glib_full(ffi::gst_stream_collection_new(upstream_id.0))
}
} else {
// Work-around for 1.14 switching from transfer-floating to transfer-full
unsafe {
from_glib_none(ffi::gst_stream_collection_new(upstream_id.0))
}
}
}
pub fn iter(&self) -> Iter {
Iter::new(self)
}

View file

@ -122,7 +122,9 @@ impl fmt::Debug for Structure {
impl fmt::Display for Structure {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.to_string())
// Need to make sure to not call ToString::to_string() here, which
// we have because of the Display impl. We need StructureRef::to_string()
f.write_str(&StructureRef::to_string(self.as_ref()))
}
}
@ -483,6 +485,12 @@ impl StructureRef {
}
}
impl fmt::Display for StructureRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.to_string())
}
}
impl fmt::Debug for StructureRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.to_string())
@ -673,4 +681,15 @@ mod tests {
assert_eq!(s.get::<&str>("f2").unwrap(), "bcd");
assert_eq!(s.get::<i32>("f3").unwrap(), 123i32);
}
#[test]
fn test_string_conversion() {
let a = "Test, f1=(string)abc, f2=(uint)123;";
let s = Structure::from_string(&a).unwrap();
assert_eq!(s.get::<&str>("f1").unwrap(), "abc");
assert_eq!(s.get::<u32>("f2").unwrap(), 123);
assert_eq!(a, s.to_string());
}
}

View file

@ -248,7 +248,7 @@ mod tests {
.cloned()
.find(|f| {
f.get_caps()
.map(|c| c.get_structure(0).unwrap().get_name() == "application/xml")
.map(|c| c.get_structure(0).map(|s| s.get_name() == "application/xml").unwrap_or(false))
.unwrap_or(false)
})
.unwrap();

View file

@ -4,13 +4,13 @@ version = "0.11.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
[dependencies]
glib = { git = "https://github.com/gtk-rs/glib" }
gdk = { git = "https://github.com/gtk-rs/gdk", optional = true }
gtk = { git = "https://github.com/gtk-rs/gtk", features = ["v3_10"], optional = true }
gstreamer = { path = "../gstreamer" }
gstreamer-audio = { path = "../gstreamer-audio" }
gstreamer-video = { path = "../gstreamer-video" }
gstreamer-app = { path = "../gstreamer-app" }
glib = "0.5"
gdk = { version = "0.8", optional = true }
gtk = { version = "0.4", features = ["v3_10"], optional = true }
gstreamer = { version = "0.11", path = "../gstreamer" }
gstreamer-audio = { version = "0.11", path = "../gstreamer-audio" }
gstreamer-video = { version = "0.11", path = "../gstreamer-video" }
gstreamer-app = { version = "0.11", path = "../gstreamer-app" }
send-cell = "0.1"
byte-slice-cast = "0.1"