Commit graph

104 commits

Author SHA1 Message Date
Sebastian Dröge
dc5e408c2d gstreamer: Add various convenience From impls for Caps, BufferList, CapsFeatures, Buffer and VideoOverlayComposition
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1199>
2023-01-23 13:06:54 +00: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
f07727ee6d Use uninitialized stack memory for out parameters instead of zeroed memory if applicable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1187>
2023-01-11 09:06:38 +00:00
Sebastian Dröge
1b022a6b7c Get rid of unnecessary option wrapping
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1187>
2023-01-11 09:06:38 +00: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
1264eb10ac gstreamer: Add PartialEq impls between owned/borrowed miniobjects/structures
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1152>
2022-11-21 12:40:37 +02:00
Guillaume Desmottes
c5d19e7c80 miniobject: implement ptr_eq() on ref type 2022-08-12 11:15:08 +02:00
Guillaume Desmottes
c0fd8a8aad gstreamer: add BufferRef::ptr_eq() 2022-08-12 08:29:49 +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
Sebastian Dröge
d4430ecc6a Implement more iterator functions / traits in custom iterators for efficiency reasons 2022-05-22 12:42:42 +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
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
1541fbf32a gstreamer: Add many new doc aliases for C function 2021-12-12 17:52:32 +02:00
Sebastian Dröge
f6dc14b946 Add a few missing docs aliases for constants 2021-12-03 10:19:22 +02:00
Sebastian Dröge
15fbb17a09 gstreamer: buffer: Implement meta foreach functions around ControlFlow enum
This makes it clearer than a plain `bool` or `Result<bool, bool>`.
2021-12-01 14:02:50 +02:00
Sebastian Dröge
a7be9ea9d9 gstreamer: Implement Extend trait for buffer, buffer list, caps, caps features and structure
And also implement FromIterator<Memory> for buffer.
2021-10-20 13:53:23 +03:00
Sebastian Dröge
3670076f07 gstreamer: Implement IntoIterator / FromIterator for Buffer, BufferList, Caps, CapsFeatures, StreamCollection and Structure
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/285
2021-10-16 23:24:08 +03:00
Jan Alexander Steffens (heftig)
c05d2e24af
gstreamer/clock_time: Format Debug like Display
This allows us to drop `.to_string()` from the custom Debug
implementations, which now also no longer print as strings.
2021-09-23 02:19:41 +02:00
François Laignel
e31ce9d07b Manual ClockTime updates 2021-06-04 22:09:38 +02:00
François Laignel
90bb458e64 Rework ClockTime & FormattedValues 2021-06-04 22:09:38 +02: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
François Laignel
49583597ed manual code: fix-getters-def doc aliases 2021-05-03 20:46:57 +02:00
Bilal Elmoussaoui
890cd03632 manual renames of to_glib into into_glib 2021-04-27 19:44:41 +02: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
François Laignel
e80a29372a fix-getters-def 0.3.0 pass 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
a316d610eb gstreamer: Update for glib::Type API changes 2021-02-25 12:49:47 +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
Guillaume Gomez
ff5a36561a Fix license header situation 2020-12-15 11:53:31 +01:00
Guillaume Gomez
fb56af8d84 Update from_glib calls and put them in unsafe blocks 2020-12-08 15:50:15 +01:00
Guillaume Gomez
8f9d76bb8c Revert "Remove unnecessary dox feature"
This reverts commit 9dd8bd9095.
2020-11-27 14:37:49 +01:00
Marijn Suijten
56c2b730f8 gstreamer/buffer: Fix clippy::needless_lifetimes 2020-11-25 21:16:40 +01:00
Guillaume Gomez
9dd8bd9095 Remove unnecessary dox feature 2020-11-25 15:54:02 +01:00
Sebastian Dröge
9d9522016b gstreamer: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
Marijn Suijten
bd75778fcb Add doc(cfg()) on all manual files 2020-11-19 16:39:31 +01:00
Sebastian Dröge
7aeb0e8f92 gstreamer/buffer: Don't implement ExactSizeIterator on meta iterator
We don't actually know the number of items and using the trait would
panic.
2020-10-09 11:35:19 +03:00
Sebastian Dröge
01eaf76b31 gstreamer/buffer: Add bindings for foreach_meta() and foreach_meta_mut()
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/268
2020-07-03 10:28:59 +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
6a72f65b3b gstreamer: ignore cognitive_complexity warnings
Those are just long tests.
2020-04-21 10:17:46 +02:00
Sebastian Dröge
42d09c2834 gstreamer/buffer: Move BufferCursor/BufferRefCursor into its own module
It's quite a bit of code and can be kept nicely separate.
2020-04-07 12:59:24 +03:00
Sebastian Dröge
ee3a8caa7d gstreamer/buffer: Add various tests for the BufferCursor / BufferCursorRef 2020-04-06 20:15:51 +03:00
Sebastian Dröge
a884a419db gstreamer/buffer: Add a BufferCursor / BufferCursorRef helper structs
This implements Read/Seek or Write/Seek and allows to read/write/seek
into the buffer without merging the memories inside.

The writer also only maps the memory write-only as compared to all other
ways of accessing the buffer/memory data in a writable way, which have
to map it read-write.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/425
for a similar API proposal for GStreamer core.
2020-04-06 20:15:35 +03:00
Sebastian Dröge
9b782b4dfa gstreamer/buffer: Add tests for various memory related buffer API 2020-04-06 19:29:19 +03:00
Sebastian Dröge
9e0c980a49 gstreamer/buffer: Add iterators for iterating over the memories inside a buffer
With immutable, mutable and owned variant.
2020-04-06 19:28:28 +03:00
Sebastian Dröge
2b70db3a9e gstreamer/buffer: Add BufferRef::peek_memory_mut() function
This gives a mutable reference to the given memory and fails if the
memory is not actually writable.
2020-04-06 19:27:40 +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