Commit graph

1156 commits

Author SHA1 Message Date
Sebastian Dröge
c942a1d563 gstreamer: Implement Element::request_pad_simple() only once
With < 1.20 it will use `gst_element_get_request_pad()` and otherwise
`gst_element_request_pad_simple()`. It's not marked as deprecated in
either case.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/358
2021-11-04 15:44:35 +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
d785bf8c3a Regenerate with latest gir 2021-10-31 11:47:34 +02:00
Sebastian Dröge
c00a97f5ec Update to Rust edition 2021 and minimum supported Rust version 1.56
Also update CI image to use meson 0.60.
2021-10-31 11:47:34 +02:00
Sebastian Dröge
b43d785d83 Move README.md to the repo root and link it from inside the gstreamer subdirectory 2021-10-27 00:01:00 +03:00
Sebastian Dröge
e657e676d5 Relax main context checks in Bus::add_local() and gst_video::convert_sample_async_local() 2021-10-25 09:54:33 +00:00
Sebastian Dröge
c2e43f86a5 gstreamer: Update to option-operations 0.4 2021-10-25 09:51:14 +03: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
7f0ca0011c Add gst::GstObjectImpl, gst::ProxyPadImpl, gst_audio::AudioBaseSrc, gst_audio::AudioBaseSink subclassing traits
These were missing from the type hierarchy previously and are now
required because of more strict checks in the GLib bindings.
2021-10-23 11:59:03 +03:00
Sebastian Dröge
12fec484c7 Simplify IsSubclassable trait impls 2021-10-23 11:27:46 +03:00
Sebastian Dröge
cc76442601 gstreamer: Update ron dev-dependency to 0.7 2021-10-23 10:40:24 +03:00
Sebastian Dröge
18e45dd991 gstreamer: Add FromIterator/Extend impls based on owned Strings and glib::Quark 2021-10-20 14:28:14 +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
febd0ee144 Declare the minimum supported Rust version in Cargo.toml 2021-10-18 19:30:37 +03:00
Sebastian Dröge
e6b78d1489 gstreamer: Have Structure::from_iter() take owned values
They were copied internally, which can be avoided in many cases if
working with owned values anyway.
2021-10-18 16:36:15 +03:00
François Laignel
f315d3a052 Use published option-operations 2021-10-18 14:30:59 +02:00
François Laignel
4bbd201377 Impl Option*{Div,Mul,Rem}
Use the inner type for Rhs, as implemented for Duration.
These operations make sense without providing a "unit".
2021-10-18 14:30:59 +02:00
François Laignel
deb22b264e format, clock_time: gather macros together
The modules format and clock_time share common macros which are
scattered between each modules. This cross reference makes it
difficult to maintain the macros.

This commit also make it possible to use macro
impl_common_ops_for_newtype_uint for Percent.
2021-10-18 14:30:59 +02:00
François Laignel
986a136492 clock_time & format: basic opt-ops impl
The option-operations crate provides traits to improve usability
when dealing with `Option`s, which is often the case with
`ClockTime` & most formats.
2021-10-18 14:30:59 +02:00
François Laignel
051df59cd1 clock_time, format: fix checked, saturating, wrapping ops
These operations were implemented using the integer implementations.
These types' MAX values are different from the integers so they must
use specific implementations.

Also add the overflowing variants.
2021-10-18 14:30:59 +02:00
Guillaume Desmottes
675fe349a7 gstreamer: implement Sum on ClockTime
Small convenient helper.
2021-10-18 08:05:56 +02:00
Sebastian Dröge
67af5ac569 gstreamer: Add support for 1.18 instant rate request message 2021-10-17 14:39:38 +03:00
Sebastian Dröge
cdddf48f08 gstreamer: Correctly mark various messages as new in 1.10/1.16 2021-10-17 14:33:34 +03:00
Sebastian Dröge
6e3878c8f5 gstreamer: Add bindings for 1.18 instant-rate-change related events 2021-10-17 14:27:44 +03:00
Sebastian Dröge
8b77bd4068 gstreamer: Mark select-streams / stream-collection as only available in 1.10 2021-10-17 14:11:56 +03: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
aab0a45cfc gstreamer: Implement pad sticky event getter by type
This allows the caller to directly use the specific event type API on
the result instead of first having to match on it first.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/314
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
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
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
Sebastian Dröge
8fb37c5134 gstreamer: Implement Deref<Target=[glib::SendValue]> for List and Array 2021-10-12 11:24:54 +03:00
Sebastian Dröge
1c7b4516f9 Regenerate everything with latest GStreamer gir files 2021-10-08 19:44:38 +03:00
Sebastian Dröge
c4cbcecc7c Regenerate everything 2021-09-28 18:11:20 +03:00
Sebastian Dröge
baccf52e43 Regenerate with latest gir 2021-09-28 15:46:37 +03:00
Sebastian Dröge
f5f5fae815 Regenerate with latest gir and gtk-rs gir-files 2021-09-28 12:55:58 +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
Sebastian Dröge
14edcf9aaf Regenerate with latest gir 2021-09-22 12:02:53 +03:00
Marijn Suijten
226419003d Use impl for some Into* trait bounds 2021-09-21 23:54:11 +02:00
Marijn Suijten
669bf52291 Use impl for AsRef trait bounds 2021-09-21 23:54:07 +02:00
Marijn Suijten
13165938ab Regen 2021-09-20 20:38:25 +02:00
Marijn Suijten
e2a9f83f5b gir: Update and regenerate with impl Trait instead of named types
https://github.com/gtk-rs/gir/pull/1153
2021-09-20 20:19:04 +02:00
Sebastian Dröge
a1c4a58180 Bind various new API 2021-09-19 13:12:58 +00:00
Sebastian Dröge
4b8f85c4c6 Regenerate with new gir and gir files 2021-09-19 13:12:58 +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
Sebastian Dröge
538ce91987 gstreamer: Provide getter for meta type in addition to meta API type 2021-09-19 15:45:58 +03:00
Sebastian Dröge
7c5303c492 gstreamer: Add support for gst::CustomMeta 2021-09-19 15:45:58 +03:00
Sebastian Dröge
80ee1edec5 gstreamer: Clean up meta code a bit 2021-09-19 15:45:58 +03:00