Commit graph

283 commits

Author SHA1 Message Date
Sebastian Dröge
cc866b53d0 Call the parent impl of various vfuncs if not overridden
This was forgotten for a few types and would require each subclass to
implement them, even if a parent class already provided an
implementation.
2020-06-30 23:46:51 +03:00
Sebastian Dröge
911bb34dc2 Don't generate LAST/NONE variants of flags types
Those are automatically provided already.
2020-06-30 11:35:49 +03:00
Sebastian Dröge
45402b5e95 Add specific version configurations for various enum/flags values
gobject-introspection does not support this yet so we have to do that
manually.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/271
2020-06-30 11:23:37 +03:00
Sebastian Dröge
af01f1bc67 gstreamer: Simplify MiniObject bindings by removing one layer of abstraction
And instead directly implementing this via the macro on the target
types.
2020-06-30 11:06:02 +03:00
Sebastian Dröge
8dfbc9e811 Regenerate 2020-06-19 13:09:11 +03:00
Guillaume Desmottes
7b2fe31cc1 update gir generator and regenerate 2020-06-11 12:33:49 +02:00
Guillaume Desmottes
6cd711cfdf subclass: clean up subclassing prelude/re-exports
Use re-export pattern from glib.

Fix #255
2020-06-09 14:36:37 +02:00
Guillaume Desmottes
1b0a20e52f regenerate 2020-06-03 20:04:18 +03:00
Sebastian Dröge
781c5785b1 Regenerate 2020-05-05 17:29:14 +00:00
Vivia Nikolaidou
ec4a43be89 Regenerate 2020-05-03 16:48:35 +03:00
Sebastian Dröge
90a4918f92 gstreamer-base/aggregator: Add subclassing support for new 1.18 virtual methods 2020-05-03 16:48:35 +03:00
Vivia Nikolaidou
0aeccc27ff gstreamer-base/aggregator: Implement update_segment manually 2020-05-03 16:48:35 +03:00
Vivia Nikolaidou
118c7d4ad9 Regenerate 2020-04-30 17:16:23 +03:00
Guillaume Desmottes
872024c372 fix option_as_ref_deref clippy warnings 2020-04-21 09:00:35 +02:00
Sebastian Dröge
185eb188ca Fix various signal handler trampoline usages 2020-04-13 19:24:04 +03:00
Sebastian Dröge
5021994237 Regenerate everything 2020-04-13 19:11:33 +03:00
Sebastian Dröge
76a0410d41 Replace unneeded transmute calls with a safer alternative 2020-04-12 19:47:49 +03:00
Sebastian Dröge
d1665b8114 Regenerate with latest gir 2020-04-12 18:55:06 +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
d3e93f172f gstreamer-base/basetransform: Rename PreparedOutputBuffer and GeneratedOutput enums
PrepareOutputBufferSuccess and GenerateOutputSuccess is more consistent
with what we do elsewhere.
2020-04-02 19:58:47 +03:00
Sebastian Dröge
2006bd51cc gstreamer-base: Add pushsrc subclassing bindings
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/244
2020-04-02 19:58:42 +03:00
Sebastian Dröge
13411b7461 gstreamer-base: Add basesrc alloc() vfunc 2020-04-02 19:58:42 +03:00
Sebastian Dröge
68332e854e gstreamer-base: Add get_allocator() functions to aggregator, basesrc and basetransform base classes 2020-04-02 19:58:42 +03:00
Sebastian Dröge
0b0544da63 gstreamer-base/basesrc: Add support for filling the passed in buffer in the create function
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/242
2020-04-02 19:58:42 +03:00
Sebastian Dröge
b21f576430 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-02-28 16:29:48 +02:00
Sebastian Dröge
98ecef7153 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-02-27 12:10:14 +02:00
Sebastian Dröge
e0a71563ba 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-02-22 18:55:56 +02:00
Sebastian Dröge
870978e286 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-09 21:22:04 +02:00
Sebastian Dröge
09212add47 base/base_transform: Add before_transform/copy_metadata/transform_meta support for subclasses 2020-02-09 20:45:29 +02:00
Sebastian Dröge
e63e8b81ff base/base_transform: Add submit_input_buffer/generate_output support for subclasses
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/155
2020-02-09 20:22:54 +02:00
Sebastian Dröge
420150a4e3 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-09 18:22:45 +02:00
Sebastian Dröge
196a9891cb Regenerate with latest gir
This switches the RTP constant strings over to once_cell::Lazy
2020-01-22 19:57:41 +02: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
Sebastian Dröge
ad24ab9638 Regenerate everything with latest gir 2019-01-21 22:00:48 +02:00
Sebastian Dröge
bfcdec782e Switch to stable rustfmt and add skip annotations for the generated code to the lib.rs 2019-01-16 17:10:01 +02:00
Sebastian Dröge
43ec33a1db Remove some code that is nowadays generated by the glib_wrapper! macro 2019-01-16 15:23:53 +02:00
Sebastian Dröge
58ccf666a6 Change some const raw pointers to mutable
We cast them to a mutable pointer of another type right afterwards
anyway.
2019-01-16 13:52:56 +02:00
Sebastian Dröge
931c485150 Update manual code for glib API changes 2019-01-16 13:52:56 +02:00
Sebastian Dröge
6da0a9d169 Regenerate everything with latest gir 2019-01-16 13:32:39 +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
François Laignel
3200574d31 Update to latest gir
See https://github.com/gtk-rs/gir/pull/687
2019-01-04 16:02:40 +01:00
Philippe Normand
9534416760 Regenerate and fix manual bindings for GString support 2019-01-03 22:01:41 +00:00
Sebastian Dröge
9665a89940 adapter: Add a UniqueAdapter wrapper
This implements Send/Sync and for allowing this safely it provides no
reference counting and requires a mutable reference for all mutable
operations.

