Sebastian Dröge
83a562e227
Fix/silence various 1.72 clippy warnings
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1306 >
2023-08-28 16:50:41 +00:00
Sebastian Dröge
3699da7314
Remove dox feature and replace by docsrs configuration
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1256 >
2023-05-04 09:19:29 +03:00
Thibault Saunier
145664ec0d
miniobject: Implement the HasParamSpec trait in the macro
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1249 >
2023-04-17 11:00:49 -04:00
Sebastian Dröge
37bfb78fdc
Change some assertions to debug assertions
...
These assertions can only trigger because of bugs in the bindings
implementation or in the C code and not because of bugs in calling code,
so using debug assertions is perfectly fine for them and reduces the
number of assertions inlined everywhere in release builds.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1188 >
2023-01-14 17:13:46 +02:00
Sebastian Dröge
f235dc987d
Inline various trivial functions
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1177 >
2023-01-11 11:33:54 +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
Sebastian Dröge
036a020b62
gstreamer: Optimize various from/to Vec
FFI translation functions
...
Use memcpys if possible instead of manual loops, and directly write into
the `Vec` memory and set the length afterwards to avoid having the
reallocate logic at every step.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1181 >
2023-01-03 12:06:29 +02:00
Sebastian Dröge
882513d33a
Make use of the new TransparentType
/ TransparentPtrType
traits
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1178 >
2023-01-02 19:07:24 +02:00
Sebastian Dröge
d6cc452cf3
Use PhantomData
as Stash::Storage
if nothing has to be stored except for a lifetime
...
This reduces the size of all stashes from two pointers to one.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1171 >
2022-12-20 17:07:39 +00:00
Sebastian Dröge
f166e80a79
gstreamer: Only use a single temporary Vec
for [T]::to_glib_none()
for miniobjects
...
The value itself is already kept alive via the stash and we only need a
temporary `Vec` to be able to append the terminating `NULL` pointer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1171 >
2022-12-20 17:07:39 +00:00
Sebastian Dröge
ae4dd88f3d
Update for GLib Into<Value>
changes
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1156 >
2022-11-26 15:19:35 +02:00
Guillaume Desmottes
c5d19e7c80
miniobject: implement ptr_eq() on ref type
2022-08-12 11:15:08 +02:00
Guillaume Desmottes
2dcd5cf9eb
as_ptr() and as_mut_ptr() accessors are safe
...
Nothing unsafe about getting a pointer, deferencing it is unsafe.
2022-08-12 08:29:49 +02:00
Guillaume Gomez
c1d3ed5eac
Use IntoGlibPtr trait instead of implementing into_ptr
2022-05-07 13:38:11 +02:00
Sebastian Dröge
d68c359db5
gstreamer: Fix downcast_ref()
/ downcast_mut()
impls on MiniObjectRef
...
They have to return the `Ref` type and not the owned type.
2022-02-16 12:13:19 +02:00
Sebastian Dröge
a1fed48e8c
gstreamer: Add Debug
impl for MiniObject
/ MiniObjectRef
2022-02-16 12:13:03 +02:00
Sebastian Dröge
eecce101da
gstreamer: Implement FromValue
for mini object references
2022-01-24 13:13:24 +00:00
Sebastian Dröge
8f5e373882
gstreamer: Mark miniobject wrapper types as #[repr(transparent)]
...
That way they're treated everywhere exactly like a raw pointer.
2022-01-17 18:04:40 +00:00
Guillaume Gomez
ac9b1e881c
Add missing #[must_use] attribute for clippy
2022-01-04 19:43:07 +01:00
Sebastian Dröge
1e18c59d2a
Implement glib::ValueTypeOptional for various types
2021-12-16 17:40:39 +00:00
Sebastian Dröge
1856d47a06
gstreamer: Add bindings to MiniObject together with casting functionality
...
This is only possible with 1.20 because gst_mini_object_get_type() was
added then. Previous versions only provide bindings for the specific
types, like Caps, Event, etc.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/353
2021-09-19 13:12:58 +00:00
Marijn Suijten
540062b97c
Add missing doc aliases to manual code
...
Using the same script as [1], called with:
python3 add_doc_alias.py gstreamer*/**/src
[1]: https://github.com/gtk-rs/gtk-rs-core/pull/83
2021-05-19 22:36:18 +02:00
Marijn Suijten
10c93807fb
Replace explicit type with Self in for_value_type::<> turbofish
2021-04-30 10:02:47 +02:00
Sebastian Dröge
eda1d3d4a7
Update for Value trait refactoring
2021-04-25 14:45:08 +03:00
François Laignel
1395d773c3
manual fixes remove get prefix round 2
2021-04-20 18:18:02 +02:00
François Laignel
6ab9164dca
fix-getters-calls 0.3.0 pass
2021-04-20 18:18:02 +02:00
Marijn Suijten
9cc488db4c
gstreamer/miniobject: Make get_type function optional
...
Static typing is needed for `Value` interop, but not every type
(GLMemory in this instance) requires that.
2021-04-17 07:54:40 +00:00
Sebastian Dröge
8d983066f5
gstreamer: Store ffi::GstCaps inside gst::Caps and equivalent for other miniobjects
...
Simplifies code and prepares for the next changes.
2021-04-03 17:43:50 +03: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
9d9522016b
gstreamer: Update manual code to 2018 edition
2020-11-22 19:15:20 +02:00
Sebastian Dröge
a6c8fe0c8a
Use repr(transparent) where it is more correct and get rid of some unneeded repr(C)
2020-10-24 17:09:10 +00:00
Sebastian Dröge
4c216bca3a
Remove unneeded PhantomData markers
...
And as a side-effect also get rid of the lifetime parameter of
gst::TypeFind that was completely unused anyway.
2020-10-24 17:09:10 +00:00
Sebastian Dröge
dbc76f1053
gstreamer/miniobject: Remove DerefMut and AsMut impls
...
They were side-stepping the miniobject writability mechanism.
2020-06-30 15:23:50 +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
7086a754be
Add various glib::Value trait impls for borrowed versions of types
...
For SDPMessageRef, StructureRef and CapsFeatureRef this involves the
conversion from and to a glib::Value. Specifically this means that e.g.
a StructureRef can be retrieved from a glib::Value via borrowing, i.e.
without creating a copy of the structure first.
For all mini objects only retrieval from a glib::Value is implemented as
the other direction would allow to get multiple immutable references
from a mutable reference without borrowing, which is not allowed and
would make it possible to observe a mini object changing while having an
immutable reference to it.
2020-05-27 13:17:54 +03:00
Guillaume Gomez
c07fe14191
gstreamer*: Add missing init checks
2020-04-12 17:25:54 +03:00
Sebastian Dröge
62e9af58c6
Fix some clippy warnings
2020-04-11 21:18:18 +03:00
Sebastian Dröge
62c0f5ef42
Use mem::ManuallyDrop instead of mem::forget() everywhere
...
It makes the intentions clearer and potentially results in simpler
assembly, at least in debug builds.
2020-04-09 16:57:06 +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
9d5ae8ed14
gstreamer: Don't take mini objects by value for append() and similar operations
...
Compared to
let foo = Foo::bar(foo);
the new form is easier to follow
foo.bar();
2020-03-07 00:31:30 +02:00
Sebastian Dröge
e6f65a5032
gstreamer/miniobject: ToOwned::to_owned() on references has to create a copy
...
Otherwise it's possible to create a new owned reference from a mutable
reference, and then there is a mutable and immutable reference to the
same data at the same time, which is simply not allowed.
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/204
2019-05-24 10:04:16 +00:00
Sebastian Dröge
b2b8bfab52
Add manual implementations for various new 1.16 functions
2019-04-23 20:45:39 +03:00
Sebastian Dröge
e7898c1b24
Update manual code
2019-04-15 19:19:19 +03:00
Sebastian Dröge
8c39da4e5b
Update to Rust 1.31 linter-specific attributes
2019-03-04 15:16:01 +02:00
Sebastian Dröge
fa988fe73d
Make gst_define_mini_object_wrapper! macro work stand-alone without requiring specific names in scope
2018-12-08 12:53:10 +02:00
Sebastian Dröge
5d9a3b4272
Use ptr::add(i) instead of ptr::offset(i as isize)
2018-10-11 11:58:01 +03:00
Sebastian Dröge
c56e9ddfea
Also implement copy() returning the wrapper miniobject on the reference type
...
This way CapsRef::copy() will return a Caps, and not a GstRc<CapsRef>.
2018-10-05 16:36:15 +03:00
Sebastian Dröge
30b9527112
Implement ::copy() directly on miniobject wrapper types
...
This provides the additional wrapping as the one via get via deref will
only give back a GstRc<T> without the additional wrapping.
2018-10-03 16:54:00 +03:00
Sebastian Dröge
6fd0ed4cb3
Move all minobjects to newtype wrapper types
...
For consistency with external crates and to help rustdoc, which gets
confused on impl blocks for type aliases.
2018-09-28 18:11:46 +03:00