Commit graph

39 commits

Author SHA1 Message Date
Guillaume Gomez ff5a36561a Fix license header situation 2020-12-15 11:53:31 +01:00
Sebastian Dröge 5a70dd1756 gstreamer-app: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
François Laignel 9efe39ff81 ClockTime: add staturating_{add,sub} and ops tests 2020-10-20 23:40:18 +02:00
Sebastian Dröge 947ac8db5c Name functions returning a builder builder(), not new()
And also make the video event API more consistent with the normal event
API.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/269
2020-06-25 19:42:33 +03:00
Sebastian Dröge 93bc5c9324 gstreamer/gstreamer-app: Don't store strong references in futures Stream/Sink adapters
This applies to the ones of the appsink, appsrc and bus. If we would
store a strong reference then they would keep alive the underlying
object forever even if their pipeline disappeared in the meantime.

Like this e.g. the bus stream would start returning None once the bus
was destroyed, similar to how other channels are working in Rust.
2020-05-13 22:13:11 +03:00
Sebastian Dröge 185eb188ca Fix various signal handler trampoline usages 2020-04-13 19:24:04 +03:00
Sebastian Dröge 76a0410d41 Replace unneeded transmute calls with a safer alternative 2020-04-12 19:47:49 +03:00
Guillaume Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge 019afd54f9 Update for new from_glib_borrow signature
See https://github.com/gtk-rs/glib/pull/605
2020-04-05 18:48:48 +03:00
Sebastian Dröge b1b0103b3b app: Handle panicking callbacks by converting into an error message
And never calling the callbacks again but instead just failing.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/241
2020-03-05 14:05:36 +00:00
Sebastian Dröge d58cf01e3a Allow changing bus sync handler and appsink/src callbacks when running with 1.16.3 or newer
Previously it was not thread-safe to change them and could lead to
crashes but with 1.16.3 it is now.

Unsetting the bus sync handler before 1.16.3 will have no effect at all,
setting a new bus sync handler or appsink/src callbacks will panic.

This partially reverts 2f88dc6576
2020-02-15 10:25:19 +01:00
Sebastian Dröge 2f88dc6576 Only allow setting Bus sync handler and AppSrc/Sink callbacks once
Re-setting them is not thread-safe and can cause segfaults or worse.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/506
and https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/729
2020-02-09 21:37:03 +02:00
Valmir Pretto c0bab74e68 gstreamer-app: AppSink futures adapter
An adapter for AppSink that adds futures capabilities to it in the form of a Stream.
2020-02-04 10:53:04 -03:00
Valmir Pretto 7663589d94 gstreamer: BusStream cleanup
A few small readability changes
2020-02-04 10:33:25 -03:00
jerry73204 a26738bc41 appsink: Use FnMut instead of Fn for callbacks
They can only be called from a single thread at once.
2019-10-31 16:05:59 +01:00
Sebastian Dröge d1e562b9f6 Explicitly add dyn keyword to trait objects
Trait objects without are deprecated with the latest nightly and this
makes it more clear that we're doing dynamic dispatch anyway.
2019-06-06 09:09:34 +03:00
Sebastian Dröge d460310ed1 appsink: Properly mark appsink callbacks as Send-only
They can only be called from a single thread at a time, unlike some of
the appsrc callbacks.

This change was partially done in 062403bdac
but a part was missing.
2019-04-24 15:44:55 +03:00
Sebastian Dröge e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge 86a31b4139 Silence/fix various clippy warnings 2019-03-07 14:05:35 +02:00
Sebastian Dröge 8c39da4e5b Update to Rust 1.31 linter-specific attributes 2019-03-04 15:16:01 +02:00
Sebastian Dröge 95f6844702 Fix various minor clippy warnings 2019-02-21 19:56:23 +02:00
Sebastian Dröge 1adb063fbc Don't box closures twice for signal callback closures 2019-01-29 19:24:26 +02:00
Sebastian Dröge 931c485150 Update manual code for glib API changes 2019-01-16 13:52:56 +02:00
François Laignel 948fb2ae4b Replace XXXReturn with Result<XXXSuccess, XXXError>
... in function signatures.

These breaking changes aim at improving usability by allowing users
to take advantage of Rust error management features sur as `ok_or`,
`map_err`, `expect` and the `?` operator. See the `examples` and
`tutorials` to get an idea of the impacts.
2019-01-11 18:33:04 +01:00
Sebastian Dröge 694bcaa697 Fix all clippy warnings
Or silence the ones we don't care about.
2018-07-20 10:28:20 +03:00
Sebastian Dröge e0972ae1e5 Get rid of manual usage of callback_guard! 2018-06-24 14:52:50 +03:00
Sebastian Dröge 2cefd9aea6 Re-run everything through rustfmt 2018-04-25 11:13:14 +03:00
Sebastian Dröge 062403bdac 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-04-25 11:13:14 +03:00
Sebastian Dröge 492c3d656c Run everything through rustfmt again 2018-04-01 11:57:58 +03:00
Sebastian Dröge a3b294f0f2 Add back callback guards 2018-03-02 21:34:29 +02:00
Sebastian Dröge f1426c82ba Remove callback guards
Since Rust 1.24 it is safe to let panics go to the FFI boundary
2018-02-17 19:58:41 +02:00
Sebastian Dröge 8a807c4265 Implement Send+Sync for AppSink/SrcCallbacks 2017-12-16 14:14:29 +02:00
Sebastian Dröge 396dae666f Make appsink/appsrc callbacks builder more consistent with other code
Move the constructor of the builder to the main type
2017-12-16 11:37:00 +02:00
Sebastian Dröge 49a6eb6a1f Replace AppSrcCallbacks/AppSinkCallbacks with a builder so that no empty closures have to be provided for unused callbacks 2017-12-10 15:19:44 +02:00
Sebastian Dröge c06c12dc87 Free memory of the correct type for the callback structs in appsink/appsrc 2017-11-11 16:38:54 +01:00
Sebastian Dröge 3b0e6843e2 Regenerate everything with latest GIR 2017-09-09 16:35:01 +03:00
Sebastian Dröge f05df73088 Add various gst_init() assertions to video/app bindings
audio and core should come next.

Also print something more meaningful than using assert_eq!().
2017-08-30 12:48:01 +03:00
Sebastian Dröge d7baadee22 Fix various other compiler/clippy warnings 2017-08-02 20:09:00 +03:00
Sebastian Dröge 7ff8a5c460 Finish appsink bindings 2017-08-01 17:52:11 +03:00