Commit graph

49 commits

Author SHA1 Message Date
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
315704fe67 gstreamer-check: Simplify borrowing of sink/src harnesses
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1183>
2023-01-05 12:09:57 +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
01e24d2018 Fix various new clippy warnings 2022-11-01 11:10:57 +02: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
Marijn Suijten
669bf52291 Use impl for AsRef trait bounds 2021-09-21 23:54:07 +02:00
François Laignel
e31ce9d07b Manual ClockTime updates 2021-06-04 22:09:38 +02:00
François Laignel
8dda8def6e Manual try_from_glib shortcuts + unsafe 2021-06-04 22:09:38 +02:00
Marijn Suijten
dc763501ae check/harness: Add new 1.19.1 set_live function 2021-06-04 11:51:01 +02:00
Guillaume Gomez
5ba79976a9 Generate missing doc aliases for newtypes 2021-06-01 15:15:59 +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
5505715cc4 Manual code updates for *Return types 2021-05-04 11:33:51 +00:00
François Laignel
49583597ed manual code: fix-getters-def doc aliases 2021-05-03 20:46:57 +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
Sebastian Dröge
1d59ea91c5 Clean up various imports everywhere 2021-04-26 15:16:58 +03:00
François Laignel
6ab9164dca fix-getters-calls 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
762450bb53 check: Add Harness::pull_until_eos() 2021-03-25 20:12:51 +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
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
240285ec0f gstreamer-check: 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
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
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
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
8d0fa62275 Minor cleanup in various places 2020-03-09 12:55:14 +02:00
Sebastian Dröge
2ba5105b80 Implement Sync/Send for more types and don't implement Send for TypeFind
They can actually be shared with multiple threads at the same time
safely as all functions requiring an immutable reference are
thread-safe.

OTOH TypeFind can't be shared safely between different threads as not
all implementations of the TypeFind struct are thread-safe.
2019-12-18 18:37:44 +02:00
Sebastian Dröge
be3c378f28 Use Results instead of Options where they signal an error instead of just a missing value
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 22:21:28 +02:00
Sebastian Dröge
1c1533d076 check: Fix compilation with v1_16 feature enabled 2019-05-28 04:46:41 +02:00
Sebastian Dröge
86e969d964 Remove various Into<Option<_>> trait bounds from functions
In autogenerated code these were already replaced but some manual code
still kept them.
2019-05-24 10:04:16 +00:00
Sebastian Dröge
e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge
95f6844702 Fix various minor clippy warnings 2019-02-21 19:56:23 +02:00
Sebastian Dröge
2471676aa4 check: Set harness caps in unit test before pushing buffers
Otherwise there will be warnings about data flow before stream-start
event as the harness is only sending the events once caps are set.
2019-02-21 13:08:54 +00: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
François Laignel
226070d216 BoolError: update to new build macros
See https://github.com/gtk-rs/glib/pull/419
2019-01-04 16:02:40 +01:00
Sebastian Dröge
8924af36e0 harness: Work around floating references issues in GstHarness
See https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
2018-11-13 14:45:20 +02:00
Sebastian Dröge
9e9bc5122c Fix accidential usage of Rust 1.30 feature
error[E0658]: access to extern crates through prelude is experimental (see issue #44660)
   --> gstreamer-check/src/harness.rs:180:76
    |
180 |     pub fn crank_multiple_clock_waits(&mut self, waits: u32) -> Result<(), glib::BoolError> {
    |                                                                            ^^^^
2018-11-04 18:39:28 +02:00
Sebastian Dröge
352f1c80d4 Run everything through rustfmt 2018-11-03 20:28:58 +02:00
Sebastian Dröge
0ccd8f186f Use std::path to directly refer to path::Path 2018-11-02 16:05:57 +02:00
Sebastian Dröge
26a213bf9f Add accessors for the GstHarness struct fields 2018-11-02 14:32:09 +02:00
Sebastian Dröge
1937294faf Fix harness compilation with v1_16 feature 2018-11-02 13:58:51 +02:00
Sebastian Dröge
33295b758e Add initial version of gstreamer-check
Covers GstHarness and GstTestClock

Fixes https://github.com/sdroege/gstreamer-rs/issues/148
2018-11-02 13:28:03 +02:00
Sebastian Dröge
5b75f11cd0 WIP initial version of harness/testclock bindings 2018-11-02 11:20:33 +02:00