Commit graph

57 commits

Author SHA1 Message Date
Bilal Elmoussaoui 4ebec84f5e Adapt to no longer renamed ffi crates
Allows us to set all the crates in the main workspace file, so changing
their versions or branch is much simpler and reduce the amount of noise
in the diff

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
2024-06-02 11:20:55 +02:00
Sebastian Dröge 193bcbf055 Switch from once_cell to std::sync::OnceLock where it makes sense
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1379>
2024-01-31 14:59:54 +02:00
Sebastian Dröge 84ca72a833 gstreamer: audiofilter: Add parent_allowed_caps()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1356>
2023-12-05 11:20:24 +02:00
Sebastian Dröge ca8309a5dd Simplify various raw pointer casts everywhere
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1353>
2023-11-29 11:24:47 +02:00
Bilal Elmoussaoui 8cf099f0ab Seal manual traits
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1292>
2023-07-06 14:21:45 +03:00
Sebastian Dröge 8d30bcbf4b Use IntoGlibPtr trait instead of to_glib_full() where appropriate to reduce unnecessary refcounting/copying
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1183>
2023-01-05 12:09:57 +02:00
Sebastian Dröge 567ce0a3bf Group and merge imports in all manual code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1182>
2023-01-04 13:25:17 +02:00
Arun Raghavan c3a950f207 audio: Add bindings for GstAudioFilter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1165>
2022-12-13 12:27:05 -05:00
Sebastian Dröge 90b8ee2022 Move from imp.instance() to imp.obj()
It's doing the same thing and is shorter.
2022-10-23 23:06:44 +03:00
Sebastian Dröge f17781e188 Change *Impl trait methods to only take &self and not Self::Type in addition 2022-10-10 15:01:07 +03:00
Guillaume Gomez c1d3ed5eac Use IntoGlibPtr trait instead of implementing into_ptr 2022-05-07 13:38:11 +02:00
Sebastian Dröge 4651c9db4d Update minimum supported version to 1.14
This is the version that is available in Ubuntu 18.04.
2022-04-07 12:45:47 +03:00
Sebastian Dröge 5c14350079 audio: Add subclassing bindings for audioaggregator 2022-04-01 11:04:08 +03:00
Sebastian Dröge 0173b73170 Handle empty slices correctly
Passing `NULL` to `slice::from_raw_parts` is invalid.
2022-02-07 12:50:37 +02:00
Sebastian Dröge 5e2249d368 message/query/event: Implement views in a more consistent way
Co-authored-by: Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
2022-01-19 13:29:59 +02:00
Sebastian Dröge bbcd221e8d Change from impl_() to imp() 2021-12-28 17:50:06 +02:00
Sebastian Dröge 5a75f3bf8e Don't post error messages in subclasses on propose/decide_allocation() errors and BaseParse::set_sink_caps()
Instead just log the error and return false.
2021-12-06 18:41:39 +02:00
Sebastian Dröge 7f0ca0011c Add gst::GstObjectImpl, gst::ProxyPadImpl, gst_audio::AudioBaseSrc, gst_audio::AudioBaseSink subclassing traits
These were missing from the type hierarchy previously and are now
required because of more strict checks in the GLib bindings.
2021-10-23 11:59:03 +03:00
Sebastian Dröge 12fec484c7 Simplify IsSubclassable trait impls 2021-10-23 11:27:46 +03:00
Sebastian Dröge f6cf6c8863 Improve subclass decide_allocation() / propose_allocation() API
The queries passed in are always allocation queries, so don't require
implementors to match on that first.
2021-10-16 14:24:08 +03:00
Sebastian Dröge b1afc4804a Fix various needless-borrow clippy warnings 2021-07-30 13:19:24 +03:00
François Laignel e31ce9d07b Manual ClockTime updates 2021-06-04 22:09:38 +02:00
François Laignel 8dda8def6e Manual try_from_glib shortcuts + unsafe 2021-06-04 22:09:38 +02:00
François Laignel 5505715cc4 Manual code updates for *Return types 2021-05-04 11:33:51 +00:00
Marijn Suijten 980304ce36 Replace T::type_data with Self::type_data for clippy::use_self 2021-04-30 10:02:55 +02:00
Marijn Suijten f89e840d27 Remove redundant prelude imports
When importing the prelude of a crate like `gst` the `glib` prelude is
provided too.  Shedding these imports saves quite a few lines and
adheres to keeping it simple; we're not reexporting base/parent preludes
for no reason :)
2021-04-29 12:05:13 +02:00
Marijn Suijten e6a81edb3c prelude: Remove redundant reexports already provided by other preludes
For cleanliness the prelude module only needs to reexport preludes from
direct, "top-most" crates, which themselves take care of reexporting
preludes from its dependencies again.  This shaves off some code while
maintaining the same set of exports.
2021-04-29 11:44:35 +02:00
Bilal Elmoussaoui 890cd03632 manual renames of to_glib into into_glib 2021-04-27 19:44:41 +02:00
François Laignel 6ab9164dca fix-getters-calls 0.3.0 pass 2021-04-20 18:18:02 +02:00
François Laignel b8b944b72b subclass: remove get prefix where applicable 2021-04-20 18:18:02 +02:00
François Laignel 53be8e5f58 fix-getters-{def,calls} pass 2021-04-13 17:54:40 +02:00
Sebastian Dröge ea239c587e Store panic information not in a custom instance struct but in the instance data provided by the subclassing infrastructure
This scales better as there will only be only such data instead of two
or more when having deeper class hierarchies with multiple Rust
elements, and also makes it unnecessary to use a special instance struct
so the default works well.
2021-03-09 16:36:35 +02:00
Sebastian Dröge 6fa48890bc Update for the subclassing glib bindings API changes 2021-03-09 16:04:32 +02:00
Sebastian Dröge 0803dd411e Update for glib subclass API cleanup 2021-03-08 12:18:24 +02:00
Sebastian Dröge 68839c0e79 Re-export all dependency crates and their preludes
This makes code in examples potentially simpler.
2020-12-20 19:40:34 +02:00
Sebastian Dröge 53aae7ddba Remove gst_ prefix from all macros except for the logging macros
The latter stay e.g. gst_debug! to be more clear and not conflict with
e.g. the debug! macro from the log crate.
2020-12-20 19:40:34 +02:00
Guillaume Gomez ff5a36561a Fix license header situation 2020-12-15 11:53:31 +01:00
Sebastian Dröge 4a928136ed gstreamer-audio: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
Sebastian Dröge 29c9bcf667 gstreamer-audio: Make virtual methods take wrapper of type, not parent 2020-11-14 19:39:27 +02:00
Sebastian Dröge b91123d298 Simplify IsSubclassable::override_vfunc() implementations 2020-11-05 17:12:06 +00:00
Sebastian Dröge 99fbbc32cb Use glib::Class instead of glib::object::Class 2020-11-05 17:12:06 +00:00
Sebastian Dröge 027de84349 Update for class struct handling changes in the glib bindings
See https://github.com/gtk-rs/gtk-rs/pull/10
2020-11-05 16:41:48 +02:00
Sebastian Dröge 4f5b2f5060 Update for removal of ObjectImpl::get_type_data() 2020-07-26 18:02:05 +03:00
Sebastian Dröge 9cc99b27e0 gstreamer/element: Let post_message() and post_error_message() take ownership of the message
This is more in line with the C API and simplifies callers in Rust.
2020-06-30 23:55:02 +03:00
Sebastian Dröge 03893f895c audio/sink,src: Add support for overriding reset vfunc 2020-06-30 23:46:51 +03:00
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 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
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
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 da8187b016 gstreamer-audio: Add subclassing bindings for AudioSrc 2019-12-18 16:07:32 +02:00