Commit graph

1166 commits

Author SHA1 Message Date
Sebastian Dröge f27a2bddd6 gstreamer: Add bindings for DebugCategory::all() to list all available debug categories 2021-11-09 09:58:22 +00:00
Bilal Elmoussaoui e3a65a3a88 gst object: add a panicking variant of set_property_from_str
Similar to what was added to ObjectExt
2021-11-08 14:42:59 +01:00
Bilal Elmoussaoui 213020165a manual changes post ObjectExt improvements 2021-11-08 14:42:59 +01:00
Bilal Elmoussaoui 0d009bca31 regen with latest gir 2021-11-08 14:42:59 +01:00
Sebastian Dröge 0444660d1f gstreamer: Don't use a trait object for the property value in ChildProxy::set_child_property()
This makes it nicer to use as `1` can be passed directly instead of `&1`.
2021-11-06 09:36:38 +02:00
Sebastian Dröge 220c500799 gstreamer: Add numer()/denom() functions to gst::Fraction to get the values by value instead of reference 2021-11-06 00:23:07 +02:00
Sebastian Dröge a3015ab507 gstreamer: Refactor gst::IntRange constructors to not require specifying the contained type necessarily 2021-11-06 00:23:07 +02:00
Sebastian Dröge 9901f0c6a2 gstreamer: Refactor gst::Array / gst::List bindings to work correctly with the refactored traits in glib
Also allow only a single type inside them.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/360
2021-11-06 00:23:07 +02: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
François Laignel 82b7239379 regen: NONE as associated consts 2021-11-04 18:42:06 +01:00
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