Commit graph

1336 commits

Author SHA1 Message Date
François Laignel
b8e1c25c85 gst/log: log arg eval fix non regression test 2022-09-21 17:20:43 +00:00
Sebastian Dröge
64829ac47a gstreamer: Use type parameters instead of trait objects for TypeFindFactory::call_function()
No need to do dynamic dispatch here.
2022-09-16 11:26:24 +03:00
Sebastian Dröge
1b10c5324d gstreamer: Add BinImpl::do_latency() 2022-09-16 06:54:55 +00:00
Sebastian Dröge
8a6de3ca4f gstreamer: Implement various operations on Signed for working with it more easily 2022-09-14 12:20:47 +03:00
François Laignel
f294339240 log: differ formatted args evaluation
When the `format_args!` macro is used, formatted args are evaluated
in order to form the argument collection that ends up being formatted
when requested to do so.

For the log macro, this means that any argument that is an expression
was evaluated even if the log level was below current threshold. This
can be examplified by the following code:

```rust
    gst::debug!(CAT, "{}", {
        println!("fmt arg executed");
        "A debug log"
    });
```

This used to print "fmt arg executed" even when the log threshold for
`CAT` was filtering `debug` out.

Note that this could break existing code that would incorrectly rely
on the side effect.
2022-09-13 19:25:14 +02:00
Sebastian Dröge
dec112d0a8 Regenerate with latest gir/gir-files/gst-gir-files 2022-09-13 12:13:07 +03:00
François Laignel
f014505e1c regen: rename feature 'ser_de' as 'serde' 2022-09-12 19:36:32 +02:00
François Laignel
069c6a2c01 Rename feature 'ser_de' as 'serde'
When I introduced the 'ser_de' feature, I couldn't find a way to
name it 'serde' while also make it pull the optional 'serde'
crate together with the other related dependencies.

With rustc >= 1.60 we can use 'dep:serde' to refer to the 'serde'
dependency as part of the 'serde' feature.
2022-09-12 19:36:30 +02:00
Sebastian Dröge
efe13948cc ci: Update gst-gir-files and bring autogenerated code in sync 2022-09-04 20:51:07 +03:00
Sebastian Dröge
35c6af424d Update minimum supported Rust version to 1.63 2022-09-04 10:37:13 +03:00
Sebastian Dröge
201eed8400 gstreamer: Sync param spec API with glib 2022-09-04 10:34:05 +03:00
Sebastian Dröge
44d899a0eb Regenerate with latest gir / gir-files / gst-gir-files 2022-08-31 11:13:08 +03:00
Guillaume Desmottes
e229288ecd gstreamer: manually implement Debug on PromiseReply
The default implementation was not very useful:

PromiseReply(
    Promise {
        inner: Shared {
            inner: 0x00007ff108001090,
        },
    },
)
2022-08-29 08:59:21 +00:00
Guillaume Desmottes
1e24e2d133 gstreamer: caps: improve Debug implementation 2022-08-25 10:54:16 +02:00
Guillaume Desmottes
0c9158f404 gstreamer: taglist: improve Debug implementation 2022-08-25 10:54:16 +02:00
Guillaume Desmottes
64c09353b7 gstreamer: structure: improve Debug implementation
g_strdup_value_contents() output is not easily readable with nested
structures
2022-08-25 10:54:16 +02:00
Thibault Saunier
e9d95eda59 gstreamer: Add extension trait to mark API as plugins API
This adds an extension trait implemented for GType so we can
add and check plugins API status.
Required so we can document plugins written in rust.
2022-08-24 10:38:06 -04:00
Sebastian Dröge
76f01516e3 Regenerate with latest GStreamer gir files 2022-08-19 19:42:05 +03:00
Sebastian Dröge
8d9abb935b gstreamer: Update to ron 0.8 2022-08-16 13:09:49 +03:00
François Laignel
be2de21602 Update option-operations to 0.5.0
This fixes the trait `OptionEq` not being exported in `prelude`.
2022-08-15 22:44:53 +02:00
Sebastian Dröge
fbad0fd0bc Regenerate with latest gir / gir-files / gst-gir-files 2022-08-14 14:02:50 +03:00
Guillaume Desmottes
c5d19e7c80 miniobject: implement ptr_eq() on ref type 2022-08-12 11:15:08 +02:00
Guillaume Desmottes
c0fd8a8aad gstreamer: add BufferRef::ptr_eq() 2022-08-12 08:29:49 +02:00
Guillaume Desmottes
2dcd5cf9eb as_ptr() and as_mut_ptr() accessors are safe
Nothing unsafe about getting a pointer, deferencing it is unsafe.
2022-08-12 08:29:49 +02:00
Sebastian Dröge
b06a692dea Fix a new beta clippy warning
warning: unused return value of `std::boxed::Box::<T>::from_raw` that must be used
  --> gstreamer-rtsp-server/src/rtsp_session_pool.rs:23:5
   |
23 |     Box::<F>::from_raw(ptr as *mut _);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
2022-08-10 10:27:27 +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
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
b5920ee729 Regenerate with latest gir 2022-07-18 13:25:36 +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
Tomasz Andrzejak
2090452e3d Update minimum supported rust version 2022-07-14 15:23:34 +02: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
Paolo Borelli
f2a2e6702c caps: add new_empty_simple constructor 2022-07-05 14:49:21 +02:00
Sebastian Dröge
4dade30f0d Fix/silence a couple new clippy warnings 2022-06-30 13:08:33 +00:00
Sebastian Dröge
65629426cb tracer: Add bindings for new pad chain hooks 2022-06-30 08:46:06 +03:00
Sebastian Dröge
90aaa32957 Regenerate 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
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
Stephan Seitz
c254c5fd1a gstreamer: add PadProbeId::as_raw()
This allows to convert PadProbeId to numberic values without
taking them by value (like `into_glib`).

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/382#note_1391236
2022-05-23 08:19:47 +00:00
Sebastian Dröge
cb1f08a425 gstreamer: Implement FusedFuture for PromiseFuture 2022-05-22 12:42:42 +03:00
Sebastian Dröge
aaf601831e gstreamer: Index structures/taglist more safely
Accessing after the length will lead to a critical warning and should
not happen.
2022-05-22 12:42:42 +03:00
Sebastian Dröge
d4430ecc6a Implement more iterator functions / traits in custom iterators for efficiency reasons 2022-05-22 12:42:42 +03:00
Philippe Renon
8f1c94f45d Regenerate with latest gir 2022-05-20 17:48:40 +02:00