Commit graph

66 commits

Author SHA1 Message Date
Sebastian Dröge 9a8ca0cadd gstreamer: Add bindings for the new 1.22 selectable query 2022-04-06 10:18:48 +03:00
Sebastian Dröge bcf4f63ac6 gstreamer: Don't make the bitrate query available at all with v1_16 2022-04-06 09:51:19 +03:00
Sebastian Dröge 5e2249d368 message/query/event: Implement views in a more consistent way
Co-authored-by: Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
2022-01-19 13:29:59 +02:00
Jan Alexander Steffens (heftig) fb56bbda6e gstreamer: Split parsers for owned and borrowed views
When we have a view like `Caps<&EventRef>`, we can return a `CapsRef`
borrowing from the wrapped `EventRef`. This way, the `CapsRef` we return
can outlive the view itself.

This is in contrast to a `Caps<Event>` view which owns the `Event`.
Here, the `CapsRef` we return cannot outlive the view.

gstreamer-rs 0.18 consolidated code and treated everything like the
latter case. Fix this by duplicating the accessors for each case.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/367
2022-01-17 19:13:47 +00:00
Sebastian Dröge ddf398e3da gstreamer: Add various missing doc aliases to event/message/query functions
This is going to make it easier to find them from the corresponding C
function names.
2021-11-19 10:38:46 +00:00
Sebastian Dröge 30bb699cbc gstreamer: Use plain &str for parameters instead of Into<&str>
The latter doesn't really have any advantage and only bloats the API.
2021-11-05 17:37:41 +02:00
Sebastian Dröge cdfe4b3d67 Remove unneeded std::convert::TryFrom/TryInto and std::str::FromStr imports 2021-10-31 18:20:31 +02:00
Sebastian Dröge d01ed466d0 gstreamer: Use #[non_exhaustive] annotation instead of a dummy enum variant 2021-10-17 14:04:18 +03:00
Sebastian Dröge 87e7a84a27 gstreamer: Remove one unnecessary use of unsafe in query code 2021-10-17 12:38:59 +03:00
Philippe Normand b9cd38b796 gstreamer: query: Tidy up allocation pool API
Use `impl IsA<BufferPool>` and make the `set_nth_` and
`remove_nth_` methods check the index bounds.
2021-10-12 17:16:21 +01:00
Philippe Normand 6d88e18772 gstreamer: Add bindings for querying allocation params
This can be used to query downstream for custom allocators.
2021-10-12 17:16:21 +01: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 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 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
Guillaume Gomez 8f9d76bb8c Revert "Remove unnecessary dox feature"
This reverts commit 9dd8bd9095.
2020-11-27 14:37:49 +01:00
Marijn Suijten 513cf47447 gstreamer/query: Fix clippy::single_match 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 a4239c3462 gstreamer: Remove API that was deprecated in 0.16 2020-08-24 17:33:35 +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
François Laignel ddd3bbbf84 query: remove unused Jitter & Rate
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/532#note_548884
2020-06-25 10:48:25 +02:00
François Laignel c94baa4fe8 query: add constructor on target types
... and deprecate the `Query::new_*` forms.
2020-06-25 10:48:25 +02:00
Guillaume Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge 3a8d05075d Switch everything from mem::uninitialized() to MaybeUninit or mem::zeroed()
And also fix a few cases where mem::uninitialized() was simply wrong to
use.
2019-07-11 17:56:50 +03:00
Sebastian Dröge d44c293753 Use TryFrom/TryInto traits where it makes sense instead of our previous ad-hoc solutions 2019-06-03 18:42:34 +03: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 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 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 eb0a804a50 Run everything through latest rustfmt 2018-10-08 15:02:23 +03:00
Sebastian Dröge 0f704646f6 Add more complete bindings for allocation query
Everything apart from allocators are covered now.
2018-10-01 22:56:32 +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
Sebastian Dröge a43c78f2c5 Run everything through rustfmt 2018-09-28 13:15:18 +03:00
Sebastian Dröge 694bcaa697 Fix all clippy warnings
Or silence the ones we don't care about.
2018-07-20 10:28:20 +03:00
Thibault Saunier 2962f186f7 Print pointer value when formatting debug strings 2018-05-14 09:22:25 +03:00
Sebastian Dröge 2cefd9aea6 Re-run everything through rustfmt 2018-04-25 11:13:14 +03:00
Sebastian Dröge 9a3ef2e9f1 Regenerate with latest GIR and update for the non-bitflags flags in -sys now 2018-04-04 10:47:12 +03:00
Sebastian Dröge 492c3d656c Run everything through rustfmt again 2018-04-01 11:57:58 +03:00
Sebastian Dröge 4117c01ff2 Run everything through latest rustfmt-nightly 2018-02-22 11:18:37 +01:00
François Laignel c971727193 Query: allow concrete query instantiation
Allow instantiating and dereferencing concrete queries. The motivation
for this proposal is to allow the following usability enhancements:

- Concrete queries mutability guaranteed by the borrow checker,
including for generic functions:
``` rust
    let mut p = Query::new_position(::Format::Time);
    p.get_mut_structure().set("check_mut", &true);
```

- Concrete queries functions available in place:
``` rust
    let mut q = gst::Query::new_duration(gst::Format::Time);
    let duration = if pipeline.query(&mut q) {
        Some(q.get_result())
    } else {
        None
    };
```
2018-02-16 10:33:40 +02:00
fengalin 2d1218e6d6 Event, Message & Query: allow dereferencing concrete types to access generic type methods
Implement `deref` for concrete derivatives of `Event`, `Message` and `Query`. This allows accessing generic methods such as `is_sticky` for events, `get_seqnum` for messages or `is_serialized` for queries and `get_structure` for all.
2018-01-29 17:33:49 +02:00
Sebastian Dröge e0dc84c10a Run everything through rustfmt again 2017-12-20 19:30:14 +02:00
Sebastian Dröge dfdae187a3 Filter in caps queries can be None, and there could be no resulting caps 2017-12-17 11:32:01 +02:00