It also provides safe access to the Adapter::map() function as without
reference counting we can ensure that nothing else is invalidating the
returned memory while it's still being accessed.
2019-01-03 11:24:52 +02:00
Sebastian Dröge
90c86e0031 flow_combiner: Add a UniqueFlowCombiner wrapper
This implements Send/Sync and for allowing this safely it provides no
reference counting and requires a mutable reference for all mutable
operations.
2019-01-03 11:11:48 +02:00
Sebastian Dröge
6bba3d8518 Add 'static trait bound to all ExtManual traits and get rid of trait bounds for their impls 2018-12-08 14:58:14 +02:00
Sebastian Dröge
5c93e134a7 Regenerate everything with new version of gir 2018-12-08 14:58:14 +02:00
Sebastian Dröge
8eb4b879fc Port Aggregator subclassing 2018-11-21 17:03:59 +02:00
Sebastian Dröge
2bc6efa893 Port AggregatorPad subclassing 2018-11-21 17:03:59 +02:00
Sebastian Dröge
411319198a Port BaseTransform subclassing 2018-11-21 17:03:59 +02:00
Sebastian Dröge
2f90961ef1 Port BaseSink subclassing 2018-11-21 16:14:06 +02:00
Sebastian Dröge
771defa377 Port BaseSrc subclassing 2018-11-21 16:14:06 +02:00
Sebastian Dröge
06d654760d Implement glib::SendUnique on Adapter
It can be safely sent between threads as long as all references are in
the same thread.
2018-11-10 13:27:37 +02:00
Sebastian Dröge
f31827f194 Regenerate with latest gir
Gets rid of some unneeded property notification functions in GES
2018-11-05 11:18:31 +02:00
Víctor Manuel Jáquez Leal
60c9cdfda1 Update autogenerated code with latest gir 2018-10-31 17:33:15 +02:00
Sebastian Dröge
8f71a81cb5 Regenerate with latest gir to get rid of unneeded notify signal connectors for construct-only properties 2018-10-03 13:57:07 +03:00
Sebastian Dröge
3c900e6102 Regenerate with latest gir 2018-08-18 00:25:12 +03:00
Sebastian Dröge
9e90a1264f Add getter for the aggregator pad segment 2018-08-01 19:24:54 +03:00
Sebastian Dröge
c7fa48984e Aggregator is only available from gstreamer-base since 1.14 2018-07-31 00:05:40 +03:00
Sebastian Dröge
2d97d96874 Add bindings for basetransform/src get_buffer_pool() 2018-07-30 12:55:41 +03:00
Sebastian Dröge
5df360a983 Add bindings for aggregator and aggregagor pad 2018-07-30 12:55:41 +03:00
Sebastian Dröge
2240ef109f Regenerate with latest GIR and update for the glib::Quark changes 2018-07-30 11:46:40 +03:00
Sebastian Dröge
33a6aab6d7 Run everything through latest rustfmt 2018-07-27 13:36:40 +03: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
2085d170be Get rid of callback_guard! as unwinding through FFI is defined behaviour now and aborts 2018-06-24 14:42:11 +03:00
Sebastian Dröge
1192a027b4 Regenerated with latest GIR and GIR files 2018-05-21 11:55:19 +03:00
Sebastian Dröge
2cefd9aea6 Re-run everything through rustfmt 2018-04-25 11:13:14 +03:00
Sebastian Dröge
46d27e3e75 Regenerate everything with latest GIR 2018-04-23 20:45:15 +03:00
Sebastian Dröge
9a3ef2e9f1 Regenerate with latest GIR and update for the non-bitflags flags in -sys now 2018-04-04 10:47:12 +03:00
Sebastian Dröge
492c3d656c Run everything through rustfmt again 2018-04-01 11:57:58 +03:00
Sebastian Dröge
a33fd41d02 Regenerate everything with latest gir 2018-03-20 11:52:29 +02:00
Sebastian Dröge
99d4fe0925 Update gstreamer-base 2018-03-19 10:32:07 +02:00
Sebastian Dröge
a3b294f0f2 Add back callback guards 2018-03-02 21:34:29 +02:00
Sebastian Dröge
808ff293ec Regenerate everything with latest gir 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
08dbde4c0e Add getters for the BaseSrc/Sink/Transform configured segment 2018-02-12 10:44:44 +02:00
Sebastian Dröge
6d0d7a3df8 Regenerate everything with latest GIR 2018-02-06 16:42:34 +02:00
Sebastian Dröge
917255de89 Add typefind helper bindings 2017-12-18 10:05:42 +02:00
Sebastian Dröge
8a2e78e586 Regenerate with latest GIR to fix various issues with property getters
Get rid of unneeded transmutes and actually initialize flags/enum
GValues with the correct type instead of using integers.
2017-11-27 19:16:34 +02:00
Sebastian Dröge
c39c0c7264 Implement ClockTime as ClockTime(Option<u64>)
And also implement a FormatValue type that holds a value together with
its format to make usage of the positions/durations/seek positions/etc
more convenient and safe.

