Commit graph

97 commits

Author SHA1 Message Date
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
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 c2a2549b66 video: Automatically derive Copy/Clone for more structs 2021-09-25 14:32:43 +03:00
François Laignel e31ce9d07b Manual ClockTime updates 2021-06-04 22:09:38 +02:00
Marijn Suijten a85b30eacb audio,video: Remove dox feature from function bodies
Now that the crates are generated and linked against v1_20 binaries
there is no need to guard this codepath when building `dox` (which
inherently enables `v1_20` but did previously not actually compile
against that version yet).
2021-06-04 11:51:01 +02:00
Marijn Suijten a828d3cc12 video: VideoChromaSite now has an autogenerated impl Display
Still calls into the manual `fn to_str()`.
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
Marijn Suijten 579ac6c4e4 video: Implement gst_video_color_range_offsets for Video(Format)Info 2021-04-30 16:48:31 +02:00
Marijn Suijten 7cb151dd46 video: Update VideoColorRange based on autogenerated implementation
Also separate the lower/upper bound in the name with an underscore. This
cannot be added between `Range` and the first number, that's violating
`non_camel_case_types`.
2021-04-30 11:09:08 +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
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 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
Marijn Suijten 89ba883ea8 audio/video: Do not link v1_20 ffi functions when building docs
The sys crates have not been generated with 1.20 introspected gir files
yet, and break the documentation that is already compiling with the
v1_20 feature. Function body contents don't truly matter for the
documentation build anyway.
2021-03-24 13:43:45 +01:00
Marijn Suijten ce67076f26 gstreamer,video: Do not zero-initialize designated struct members
This should be analogous to C struct initalizers where all unspecified
fields are initialized to zero. Without mut this reads a bit nicer as
well.

Note that two out of three structs have all members specified, hence
need no zero-initialization of the remainder at all.
2021-02-15 20:19:38 +01: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
Marijn Suijten 85e46f39f3 video: Provide manual to_string and display for VideoChromaSite
This function was named wrong before 1.20, and its return transfer type
changed from none to full. To provide

Note that, when 1.20 Gir files are imported, this `version` override in
gstreamer-video/Gir.toml wil come into effect and create a Display trait
for us (without version constraint). At that point the manual Display
impl should be removed, but the manual to_string implementation remains.
2020-12-12 20:28:37 +01:00
Marijn Suijten a215610167 audio/video: Update to v1.20 functions 2020-12-12 19:43:02 +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 82b4726bb7 impl FromStr: Forward implementation to autogenerated from_string() 2020-12-07 12:12:16 +01:00
Marijn Suijten 040772ab61 audio,video: Manual enum to_string returns 'static; add NULL check 2020-12-07 12:12:16 +01:00
Marijn Suijten 9ff39bae6f audio,video: Use autogenerated Display impl 2020-12-07 12:12:16 +01:00
Marijn Suijten c215acb7f9 audio,video: Delete manual implementations for now-autogenerated enum funcs 2020-12-07 12:12:16 +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 Desmottes c529d4d4ae video: add VideoInfo::align_full() 2020-12-03 16:39:40 +01:00
Guillaume Desmottes e404d4f213 video: VideoInfo::align(): return a Result 2020-12-03 16:39:40 +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 e88994a0b7 use cfg_if to refactor some #[cfg()] / #[cfg(not())] pairs 2020-11-19 16:39:31 +01:00
Marijn Suijten aeb1b70581 Remove doc(cfg()) from expressions
warning: unused doc comment
       --> gstreamer-video/src/video_info.rs:655:37
        |
    655 |           #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
        |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    656 | /         {
    657 | |             VideoInfoBuilder {
    658 | |                 format,
    659 | |                 width,
    ...   |
    674 | |             }
    675 | |         }
        | |_________- rustdoc does not generate documentation for expressions

Also simplify some blocks into expressions which are allowed to have
attributes as well since Rust 1.43.
2020-11-19 16:39:31 +01:00
Marijn Suijten bd75778fcb Add doc(cfg()) on all manual files 2020-11-19 16:39:31 +01:00
Sebastian Dröge 6ce9a9ce12 video: Rename VideoTransferFunction functions 2020-09-08 15:43:05 +03:00
Sebastian Dröge dfe87cf5c9 Add various new 1.18 APIs 2020-08-11 12:54:32 +03:00
Sebastian Dröge e3667fd8d2 video/video_info: Add field_height() function 2020-07-03 13:10:28 +03:00
Sebastian Dröge 947ac8db5c Name functions returning a builder builder(), not new()
And also make the video event API more consistent with the normal event
API.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/269
2020-06-25 19:42:33 +03:00
Sebastian Dröge 6ed505401f video: Add VideoInfo::is_valid() and guard against finfo being NULL when retrieving the video format 2020-06-07 15:22:33 +00:00
Sebastian Dröge 5eb1dbd93e video/videoinfo: Use a proper error type in the TryFrom<VideoMultiviewMode> impl for VideoMultiviewFramePacking 2020-05-26 19:26:35 +03:00
Guillaume Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge a2a1a87c46 video/video-info: Don't use bool return of gst_video_info_set_format()/align() when running with GStreamer < 1.11.1
The bool return value was added in 1.11.1 and using the return value
with older versions gives a random value that might be true or false,
and then causes spurious errors.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/236#note_399872
2020-02-14 13:12:41 +01:00
Sebastian Dröge 69be1ce2fc Fix various new clippy warnings from 1.40 2019-12-22 12:10:27 +02:00
Tony Jinwoo Ahn 62c0b689a6 gstreamer-base/{adapter,functions}, gstreamer-video/video_info: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-16 11:29:51 +00:00
Tony Jinwoo Ahn 3e3c5205db gstreamer-video/video_info: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-15 08:36:56 +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