Commit graph

1704 commits

Author SHA1 Message Date
Piotr Brzeziński
db446f3f46 gstreamer: bufferlist: Fix remove() range end being off by one
The end index was being calculated the same way as the start one, which is incorrect.
It should be +1'd when range is inclusive and left as-is if it's exclusive, not the other way around.
Fixed and added a simple test to verify correctness.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1494>
2024-08-05 09:36:44 +00:00
Guillaume Desmottes
efc87fd239 gstreamer: format: Percent: add getters
We had constructor from the percent/ppm/ratio values but not getters
to get those values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1493>
2024-08-05 09:41:59 +01:00
Sebastian Dröge
95104ac844 gstreamer: meta: Pass an empty tag array instead of NULL to gst_meta_register_custom()
NULL gives a critical warning but an empty, NULL-terminated array gives
the desired result.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/516

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1484>
2024-07-18 20:50:54 +01:00
Sebastian Dröge
afd662c94f Update CHANGELOG.md for 0.23.0 release
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1482>
2024-07-11 19:13:01 +03:00
Sebastian Dröge
0ed46425f6 Regenerate with latest gir-files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1481>
2024-07-11 17:48:59 +03:00
Sebastian Dröge
9b76ef35cf Regenerate with latest gir / gir files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1480>
2024-07-08 09:37:34 +03:00
Sebastian Dröge
94313e67c5 gstreamer: Unconditionally use gst_parse_context_copy()
It's available since 1.12.1 and the minimum supported version for the
bindings is 1.14 nowadays.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1478>
2024-07-06 11:21:31 +00:00
Sebastian Dröge
a871f71515 gstreamer: Use obj = x instead of obj: x in debug log macros
And deprecate the old usage. This gives better tooling support, and
especially allows rustfmt to format the macro body correctly.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/513

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1477>
2024-07-06 14:08:03 +03:00
Sebastian Dröge
adf3e9236a gstreamer: childproxy: Include child property name in error message when lookup fails
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1472>
2024-06-28 12:20:47 +03:00
Sebastian Dröge
7a5096b1e4 gstreamer: clock: Manually implement bindings for calibration related function
The rate is using two clock times in C but this is really just a u64.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1470>
2024-06-21 16:34:27 +03:00
Sebastian Dröge
f3d7e18bcd Update to system-deps 7
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1469>
2024-06-20 20:58:27 +03:00
Sebastian Dröge
53ede03b3b Update CHANGELOG.md for 0.22.6
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1467>
2024-06-19 20:51:31 +03:00
Sebastian Dröge
45ec7cedd9 Use Option::is_some_and(...) instead of Option::map_or(false, ...)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1466>
2024-06-19 11:17:58 +03:00
François Laignel
8527c0e39e Add new setters for collection Value setters in Builders
E.g. (also applies to `property`):

* `field_from_iter()`,
* `field_if_not_empty()`.

Use a macro to factorize implementation & documentation of `field` / `property`
convenience setters.

Also:

* add some `*_if_not_empty` for some iterator based setters.
* add `*_if` for predicate based setters.

Related to https://github.com/gtk-rs/gtk-rs-core/pull/1377

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1431>
2024-06-14 17:00:36 +02:00
Sebastian Dröge
f99c519a00 Fix various new 1.79 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1461>
2024-06-14 08:08:27 +03:00
Sebastian Dröge
6bab9de772 gstreamer: Actually re-export ByteSliceExt trait from prelude instead of the Dump struct
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1460>
2024-06-12 19:35:55 +03:00
Sebastian Dröge
7c87874c28 gstreamer: Add bindings for generic message details API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1457>
2024-06-11 10:18:08 +03:00
Sebastian Dröge
b59a92b29e Regenerate with latest gir
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1457>
2024-06-11 08:29:32 +03:00
Bilal Elmoussaoui
e6ed67cbc5 Regenerate with properties annotations supports
Removes some duplicated getters/setters

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1452>
2024-06-07 10:15:53 +00:00
Tim-Philipp Müller
c545154472 log: fix panic when using a log id with a formatted log message
Would panic because of a missing NUL terminator:

thread '<unnamed>' panicked at .. glib/src/gstring.rs:61:9:
assertion failed: !bytes.is_empty() && bytes[bytes.len() - 1] == 0

 3: glib::gstring::GStr::from_utf8_with_nul_unchecked
 4: gstreamer::log::DebugCategory::log_id_unfiltered_internal
      at gstreamer-rs/gstreamer/src/log.rs:465
 5: gstreamer::log::DebugCategory::log_id_unfiltered
      at gstreamer-rs/gstreamer/src/log.rs:425

