Commit graph

107 commits

Author SHA1 Message Date
Sebastian Dröge 4e30798ac7 Add #[must_use] attribute to mutex guards / stream lock
It's usually a mistake if creating one of these and immediately dropping
them again as that would immediately unlock the mutex again.
2020-03-09 22:49:51 +02:00
Sebastian Dröge ed80467ff6 Make sure to hold MutexGuard for the remainder of the function in various places
Not assigning it to a variable would cause it to be dropped immediately
and the lock to be released again immediately.
2020-03-09 22:49:50 +02:00
Sebastian Dröge d429fad50d gstreamer/base_transform: Add support for implementing prepare_output_buffer()
This requires some acrobatics due to inconsistent ownership handling of
the buffers on the C side.
2020-03-09 22:42:35 +02:00
Sebastian Dröge a61c50c21a base/base_transform: Fix minor clippy warning
warning: called `map(f)` on an Option value where `f` is a unit closure
   --> gstreamer-base/src/subclass/base_transform.rs:683:13
    |
683 | /             (*parent_class)
684 | |                 .before_transform
685 | |                 .map(|f| f(element.to_glib_none().0, inbuf.as_ptr() as *mut _));
    | |_______________________________________________________________________________^
    |
    = note: `#[warn(clippy::option_map_unit_fn)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
2020-02-15 10:14:54 +01:00
Sebastian Dröge e6d3ac4e4b base/base_transform: Add before_transform/copy_metadata/transform_meta support for subclasses 2020-02-15 10:14:46 +01:00
Sebastian Dröge 89b9dc80dc base/base_transform: Add submit_input_buffer/generate_output support for subclasses
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/155
2020-02-15 10:14:41 +01:00
Sebastian Dröge 0ffd86c37e base/flow_combiner: UniqueFlowCombiner::clear() should take &mut self
It's modifying the state of the combiner and requires a unique, mutable
reference.
2020-02-15 10:13:40 +01:00
Sebastian Dröge 12416a4031 gstreamer-base: Require &mut self for BaseParseFrame functions that modify it
And add non-mutable getters for input/output buffer
2019-12-18 18:38:29 +02:00
Sebastian Dröge 2ba5105b80 Implement Sync/Send for more types and don't implement Send for TypeFind
They can actually be shared with multiple threads at the same time
safely as all functions requiring an immutable reference are
thread-safe.

OTOH TypeFind can't be shared safely between different threads as not
all implementations of the TypeFind struct are thread-safe.
2019-12-18 18:37:44 +02:00
Hans Ole Hatzel 14a55dc73d gstreamer-base/basesink: Provide default implementation for render
We need some classes derived from `BaseSink` to not enforce render being
implemented.

An example of this is AudioSink which only requires the user to
implement `write` but not `render`, so the default implementation
of render needs to be called.
2019-12-18 15:14:35 +02:00
Sebastian Dröge be3c378f28 Use Results instead of Options where they signal an error instead of just a missing value
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 22:21:28 +02:00
Tony Jinwoo Ahn 62c0b689a6 gstreamer-base/{adapter,functions}, gstreamer-video/video_info: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-16 11:29:51 +00:00
Sebastian Dröge eaafbd14f7 Regenerate 2019-12-15 12:19:33 +02:00
Sebastian Dröge 90854eb047 base/basesrc: Add bindings for BaseSrc::get_times()
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/228
2019-12-10 19:49:36 +02:00
Sebastian Dröge f417d68820 Remove usage of glib_floating_reference_guard!()
It's not needed anymore.
2019-12-07 23:05:14 +02:00
Sebastian Dröge 175863668d Regenerate everything with latest gir 2019-11-21 09:52:51 +02:00
Sebastian Dröge a783280dcf base/basetransform: Update BaseTransformImpl::set_caps() return type for consistency
In all other base classes it is a Result instead of a bool, so do the
same here.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/225
2019-11-21 00:02:23 +02:00
Guillaume Gomez 9e30687d8e Fix glib reexports 2019-11-11 11:34:09 +01:00
Guillaume Gomez 457ac9118b Regenerate with latest gir 2019-11-11 11:34:09 +01:00
Sebastian Dröge 2d2459ed52 Export traits from the crate level and ensure that all traits are in the preludes 2019-10-17 13:30:35 +03:00
Sebastian Dröge 991f2e1576 Update and regenerate everything with latest gir 2019-10-05 00:03:57 +03:00
Sebastian Dröge 52509b4b95 Remove subclassing feature and make it the default 2019-09-09 11:51:07 +03:00
Sebastian Dröge 85d01e853e baseparse/transform/aggregator: Add constants for custom flow returns 2019-08-14 20:26:22 +03:00
François Laignel 514a05accd Manual update for new Value::get signature 2019-08-13 10:57:32 +02:00
François Laignel 5d012945df Regen 2019-08-11 10:43:30 +02:00
Sebastian Dröge d8325212f4 Fix various clippy warnings 2019-07-11 22:02:01 +03:00
Sebastian Dröge 3a8d05075d Switch everything from mem::uninitialized() to MaybeUninit or mem::zeroed()
And also fix a few cases where mem::uninitialized() was simply wrong to
use.
2019-07-11 17:56:50 +03:00
Sebastian Dröge bde6a04780 Regenerate everything with latest gir 2019-07-10 11:21:28 +03:00
Sebastian Dröge 47f0940b44 Regenerate everything with latest gir 2019-06-24 20:52:03 +03:00
Sebastian Dröge b87ffa17bb Run rustfmt also over all the generated code 2019-06-18 13:12:00 +03:00
Sebastian Dröge e5aa6f59f9 Regenerate everything 2019-06-18 13:10:46 +03:00
Guillaume Desmottes c774bd8114 base: add bindings for GstBaseParse
Fix #157
2019-06-01 13:04:12 +05:30
Sebastian Dröge 86e969d964 Remove various Into<Option<_>> trait bounds from functions
In autogenerated code these were already replaced but some manual code
still kept them.
2019-05-24 10:04:16 +00:00
Sebastian Dröge 6cef32a4dd Change various mini object references to references to the refcounted object
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/204
2019-05-24 10:04:16 +00:00
Sebastian Dröge a986914bad Use Option<&T> instead of &Option<T> everywhere
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/203
2019-05-22 23:27:13 +03:00
Sebastian Dröge 88dcb82c8d Regenerate everything for 1.16.0 2019-04-23 19:15:53 +03:00
Sebastian Dröge 5c32a0d1d3 Update manual code and configuration for 1.16 2019-04-23 19:15:53 +03:00
Sebastian Dröge e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge 24305a19e8 Regenerate everything with latest gir 2019-04-15 18:38:05 +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 8754e4220e Regenerate everything with latest gir 2019-02-22 11:55:16 +02:00
François Laignel e24efa7259 gstreamer-base: subclassing: move parent fn in dedicated trait (!231) 2019-02-13 11:53:14 +00:00
François Laignel 37b717c020 gstreamer-base: add parent_xxx impl for all vfunc 2019-02-03 08:41:20 +00:00
François Laignel ac00608b7e gstreamer-base: fix parent vfunc invocations when needed
Fixes #180
2019-02-03 08:41:20 +00:00
Sebastian Dröge 00cbd49923 Regenerate with latest gir 2019-01-29 16:28:51 +02:00
François Laignel 7cb1dc9cb4 gstreamer-base: update signatures to Result<(), glib::BoolError>
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/175
2019-01-27 09:36:56 +00:00
François Laignel c65214b207 gstreamer-base: update signatures to Result<(), ErrorMessage>
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/175
2019-01-27 09:36:56 +00:00
François Laignel 5d1a839558 gstreamer-base: update signatures to Result<(), LoggableError>
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/175
2019-01-27 09:36:56 +00:00
Sebastian Dröge bd0cbe99b3 Add more Debug impls to everything possible 2019-01-22 17:46:08 +02:00