Fixes https://github.com/sdroege/gstreamer-rs/issues/3
2017-11-11 11:57:29 +01:00
Sebastian Dröge
5d266bf31b Regenerate with latest GIR
Which gives us mappings between instance and class struct for now.
2017-11-09 13:33:40 +02:00
Sebastian Dröge
2f7ee30aa1 Implement std::io::Read on Adapter
Patch based on the one from Thibault Saunier for gst-plugin-rs's Adapter
2017-11-06 14:53:34 +02:00
Sebastian Dröge
3179806f01 Regenerate everything with latest GIR
And fix-up manual code
2017-11-05 19:08:39 +02:00
Sebastian Dröge
e1d134c4be Run everything through latest rustfmt-nightly 2017-10-17 12:06:51 +03:00
Sebastian Dröge
2e2dd95365 Re-export gst_base::FlowCombiner again from the module 2017-10-11 13:52:49 +03:00
fengalin
44130794f1 gstreamer-base: use g_boxed_copy/free for GstFlowCombiner
This avoids depending on gst_flow_combiner_ref/unref which were
introduced in gstreamer-1.12.1.

Fixes https://github.com/sdroege/gstreamer-rs/pull/40
2017-10-11 11:29:35 +03:00
Sebastian Dröge
19c5556239 Regenerate with latest GIR 2017-10-01 15:52:15 +02:00
Sebastian Dröge
b4cb81cd56 Run everything through latest rustfmt-nightly 2017-09-10 15:21:26 +03:00
Sebastian Dröge
357d98bf3a Remove unused extern crate libc from gstreamer-base 2017-09-10 13:53:03 +03:00
Sebastian Dröge
160fd103c0 Add initial bindings for GStreamer base library
https://github.com/sdroege/gstreamer-rs/issues/7
2017-09-10 00:36:47 +03:00