Skip to content
Commits on Source (4)
......@@ -439,6 +439,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 +713,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 +845,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]
......
......@@ -64,3 +64,8 @@ trait = false
name = "GstNet.NetTimeProvider"
status = "generate"
trait = false
[[object.function]]
name = "new"
# Floating reference handling
ignore = true
......@@ -5,6 +5,21 @@ 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.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
......@@ -247,7 +262,9 @@ 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.11.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...HEAD
[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
......
[package]
name = "gstreamer-app"
version = "0.11.1"
version = "0.11.2"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer App library"
......
......@@ -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()
}
......
......@@ -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) {
......
......@@ -5,6 +5,21 @@ 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.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
......@@ -247,7 +262,9 @@ 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.11.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...HEAD
[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
......
[package]
name = "gstreamer-audio"
version = "0.11.1"
version = "0.11.2"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Audio library"
......
......@@ -5,6 +5,21 @@ 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.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
......@@ -247,7 +262,9 @@ 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.11.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...HEAD
[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
......
[package]
name = "gstreamer-base"
version = "0.11.1"
version = "0.11.2"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base library"
......
......@@ -5,6 +5,21 @@ 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.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
......@@ -247,7 +262,9 @@ 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.11.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...HEAD
[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
......
[package]
name = "gstreamer-net"
version = "0.11.1"
version = "0.11.2"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Net library"
......
......@@ -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());
......
......@@ -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;
......
// 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))
}
}
}
}
......@@ -5,6 +5,21 @@ 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.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
......@@ -247,7 +262,9 @@ 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.11.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...HEAD
[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
......
[package]
name = "gstreamer-pbutils"
version = "0.11.1"
version = "0.11.2"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base Utils library"
......
......@@ -5,6 +5,21 @@ 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.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
......@@ -247,7 +262,9 @@ 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.11.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...HEAD
[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
......
[package]
name = "gstreamer-player"
version = "0.11.1"
version = "0.11.2"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Player library"
......
......@@ -5,6 +5,21 @@ 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.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
......@@ -247,7 +262,9 @@ 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.11.0...HEAD
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...HEAD
[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
......