Commit graph

47 commits

Author SHA1 Message Date
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 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
Sebastian Dröge ee9157a239 video: Mark VideoTimeCode as #[repr(transparent)] 2022-01-17 18:04:40 +00:00
Sebastian Dröge 1e18c59d2a Implement glib::ValueTypeOptional for various types 2021-12-16 17:40:39 +00:00
Sebastian Dröge 3b28bccf03 Update for GLib constructor renames
See https://github.com/gtk-rs/gtk-rs-core/pull/384
2021-11-20 12:20:17 +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 cdfe4b3d67 Remove unneeded std::convert::TryFrom/TryInto and std::str::FromStr imports 2021-10-31 18:20:31 +02:00
François Laignel aaa9eddc85 video: make nsec_since_daily_jam return ClockTime 2021-06-04 22:09:38 +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 49583597ed manual code: fix-getters-def doc aliases 2021-05-03 20:46:57 +02:00
Marijn Suijten 28cf8434d0 video: Fix all clippy::use_self warnings 2021-04-30 10:58:35 +02:00
Marijn Suijten 10c93807fb Replace explicit type with Self in for_value_type::<> turbofish 2021-04-30 10:02:47 +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 eda1d3d4a7 Update for Value trait refactoring 2021-04-25 14:45:08 +03: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 631be6b534 video/timecode: Fix compilation of tests with target API < 1.16 2021-02-10 13:09:51 +02:00
Sebastian Dröge 280433ebc1 video/timecode: Comment out spurious #[cfg] attribute and remove its duplicate 2021-02-04 11:19:54 +02:00
Sebastian Dröge e1a964fb00 video/timecode: Use mem::ManuallyDrop to prevent a double unref of the daily jam
As ffi::GstVideoTimeCode implements Copy, assignments don't move it out
of the passed in value but just copy it. This doesn't increase the
reference count of the daily jam, still runs the Drop impl of the passed
in value to decrease the daily jam and then causes a second unref of it
later when the returned value is dropped.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/310
2021-02-04 10:55:43 +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 fb56af8d84 Update from_glib calls and put them in unsafe blocks 2020-12-08 15:50:15 +01:00
Marijn Suijten 0763d2645d video: Reuse Self::Err in from_str 2020-12-07 12:09:39 +01:00
Marijn Suijten 2447664df6 Replace Result<(), fmt::Error> with fmt::Result 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 d31badf9ac gstreamer-video: 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 09f1a87dc9 video/timecode: Use stringify!($name) instead of "$name" in Debug impl
Otherwise it would output a literal "$name" string.
2020-11-16 13:21:57 +02:00
Sebastian Dröge a6c8fe0c8a Use repr(transparent) where it is more correct and get rid of some unneeded repr(C) 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 78a81e2c73 gstreamer-video: ValidVideoTimeCode::add_interval() is guaranteed to return a valid timecode again
So change the return type from VideoTimeCode to ValidVideoTimeCode.
2020-04-14 17:24:11 +03:00
Guillaume Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge 019afd54f9 Update for new from_glib_borrow signature
See https://github.com/gtk-rs/glib/pull/605
2020-04-05 18:48:48 +03: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
Tony Jinwoo Ahn 700332dd3e gstreamer-video: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 08:41:51 +00:00
Sebastian Dröge 06cfcd57fc Move to_string() methods into the Display trait or rename to to_str(), move from_string() into the FromStr trait
Fixes clippy warnings, prevents confusing errors and is more consistent.

The Display trait provides a to_string() method by itself and FromStr
provides from_str().
2019-10-04 11:01:55 +03:00
Sebastian Dröge 424a87efbf Use MaybeUninit::zeroed() everywhere possible instead of mem::zeroed() 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 e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge 86a31b4139 Silence/fix various clippy warnings 2019-03-07 14:05:35 +02:00
Sebastian Dröge 8c39da4e5b Update to Rust 1.31 linter-specific attributes 2019-03-04 15:16:01 +02:00
Sebastian Dröge b9d3a5a852 video: Fix compilation with features=v1_10 2018-12-29 00:05:22 +02:00
Sebastian Dröge 86673009df video: Add support for VideoTimeCodeMeta 2018-12-17 17:40:41 +02:00
Sebastian Dröge a753c65d33 video: Add VideoTimeCode bindings
There's a VideoTimeCode type that represents any kind of timecodes,
including invalid ones, and which allows to change each field
individually. And ValidVideoTimeCode that has all fields
validated and that can be used with most of the API.

In C, validation of the timecodes is left to the user and most functions
assert on getting passed valid timecodes.
2018-12-17 17:40:41 +02:00