Commit graph

18 commits

Author SHA1 Message Date
Sebastian Dröge
0b70e52032 gstreamer/audio/video: Correctly implement ExactSizeIterator
len() is optional but size_hint() must return the correct values. Also
this shouldn't return the overall length but the remaining length.
2020-10-09 11:35:19 +03:00
Guillaume Desmottes
2f1b3306de video: properly version VideoFormat members
The C API is not safe when called on unknown formats.

Need to do this manually until gir gives us the version info:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/348

Fix #267
2020-06-24 14:55:27 +02:00
Guillaume Desmottes
2afcdfe79f video: remove 1.18 formats from VIDEO_FORMATS_ALL
This array is a fallback when using gst < 1.18 so it makes no sense
to include formats which have been introduced in 1.18
2020-06-24 14:14:45 +02:00
Guillaume Desmottes
03a240cf3f video: format: check for Nv12 instead of P016Be
The latter has been introduced in 1.18 making the test fail with older
gst.
2020-06-24 10:01:31 +02:00
Guillaume Desmottes
ac47c7bc1d video format:: disable sorting test with gst < 1.18
This test relies on a 1.18 specific fix
( 8e3c4a5d5a )
and is meant to check that future updates won't break the ordering.
2020-06-24 10:01:20 +02:00
Guillaume Desmottes
1d886727d9 video: sort VIDEO_FORMATS_ALL
Test also ensures that the formats list returned by
gst_video_formats_raw() is properly sorted when running with feature
1.18.
2020-06-09 09:26:32 +02:00
Guillaume Desmottes
ae57524502 video: manually order VideoFormat and VideoFormatInfo 2020-06-09 09:26:32 +02:00
Guillaume Desmottes
972002ceb2 video: implement Iterator on VideoFormat
Also add VIDEO_FORMATS_ALL as public API.
2020-06-03 21:11:00 +03:00
Sebastian Dröge
be3c378f28 Use Results instead of Options where they signal an error instead of just a missing value
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 22:21:28 +02: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
Guillaume Desmottes
af65497c39 video: fix VideoFormat Display implementation
We were calling the blanket implementation of ToString, which is using
Display, rather than our own, resulting in an infinite recursion.

Fix #208
2019-06-18 17:11:24 +05:30
Sebastian Dröge
e7898c1b24 Update manual code 2019-04-15 19:19:19 +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
Sebastian Dröge
d3b03de9ff Nullability fix for VideoFormat::to_string() in case Unknown is passed 2017-12-16 10:58:10 +02:00
Sebastian Dröge
34f70ee0d7 Derive more useful traits for various enums 2017-11-27 14:03:30 +02:00
Sebastian Dröge
380fb319ba Don't return &'static references from functions but give them a generic lifetime
https://github.com/rust-lang/rust/pull/42417#issue-233404573
2017-09-01 11:40:32 +03:00
Sebastian Dröge
f05df73088 Add various gst_init() assertions to video/app bindings
audio and core should come next.

Also print something more meaningful than using assert_eq!().
2017-08-30 12:48:01 +03:00
Sebastian Dröge
3a50ca61e3 Add initial libgstvideo bindings
Only VideoFormat and VideoFormatInfo and related API for now.

https://github.com/sdroege/gstreamer-rs/issues/5
2017-08-11 00:41:55 +03:00