Also enable logging on the category, so the logging code paths
are actually run here in the tests.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1451>
2024-06-02 17:32:26 +03:00
Bilal Elmoussaoui
4ebec84f5e Adapt to no longer renamed ffi crates
Allows us to set all the crates in the main workspace file, so changing
their versions or branch is much simpler and reduce the amount of noise
in the diff

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
2024-06-02 11:20:55 +02:00
Bilal Elmoussaoui
10aff0d66e Regenerate with latest gir
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
2024-06-01 15:14:58 +02:00
Sebastian Dröge
413a6baa8c Update CHANGELOG.md for 0.22.5 2024-05-23 16:06:42 +03:00
Sebastian Dröge
9e2c6268cb gstreamer: Use usize instead of u32 for various indices
This affects buffers, caps, caps features, structures and tag lists and
makes it easier to use them with other Rust APIs that use usize-based
indicing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1445>
2024-05-22 08:15:08 +00:00
Tim-Philipp Müller
4cda565a39 gstreamer: bufferlist: add another test for foreach_mut
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1446>
2024-05-22 06:59:40 +00:00
Sebastian Dröge
805cd6c591 gstreamer: bufferlist: Change remove function to take a range instead of index + length
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1444>
2024-05-21 08:21:17 +03:00
Sebastian Dröge
a0e58ec359 gstreamer: bufferlist: Check index/length when removing a buffer
Out of range values give assertions in the C function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1444>
2024-05-21 08:19:30 +03:00
Sebastian Dröge
9f151466b7 gstreamer: bufferlist: Check for out of range indices before trying to get buffer
Passing an index bigger than the length will cause an assertion in the C
function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1444>
2024-05-21 08:11:41 +03:00
Sebastian Dröge
c3619b45aa Update to itertools 0.13
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1443>
2024-05-20 14:03:58 +03:00
Seungha Yang
f59029b57c event: Fix leak in SelectStreamsBuilder
gst_event_new_select_streams() does not take ownership of GList

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1442>
2024-05-16 14:30:52 +00:00
Sebastian Dröge
b468280353 Improve code generation with panic=abort around panic handling code
None of that can ever be called in that case but the compiler can't know
that in more complicated cases like these. Handling it explicitly allows
no handling code to be generated at all here, like would already happen
everywhere else.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1441>
2024-05-16 16:38:15 +03:00
Sebastian Dröge
5af4a262b8 Regenerate with latest GStreamer gir files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1440>
2024-05-10 10:09:10 +03:00
Sebastian Dröge
2a9d0d035f Fix various new 1.78 clippy warnings
Quite a bit of API was accidentally not exported but apparently nobody
was using it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1437>
2024-05-02 18:13:27 +03:00
Sebastian Dröge
fe1fe5b114 gstreamer: Use a reference to a pointer of correct mutability for from_glib_ptr_borrow()
This hopefully makes it easier to use and harder to get the returned
lifetime wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1436>
2024-04-30 15:39:15 +03:00
Sebastian Dröge
ba4bd5c631 Add 1.26 version features and update 1.24 requirement from 1.23 to 1.24
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1435>
2024-04-30 12:36:37 +03:00
Sebastian Dröge
873aeff133 Regenerate with latest GStreamer gir files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1435>
2024-04-30 12:36:37 +03:00
Nick Steel
b7b5352353 log: Log trait adapter around the GStreamer debug system
Allows usage of normal `log` crate macros, and for other crates
using those macros to have their log messages go to the GStreamer
debug logs.

This implementation is based on the one found in Servo.

Fixes #187

DebugCategoryLogger is optional via 'log' feature
check category above threshold
skip_assert_initialized for constructor and helper

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1426>
2024-04-29 16:16:47 +01:00
Sebastian Dröge
57050f66c6 Regenerate with latest gir / gir-files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1429>
2024-04-27 11:31:11 +03:00
François Laignel
953e3747f2 Pad: allow building a Pad with an automatically generated name
For convenience, the `Pad` builder checks a name is provided when a wildcard-
named template is used. For `GhostPad`s, the builder tries to assign the name of
the target `Pad` making sure the provided `name` conforms to the `PadTemplate`.

This commit adds a function to optionally keep the `gst::Object` automatically
generated unique `Pad` name (such as `ghostpad4`) and reorganises name handling
so it is processed when `build` is invoked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1428>
2024-04-26 09:57:28 +00:00
François Laignel
db03c8edd1 Add field_if_some setter for builder ClockTime fields
Optional `ClockTime` fields already implemented their setters in such a way
that they could accept either `Option<ClockTime>` or `ClockTime`. This commit
adds `field_if_some()` setter variants for builder `ClockTime` builder fields
for consistency with other builder fields.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1424>
2024-04-17 17:15:41 +02:00
François Laignel
ea25c9262b Add field_if_some setter for builders
This commit adds `_if_some()` variants for builder field setters.
The variants aim at improving usability when setting optional fields.
E.g. currently, we need to write something like:

```rust
let opt_value = ...;
let mut sb = gst::Structure::builder("test")
    .field("mandatory_field", "mandatory");

if let Some(value) = opt_value
    sb = sb.field("optional_field", value);
}

let s = sb.build();
```

With `_if_some()`, this can be written like this:

```rust
let opt_value = ...;
let s = gst::Structure::builder("test")
    .field("mandatory_field", "mandatory")
    .field_if_some("optional_field", opt_value)
    .build();
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1424>
2024-04-17 17:15:39 +02:00
Sebastian Dröge
0524435190 Update CHANGELOG.md for 0.22.4 2024-04-08 16:11:10 +03:00
Sebastian Dröge
983e8b3308 Update CHANGELOG.md for 0.22.3 2024-03-19 18:13:28 +02:00
Sebastian Dröge
86d02890ca Regenerate with latest gir / gir files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1410>
2024-03-19 09:57:38 +02:00
Dave Patrick Caberto
353e3d1611 fraction: refer to numer and denom more consistently
This also lessens the tendency to confuse num with number.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1404>
2024-03-01 18:30:19 +08:00
Dave Patrick Caberto
b5cb4ae831 fraction: add const new_raw and from_integer methods
These are direct counterparts to their respective Rational32 constructors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1404>
2024-03-01 18:28:39 +08:00
Sebastian Dröge
28451435a4 Update CHANGELOG.md for 0.22.2 2024-02-26 14:50:48 +02:00
Sebastian Dröge
fcc7ab6b88 Update CHANGELOG.md for 0.22.1 2024-02-26 14:08:30 +02:00
Sebastian Dröge
18a02f6d34 gstreamer: Update serde flags tests for new ObjectFlags
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1401>
2024-02-26 11:29:19 +00:00
Sebastian Dröge
d5917be045 Regenerate with latest GStreamer gir files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1401>
2024-02-26 11:29:19 +00:00