Commit graph

2881 commits

Author SHA1 Message Date
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
Sebastian Dröge
50f3eee8eb play: Mark play_message module as private
The only type that is defined in it is re-exported at the crate root.
2022-05-24 11:02:27 +03:00
Philippe Renon
01b8279bc1 examples: add GstPlay example 2022-05-24 06:55:12 +00:00
Philippe Renon
35aff36c61 Introduce gstreamer-play 2022-05-24 06:55:12 +00:00
Philippe Renon
f35baffb52 Update gst-gir-files 2022-05-24 06:55:12 +00: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
Philippe Renon
5ed8416717 Update gir 2022-05-20 17:48:40 +02:00
Sebastian Dröge
e76ae3f434 gstreamer: Fix a few new clippy warnings 2022-05-20 11:19:07 +03:00
Sebastian Dröge
0055399471 ci: Update to Rust 1.61 2022-05-19 18:10:24 +03:00
Jordan Petridis
7283fe69b2 ci: Build gstreamer-gl on windows
This was disabled since DirectX wasn't available, but its working
now on the server2022 image that provides the required headers
and dlls.
2022-05-19 13:26:34 +03:00
Jordan Petridis
9d873d6755 ci: define the dependencies between jobs
This means that jobs can start the moment they are ready, instead
of waiting for the previous stage to finish.

Also define their interruptibility so new pipelines can automatically
cancel the previous ones.

https://docs.gitlab.com/ee/ci/yaml/index.html#needs
2022-05-18 22:21:08 +03:00
Jordan Petridis
7075a4b3ea ptp_clock: fix build on windows
c_ulong/gulong can be 32bit or 64bit depending on the platform.
Always cast it to u64 so the compiler will be happy.
2022-05-18 22:20:37 +03:00
Jordan Petridis
4d7bd9bfcb ci: use rules instead of only/except
only/except has got deprecated in favour of rules

maybe it fixes #370 ?

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/701>
2022-05-18 19:51:49 +03:00
Jordan Petridis
d53dfcf94e ci: use a custom powershell script to run windows tests
There are a couple things going on here.

First, we need to avoid building egl/wayalnd/x11 crates on windows
as they can't be built.

Then we need to avoid running -sys tests as they don't succeed
currently. See [1]

Finally use a matrix:parallel job to tests multiple build
configurations.

[1] https://github.com/gtk-rs/gtk3-rs/issues/54

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/701>
2022-05-18 19:51:49 +03:00
Jordan Petridis
5e27da5a1c ci: add an msvc 2017 test
Tests disabled for now, till some quirks are worked out.
Thi should be good enough to at least not break the build though.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/701>
2022-05-18 19:51:49 +03:00
Jordan Petridis
842dad3fa5 Cargo.toml: add cross-platform crates to default-members
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/701>
2022-05-18 13:12:47 +03:00
Philippe Renon
5d2f36fac3 gstreamer: implement FromGlibPtrBorrow trait for gst::Structure
needed for callbacks that pass GstStructure by reference
for example: the PlaySignalAdapter error and warning signals

needed by https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1036
2022-05-17 23:19:35 +02:00
Philippe Renon
268e351dde examples: fix clippy errors 2022-05-17 21:47:34 +02:00
Thibault Saunier
8c69388eff utils: Re export AddConsumerError 2022-05-17 20:19:12 +03:00
Guillaume Desmottes
5349822962 utils/streamproducer: add ConsumptionLink
Having an explicit link object makes it much easier to build complex
producers/consumers dynamics graphs.
It provides helper to switch producers and prevent accidentally keeping
broken links around as they are disconnected on Drop.
2022-05-17 11:04:35 +03:00
Guillaume Desmottes
f68efd0cab utils/streamproducer: add API to not forward eos to consumers
User may want to plug another producer when one is eos, in such case we
don't want to propagate eos to consumers.
2022-05-17 11:04:35 +03:00
Guillaume Desmottes
351f070c8e utils/streamproducer: reset callbacks when removing consumer 2022-05-12 14:56:55 +02:00
Sebastian Dröge
98cc289bcc utils/streamproducer: Add StreamProducer::error() to signal an error message to all consumers 2022-05-12 10:51:56 +03:00
Sebastian Dröge
e263bd8945 utils/streamproducer: Request keyframes without a lock held and also after an appsrc has dropped some data 2022-05-12 10:44:59 +03:00
Sebastian Dröge
d6095900e9 utils/streamproducer: Improve debug output a bit 2022-05-12 10:37:14 +03:00
Sebastian Dröge
e82d388410 utils/streamproducer: Index hashmap by appsrc instance instead of pointer
This behaves the same but requires a little bit less code.
2022-05-12 10:34:11 +03:00
Sebastian Dröge
a51235048d utils/streamproducer: Add StreamProducer::configure_consumer()
This allows configuring an `appsrc` before actually adding it as
consumer at a later time, and can be useful if the pipeline with the
source should be started earlier than adding it to a consumer.

Also use strongly-typed property API for the `appsrc` properties.
2022-05-12 10:34:06 +03:00
Thibault Saunier
f3bba21faa Introduce StreamProducer
Introduce a new `gstreamer-utils` crate where we implement a
`StreamProducer` structure that allows "producing" pipeline (Producers)
pushing their data to 0 or several "consuming" pipelines. The Producer
needs to push their data to an `appsink` which the `StreamProducer` controls
and the "consumer" pipelines need to have an AppSrc which the same
StreamProducer controls.

It allows similare behavior as a `tee` element but with a simpler to
handle addition and removal of "consumers" as well as a total decoupling
of the various consumer, both between each others and the producer
pipeline.

This has simply been extracted from
[webrtcsink](https://github.com/centricular/webrtcsink/blob/main/plugins/src/webrtcsink/utils.rs)
2022-05-11 10:14:54 -04:00
Thibault Saunier
56a46fc6fd ci: Re-implement the gi-checker in python
To cleanup and ignore the gstreamer-utils crate
2022-05-11 10:14:54 -04:00
Sebastian Dröge
081d42ac86 net: Add various static PTP clock API
This allows initializing the PTP clock infrastructure, deinitializing
it, checking the current status and adding statistics callbacks.
2022-05-11 14:19:50 +03:00
Jordan Petridis
b62d22852e ci: cleanup the checkouts in the docker image after install 2022-05-10 10:11:47 +03:00
Sebastian Dröge
45e16f7753 gstreamer: Add #[must_use] annotation to PadTemplateBuilder 2022-05-08 11:41:54 +03:00
Guillaume Gomez
c1d3ed5eac Use IntoGlibPtr trait instead of implementing into_ptr 2022-05-07 13:38:11 +02:00
Sebastian Dröge
cd49659fae gstreamer: Add a PadTemplateBuilder
And only allow setting documentation caps via that. It's not actually
allowed to update the documentation caps at random times as it is not
thread-safe.
2022-05-06 16:57:06 +03:00
Sebastian Dröge
0aa59be45c gstreamer: Improve accessors to various pad template fields 2022-05-06 16:22:40 +03:00
Sebastian Dröge
45856ac35b gstreamer: Return a glib::List instead of a Vec for the pad template list
Avoids an unnecessary allocation for the `Vec`.
2022-05-06 12:42:52 +03:00
Vivienne Watermeier
1b22be2e15 Add De/Serialization for most bitflag types
Represents combinations of flags with a '+' separated string of nicks,
or an empty string for no flags set.

Note that most flag types will ignore any flags using multiple bits when
serializing, since in most cases these flags cover all used bits.
2022-05-06 09:05:52 +00:00