Commit graph

44 commits

Author SHA1 Message Date
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
b8c20c07ce Update for new #[glib::object_subclass] attribute macro 2021-03-07 13:08:06 +02:00
Sebastian Dröge
a316d610eb gstreamer: Update for glib::Type API changes 2021-02-25 12:49:47 +02:00
Sebastian Dröge
e11b12df7c gstreamer: Provide class metadata, pad templates and basetransform configuration via trait methods
This is closer to how this works in Python and also how properties and
signals work now in the glib bindings.

class_init() only has to be implemented for more special uses now.
2021-01-25 13:56:55 +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
Sebastian Dröge
ce1148b474 Update everything for glib macro renamings 2020-12-18 00:56:47 +02:00
Sebastian Dröge
f3b5340875 Update for new simplified glib::Object::new() API 2020-12-17 17:43:17 +02:00
Guillaume Gomez
ff5a36561a Fix license header situation 2020-12-15 11:53:31 +01:00
Sebastian Dröge
9d9522016b gstreamer: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
Sebastian Dröge
4eaf574cf8 gstreamer: Make virtual methods take wrapper of type, not parent 2020-11-14 19:39:27 +02:00
Sebastian Dröge
1d53b66858 Fix compilation with GLib subclassing changes 2020-11-14 19:39:27 +02:00
Sebastian Dröge
9379c730b9 gstreamer: Update for removal of ElementClass/DeviceProviderClass type aliases 2020-11-07 12:49:19 +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
0cc32a02cc gstreamer/element: Don't catch panics in post_message() vfunc
Otherwise we would post a message, which calls into this code again and
then does the whole thing recursively forever.
2020-07-01 01:36:16 +03:00
Sebastian Dröge
4fbbf48622 gstreamer/element: Change post_message() vfunc return type to bool
It regularly fails in normal situations, e.g. when the element is not
inside a bin and has no bus, and we don't really want to log errors for
that.
2020-07-01 01:15:57 +03:00
Sebastian Dröge
5b3d6418f0 gstreamer/element: Add support for overriding post_message vfunc 2020-06-30 23:46:51 +03:00
Sebastian Dröge
79c457c8c4 gstreamer/pad: Rename Pad::builder_from_template() to builder_with_template()
Sounds more natural as it creates a build that is initialized *with* a
template.

But keep Pad::from_template() as it creates a new pad *from* a template.
2020-06-22 11:26:24 +03:00
Sebastian Dröge
0c0d671922 gstreamer/pad: Don't provide constructors anymore but instead a builder
This handles safely setting the pad functions during construction and
also has special support for ghost pads.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/247
2020-06-22 10:55:24 +03:00
Sebastian Dröge
bfde1fd9d5 Update for new_with_XXX/new_from_XXX function renaming 2020-06-16 11:45:12 +03:00
Guillaume Desmottes
7b2fe31cc1 update gir generator and regenerate 2020-06-11 12:33:49 +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
69be1ce2fc Fix various new clippy warnings from 1.40 2019-12-22 12:10:27 +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
2375c9da59 gstreamer/element: Don't steal floating references passed into release_pad()
They are apparently not part of this element so we can directly return
here instead of stealing the reference.
2019-12-07 22:58:26 +02:00
Sebastian Dröge
7868018abb gstreamer/element: Add support for ElementClass::add_metadata() 2019-09-12 10:18:23 +03:00
Mathieu Duponchelle
d3d503cea6 subclass/element: expose set_clock and provide_clock vmethods 2019-08-31 02:05:21 +02:00
Sebastian Dröge
e00781309b gstreamer/element: Use from_glib_none() for the release_pad() trampoline
The reference to the pad we get passed is not guaranteed to be valid for
the whole scope of release_pad(). It might be the last reference as
owned by GstElement, and gst_element_remove_pad() would destroy it then.
2019-08-14 11:58:05 +03: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
698120c620 Add tests for pad and element subclassing 2019-05-11 13:45:09 +00:00
Sebastian Dröge
e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
François Laignel
fb99f1abad gstreamer: subclassing: move parent fn in dedicated trait (!231) 2019-02-13 11:53:14 +00:00
François Laignel
fcb46ee5bf gstreamer: add parent_xxx impl for all vfunc 2019-02-03 08:41:20 +00:00
François Laignel
56c00d9250 gstreamer: fix parent vfunc invocations when needed
Fixes #180
2019-02-03 08:41:20 +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
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
3febc42628 Update for glib-rs API changes 2018-11-28 21:55:21 +02:00
Sebastian Dröge
56319f9294 Move subclassing infrastructure into the main bindings
And port Element bindings to the new infrastructure.
2018-11-21 16:14:06 +02:00