Commit graph

627 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig) 7a12c4d5e1
Iterator: Replace ad-hoc fn iter with impl IntoIterator
std has a trait for converting things into Iterators. Make use of it.
2019-09-05 10:33:54 +02:00
Jan Alexander Steffens (heftig) a30935ad1f
Iterator: Add a wrapper implementing std's Iterator
Transposing the item type lets us be a std-compatible Iterator.

The iterator is automatically resynced when resuming iteration after
yielding Resync. This lets some combinators like `collect` and `find`
work properly.
2019-09-04 14:34:05 +02:00
Jan Alexander Steffens (heftig) db61ec4a6b
Iterator: Manually implement Debug
The derived implementation is restricted to `where T: Debug`, but the
iterator doesn't actually contain a value of type T.
2019-09-04 14:34:04 +02:00
Jan Alexander Steffens (heftig) 8db9926107
log_handler test: Ignore unknown categories
Tests run parallel in multiple threads. This makes the log_handler test
flaky because it may see log messages triggered by other threads. Make
the handler ignore all messages not in the category we care about.
2019-09-04 14:02:55 +02:00
Vivia Nikolaidou 6488c42890 element: Added num_pads, num_src_pads, num_sink_pads
Exposing the corresponding struct element in GstElement
2019-09-03 17:14:47 +03:00
François Laignel 8af1da1a4e Fully qualify inner macros for exported macros...
... otherwise they can't be resolved in dependent crates compiled
for edition 2018.
2019-09-02 09:06:29 +00:00
Mathieu Duponchelle d3d503cea6 subclass/element: expose set_clock and provide_clock vmethods 2019-08-31 02:05:21 +02:00
François Laignel 1367becfaf DateTime: manual impl for PartialOrd, PartialEq and Debug
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/217
2019-08-21 12:34:15 +02:00
François Laignel ced522ed08 Implement ser / de for Date Values, Structure fields and Tags 2019-08-19 15:51:42 +02:00
François Laignel c74eef374a Fix serde for Values with optional Types
Attention: these changes induce breaking changes for the serde
representation of some types.

Serialization of `Value`s used to rely on the `get` function
followed by an `unwrap`. This means that optional types couldn't
be serialized when they were `None`.

This commit distinguishes between the optional `Value` `Types` and
the ones that always return some value.

The `Value`s, `Structure` fields and `Tag`s with following types are
now represented as `Option`s:

- `Buffer`
- `DateTime`
- `Sample` (note: this type is used for `Tag` images)
- `String` (except for `Tag`s - see the comment in `tags_serde.rs`).

The representations for these `Type`s remain unchanged when they are
used in-place (not as part of a `Value`).

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/215
2019-08-19 15:34:24 +02:00
François Laignel 26423a069c structure::tests: use error constructors 2019-08-16 15:04:01 +02:00
Sebastian Dröge f050750b5e Update CHANGELOG.md for 0.14.4 2019-08-14 22:48:16 +03:00
Sebastian Dröge e00781309b gstreamer/element: Use from_glib_none() for the release_pad() trampoline
The reference to the pad we get passed is not guaranteed to be valid for
the whole scope of release_pad(). It might be the last reference as
owned by GstElement, and gst_element_remove_pad() would destroy it then.
2019-08-14 11:58:05 +03:00
Sebastian Dröge 2829c7ee2f gstreamer: Add StructureRef::get_optional()
This only returns Err on type mismatches. If the field does not exist or
None it returns None, otherwise the value.

StructureRef::get() returns Err also if the field does not exist.
2019-08-13 18:30:40 +03:00
Sebastian Dröge 1b860825ee Update feature flags of all dependencies to include the same version as for the crate itself
This improves build times as it allows cargo to reuse more previous
build results when building crates separately.

