Commit graph

2921 commits

Author SHA1 Message Date
Vivia Nikolaidou
583ef0395d audio: Add new_interleaved() to AudioCapsBuilder
Because it's very common that elements support only interleaved audio.
2022-08-10 09:50:01 +00:00
Sebastian Dröge
2cb7fc8122 gstreamer: Add GstParamSpecBuilderExt trait to easily allow setting controllable, mutable-ready and other extension flags 2022-08-10 12:28:05 +03:00
Sebastian Dröge
446f09fec6 gstreamer: Implement new ParamSpecBuilderExt trait from glib 2022-08-10 12:03:51 +03:00
Sebastian Dröge
8a50bbcaa3 audiobuffer: Remove unnecessary ref/deref
warning: deref on an immutable reference
   --> gstreamer-audio/src/audio_buffer.rs:255:35
    |
255 |             Self::Owned(ref b) => &*b,
    |                                   ^^^
    |
    = note: `#[warn(clippy::borrow_deref_ref)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
2022-08-09 21:08:22 +00:00
Sebastian Dröge
9018d1e3ac examples: Update to glutin 0.29 2022-08-09 18:46:00 +00:00
Vivia Nikolaidou
7a9537c0fd audio, video: Default values in caps builders
AudioCapsBuilder::new() will have the default values for
rate/channels/layout/format. Similarly, VideoCapsBuilder::new() will
have the default values for format/width/height/framerate.
2022-08-09 15:00:54 +03:00
Vivia Nikolaidou
751a5b4788 gstreamer-video: Add tests for previous/next fraction 2022-07-20 11:06:21 +00:00
Vivia Nikolaidou
138bc71051 gstreamer-audio: Add AudioCapsBuilder 2022-07-20 11:06:21 +00:00
Vivia Nikolaidou
32fbb04fa4 gstreamer-video: Add VideoCapsBuilder 2022-07-20 11:06:21 +00:00
Sebastian Dröge
95b541cf82 ci: Update to Rust 1.62.1 2022-07-19 16:51:18 +03:00
François Laignel
2d17d46c50 gst: use Signed where applicable 2022-07-18 23:26:20 +02:00
François Laignel
414222aa99 gst/format: Signed wrapper
Functions such as Segment::to_running_time_full replicate the C
signature for the return type: an integer indicates whether the
resulting value must be interpreted as positive or negative.
In Rust, alternatives are usually represented using an enum.

This commit implements an enum wrapper to represent the sign
and adds functions to FormattedValue to ease Signed handling.
2022-07-18 23:26:20 +02:00
Sebastian Dröge
dccd0f9e01 ci: Update rustup to 1.25.1 2022-07-18 13:26:17 +03:00
Sebastian Dröge
8cb13ac752 video: Add new Colorimetry::is_equivalent() 2022-07-18 13:25:48 +03:00
Sebastian Dröge
b5920ee729 Regenerate with latest gir 2022-07-18 13:25:36 +03:00
Sebastian Dröge
16655828ab Update GStreamer gir files 2022-07-18 13:20:45 +03:00
Sebastian Dröge
afe594089b Update gir-files 2022-07-18 13:14:34 +03:00
Sebastian Dröge
4201727769 Update gir 2022-07-18 13:14:23 +03:00
Sebastian Dröge
cf1a64ecf8 gstreamer: Hide some useless enum variants that only make sense in C 2022-07-18 13:13:48 +03:00
François Laignel
99fb9423d2 regen: optional return type for TestClock::next_entry_type 2022-07-15 13:38:23 +02:00
François Laignel
8720c9c386 check: fix optional return type for TestClock::next_entry_type 2022-07-15 13:38:23 +02:00
Tomasz Andrzejak
2090452e3d Update minimum supported rust version 2022-07-14 15:23:34 +02:00
Sebastian Dröge
538eb95e51 ci: Update to rustup 1.25.0 and meson 0.63.0 2022-07-12 10:26:44 +03:00
François Laignel
a787197254 Use CompatibleFormattedValue where applicable
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1059
2022-07-11 19:45:52 +02:00
François Laignel
865df62f8d gst/format: add CompatibleFormattedValue
The trait CompatibleFormattedValue can be used to check argument
compatibility to a certain Format. This is convenient to define
function which accept several FormattedValues which must hold
values of the same Format.

This trait enforces format compatibility at compilation time for
SpecificFormattedValues and at runtime when a GenericFormattedValue
is provided.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1059
2022-07-11 19:45:52 +02:00
François Laignel
fe319af598 Implement FormattedValue on any candidate type
The trait FormattedValue was only implemented on types which
could implement the full range of values for a Format. In order
to declare a function which could take both the intrinsic type
of any Format (e.g. `ClockTime`) as well the full range of values
(e.g. `Option<ClockTime>`), the argument was declared:

```rust
    impl Into<GenericFormattedValue>,
