Commit graph

46 commits

Author SHA1 Message Date
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 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
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 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 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 7e71c74505 base: Add support for propose_allocation()/decide_allocation() in the base classes 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 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
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 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 88a7c18746 gstreamer-base: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
Sebastian Dröge 145f0ed6f5 gstreamer-base: 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 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 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
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 f417d68820 Remove usage of glib_floating_reference_guard!()
It's not needed anymore.
2019-12-07 23:05:14 +02: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 e7898c1b24 Update manual code 2019-04-15 19:19:19 +03: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
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 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
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 2f90961ef1 Port BaseSink subclassing 2018-11-21 16:14:06 +02:00