Also remove the serde-pickle dependency. It was only used in a single
test and caused pulling in of quite a few dependencies.
2019-08-13 16:46:08 +03:00
François Laignel 514a05accd Manual update for new Value::get signature 2019-08-13 10:57:32 +02:00
François Laignel 5d012945df Regen 2019-08-11 10:43:30 +02:00
François Laignel 26fda95a54 Fix functions unit tests for v < 1_12 2019-08-08 19:38:42 +02:00
Josh Matthews 0e36ac5205 Add high level bindings for adding new log handlers and removing the default handler. 2019-07-22 16:06:41 +00:00
Sebastian Dröge fcc361f920 gstreamer: Add bindings for gst::calculate_linear_regression() 2019-07-17 00:24:13 +03:00
Sebastian Dröge eb59456ae3 Update CHANGELOG.md for 0.14.3 2019-07-16 12:47:15 +03:00
Sebastian Dröge 007f80ca32 buffer: Allow setting/unsetting buffer flags
As there are extension flags types, we need separate setter/unsetter
functions for the flags, or otherwise we would always clear the
extension flags types (e.g. GstVideoBufferFlags).
2019-07-16 11:51:23 +03:00
Sebastian Dröge 36b0cafc5e Update CHANGELOG.md for 0.14.2 2019-07-15 20:03:48 +03:00
Sebastian Dröge ae58a469d1 meta: Add support for ReferenceTimestampMeta 2019-07-14 22:32:10 +03:00
Sebastian Dröge d8325212f4 Fix various clippy warnings 2019-07-11 22:02:01 +03:00
Sebastian Dröge f63d50546a Don't use ONCE_INIT anymore now that Once::new() is const 2019-07-11 17:56:50 +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 3a8d05075d Switch everything from mem::uninitialized() to MaybeUninit or mem::zeroed()
And also fix a few cases where mem::uninitialized() was simply wrong to
use.
2019-07-11 17:56:50 +03:00
Sebastian Dröge bde6a04780 Regenerate everything with latest gir 2019-07-10 11:21:28 +03:00
Sebastian Dröge dcbf68e9e7 Update CHANGELOG.md for 0.14.1 2019-07-06 23:57:28 +03:00
Sebastian Dröge 9a3e7d0aa9 gstreamer/format: Fix serde serialization unit test
Regression from fdb95f0033
2019-07-06 10:19:03 +03:00
Sebastian Dröge 28a24a4fc0 Update versions to 0.15.0 2019-06-24 20:53:05 +03:00
Sebastian Dröge fa6cb789cd Update CHANGELOG.md for 0.14.0 2019-06-24 20:52:03 +03:00
Sebastian Dröge 47f0940b44 Regenerate everything with latest gir 2019-06-24 20:52:03 +03:00
Guillaume Desmottes 24d9dc6209 gstreamer: tags: make call to to_string() explicit
This one was actually working but better to be safe as it may be
ambigious.
2019-06-18 17:11:24 +05:30
Guillaume Desmottes 40d2db7095 gstreamer: caps: make call to to_string() explicit
This one was actually working but better to be safe as it may be
ambigious.
2019-06-18 17:11:24 +05:30
Sebastian Dröge b87ffa17bb Run rustfmt also over all the generated code 2019-06-18 13:12:00 +03:00
Sebastian Dröge e5aa6f59f9 Regenerate everything 2019-06-18 13:10:46 +03:00
Sebastian Dröge 4f024af7d6 gstreamer/serde: Fix compilation with serde feature enabled 2019-06-06 09:25:19 +03:00
Sebastian Dröge d1e562b9f6 Explicitly add dyn keyword to trait objects
Trait objects without are deprecated with the latest nightly and this
makes it more clear that we're doing dynamic dispatch anyway.
2019-06-06 09:09:34 +03:00
Guillaume Desmottes 7a69a1137c gstreamer: plugin_feature: use Rank enum 2019-06-04 12:56:18 +03:00
Guillaume Desmottes 1cd733fb0b gstreamer: allow to register using Rank enum directly
Prevent user to have to cast to a u32 manually.
2019-06-04 12:50:43 +03:00
Sebastian Dröge 2c31baaa0c gstreamer: Implement Add<u32> for gst::TypeFindProbability and fix comparison
While the enum is a signed integer, all operations inside GStreamer
(especially comparison) is based on unsigned integers.
2019-06-04 12:45:56 +03:00
Sebastian Dröge 620a9b2a95 gstreamer: Implement Add<u32> for gst::Rank and fix comparison
While the enum is a signed integer, all operations inside GStreamer
(especially comparison) is based on unsigned integers.
2019-06-04 12:45:56 +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 fdb95f0033 gstreamer/format: Implement formatted value arithmetic with overflow checks
We have a value to represent invalid/overflow anyway, so let's make sure
that all operations are actually not overflowing and if they do we
assigned that value to the result.
2019-06-03 08:25:43 +00:00
Sebastian Dröge fbcdf90386 gstreamer/format: Add various other arithmetic operation impls for the different formatted values
This includes gst::ClockTime.
2019-06-03 08:25:43 +00:00
Sebastian Dröge b2ffe98d59 gstreamer/fraction: Add impls for various other arithmetic operations on fractions
Any arithmetic operation on plain values or references in any order
should be possible now, and on fractions with i32.
2019-06-03 08:25:43 +00:00
Sebastian Dröge 37071c9d60 gstreamer: Fix build with serde feature enabled 2019-05-28 04:35:12 +02:00
Sebastian Dröge 004ce5d392 gstreamer: Re-export the paste crate for the gst_plugin_define! macro
And only depend on the paste crate if the subclass feature is requested.
2019-05-27 22:46:26 +02:00