```

This commit implements `FormattedValue` for any type representing
a format. E.g.: both `ClockTime` and `Option<ClockTime>` will now
implement `FormattedValue`. The trait `FormattedValueFullRange`
is implemented on types which can be built from any raw value.

These changes are intended to help for the implementation of a
means to enforce format conformity at compilation time for
functions with multiple formatted value arguments.

The following signatures were found to be incorrect and are fixed:

- `message::StepDone`: forced the type for `amount` and `duration`
  to be of the same type, when `duration` is expected to be of the
  `Time` format.
- `query::Convert::set`: the two arguments were forced to the same
  type, so potentialy the same format, unless a
  `GenericFormattedValue` was used.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1059
2022-07-11 19:45:52 +02:00
Guillaume Desmottes
fbceaab941 utils: streamproducer: add API to retrieve last sample from producer
This may be used for example to easily generate thumbnails from video
producers.
2022-07-11 11:32:06 +02:00
Guillaume Desmottes
0e17878bed utils: streamproducer: add API to retrieve pushed and dropped buffers
This may be used by applications to compute statistics about the overall
pipeline health, like the ratio of buffers dropped.
2022-07-11 09:10:52 +02:00
Paolo Borelli
f2a2e6702c caps: add new_empty_simple constructor 2022-07-05 14:49:21 +02:00
Sebastian Dröge
17005f220b ci: Update to Rust 1.62 2022-07-01 00:04:33 +03:00
Sebastian Dröge
4dade30f0d Fix/silence a couple new clippy warnings 2022-06-30 13:08:33 +00:00
Sebastian Dröge
f30fcbcf9a pbutils: Fix PbUtilsCapsDescriptionFlags serde (de)serialization tests 2022-06-30 12:42:37 +03:00
Sebastian Dröge
65629426cb tracer: Add bindings for new pad chain hooks 2022-06-30 08:46:06 +03:00
Sebastian Dröge
07562c592f video: Add bindings for is_common_aspect_ratio() 2022-06-30 08:46:06 +03:00
Sebastian Dröge
90aaa32957 Regenerate 2022-06-30 08:46:06 +03:00
Sebastian Dröge
fb724aedeb Update gst-gir-files 2022-06-30 08:46:06 +03:00
Sebastian Dröge
8e9e135128 Update gir-files 2022-06-30 08:46:06 +03:00
Sebastian Dröge
542bb130f4 Update gir 2022-06-30 08:46:06 +03:00
Sebastian Dröge
f333991a5a ci: Update image 2022-06-30 08:46:06 +03:00
Sebastian Dröge
c61d913ec6 tracer: Add support for the 1.20 "plugin-feature-loaded" hook 2022-06-29 10:13:59 +03:00
Sebastian Dröge
9e77ab3212 tracer: Re-order trait functions slightly for the order to make more sense 2022-06-29 10:13:36 +03:00
Sebastian Dröge
14f485d0b1 bus: Take ownership of the message in post() 2022-06-28 23:36:08 +03:00
Sebastian Dröge
20ac231146 gstreamer: Allow borrowing Segments from Values without copying 2022-06-27 22:28:49 +03:00
Sebastian Dröge
c9d07219c8 Store whether GStreamer was initialized in an AtomicBool
Avoids a function call in the normal case.
2022-06-27 10:28:28 +03:00
Sebastian Dröge
7754b8dd70 allocators: Reduce number of initialization check macros 2022-06-27 10:07:58 +03:00
Sebastian Dröge
310ff531fb base: Fix memory leak if BaseSrc/PushSrc parent class is not filling the provided buffer as it should 2022-06-24 11:13:06 +03:00
Sebastian Dröge
b28664ccbd gstreamer: Fix serde serialization tests
ron serialization is now writing `1.0` instead of just `1`.
2022-06-24 11:13:06 +03:00
Sebastian Dröge
6b47d646c0 base: Add support for returning buffer lists from BaseSrc/PushSrc subclasses 2022-06-24 11:13:06 +03:00
Sebastian Dröge
5e3ace0ecc ci: Fix syntax for coverage reports to the new format 2022-06-07 09:04:40 +03:00
Sebastian Dröge
2c373f5d24 examples: Update to memfd 0.6 2022-06-06 11:18:40 +03:00