Commit graph

102 commits

Author SHA1 Message Date
Sebastian Dröge f24b38470b Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1203>
2023-01-25 10:18:33 +02:00
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 003554876c Update various APIs to use glib::GStr
Currently only covers what is needed to keep code compiling, plus
everything caps/structure/tags related.

This avoids unnecessary heap allocations for adding the NUL-terminator
of C strings, and especially makes caps/structure handling as efficient
as in C.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1190>
2023-01-15 21:05:57 +02: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 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 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
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
Sebastian Dröge 56b9b66027 gstreamer: Implement FromIterator<Caps> and Extend<Caps> for Caps
This allows easily generating new/extending existing caps from an
iterator.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1151>
2022-11-21 10:10:04 +02:00
Sebastian Dröge 01e24d2018 Fix various new clippy warnings 2022-11-01 11:10:57 +02:00
Vivia Nikolaidou 39bb9abc3c caps: Add .structure() to CapsBuilder
Allows us to get the structure, to read fields after adding them to the
builder.
2022-10-14 16:24:51 +03:00
Guillaume Desmottes 1e24e2d133 gstreamer: caps: improve Debug implementation 2022-08-25 10:54:16 +02:00
Paolo Borelli f2a2e6702c caps: add new_empty_simple constructor 2022-07-05 14:49:21 +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 843d3749b7 caps: Add bindings for foreach(), map_in_place() and filter_map_in_place()` 2022-01-11 13:37:40 +00: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 ee1a5e8395 Add #[must_use] attribute to many builders 2021-12-04 10:26:08 +02:00
Sebastian Dröge 92f9f3be39 Remove various unnecessary & from property/structure field related code 2021-10-24 20:52:23 +03:00
Sebastian Dröge b4a3738b82 Move more code to caps/structure builders
Instead of the new() functions requiring slices. The code reads cleaner.
2021-10-24 18:57:15 +03: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 e989899467 gstreamer: Remove FromIterator impls on references
Creating copies silently while calling collect() is unexpected and can
explicitly added to the iterator via map() if needed.
2021-10-17 11:21:31 +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
Marijn Suijten 226419003d Use impl for some Into* trait bounds 2021-09-21 23:54:11 +02:00
Vivia Nikolaidou 45f8035ccb structure, caps: Implement 1.20 serialize functions 2021-07-09 15:10:02 +03: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
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
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 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
Marijn Suijten 0763d2645d video: Reuse Self::Err in from_str 2020-12-07 12:09:39 +01:00
Guillaume Gomez 8f9d76bb8c Revert "Remove unnecessary dox feature"
This reverts commit 9dd8bd9095.
2020-11-27 14:37:49 +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 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 c68df282e8 gstreamer/caps: Fix clippy warning
No need to provide the field name if it's initialized with a variable of
the same name.
2020-06-21 20:02:52 +03:00
Guillaume Desmottes a954c03bc0 functions: rename constructors in manual API
The idiomatic way for Rust constructors is to be named from_XXX()
instead of new_from_XXX() and with_XXX() instead of new_with_XXX().

Fix #460
2020-06-11 12:33:52 +02:00
Guillaume Desmottes 932c940102 gstreamer: caps: add new_from_iter(_with_features)() 2020-04-20 17:12:24 +02:00
Guillaume Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge 8e038572cb gstreamer/caps: Assert on ANY caps in fixate() and work around bug in handling EMPTY caps
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/388
2020-03-09 13:02:20 +02: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 d3c77f400d Don't derive Debug impls for generic types where the type parameters don't have to impl Debug themselves
This allows to use MappedBuffer and similar types to be properly
debug-printed.

Also change VideoFrame/VideoFrameRef/RTPBuffer from a tuple struct to a
struct with proper field names to make the code easier to understand.
2020-01-22 19:10:04 +02:00
Guillaume Desmottes 1f79bf3e02 gstreamer: caps: Builder: prevent re-adding features
Rework the API to statically prevent users re-adding features or
adding features if any_features() has been previously called.
2020-01-10 15:09:06 +05:30
Guillaume Desmottes fe5ebd82cc gstreamer: caps: BuilderFull: prevent adding features if using any
Rework the API to statically prevent users adding extra features if the
builder has been created with builder_full_with_any_features(). It
doesn't make sense to add extra features if all are already included.
2020-01-10 14:21:23 +05:30