Commit graph

70 commits

Author SHA1 Message Date
Barnabás Pőcze
6f058e6b0d spa: examples: local-libcamera: pass camera id to the plugin 2025-08-01 15:40:28 +00:00
Barnabás Pőcze
4e4086934c spa: examples: local-libcamera: do not set SPA_PARAM_Props
Setting `SPA_PROP_device` has no effect, do not do it.
2025-08-01 15:40:28 +00:00
David Coles
dd652d01b8 Port videotestsrc to LoopUtils
The `LoopUtils` interface can be used on platforms that don't
support the Linux-specific `timerfd` interface.

Added `local-videotestsrc` to validate the plugin still functions.

Restructured the SDL event loop as the window would not update
under WSL2, resulting in a black window being shown. All rendering
in SDL2 must happen on the same thread that originally created the
renderer.

To prevent the SDL event loop from being starved, we make sure to
poll it at least every 100 ms.
2024-07-01 15:28:14 +00:00
Wim Taymans
9592b0af2a examples: fix mapoffset in examples
The mapoffset should be using in the mmap call as the offset.

Mapping the whole memory before the offset and then ignoring the part
before it seems like it can work but it actually has some problems:

1. some drivers (v4l2) use the mapoffset to calculate the buffer to map
2. we waste resources for mapped but unused pages.

The problem with the mapoffset is that it needs to be page aligned and
that used to be a problem in the past. Nowadays PipeWire no longer set
the mapoffset for any of the memory that it allocates.
2024-06-13 10:11:29 +02:00
Barnabás Pőcze
6a26e6dd3f treewide: fix some format string issues
Use the proper specifier, and cast to a known type where the type
is not guaranteed by any standard.

See #3975
2024-04-25 07:24:10 +00:00
Wim Taymans
1b6370ace1 meson: fix compilation when spa-plugins is disabled
Fixes #3811
2024-02-06 11:50:54 +01:00
Pauli Virtanen
422c270a74 meson.build: fix compile with -Dexamples=disabled 2023-11-28 10:18:25 +00:00
Barnabás Pőcze
436787d6ba treewide: try to use const char * for string literals 2023-09-16 17:47:35 +02:00
Barnabás Pőcze
8c17a6626d treewide: mark some functions static
These were found by enabling the "missing-declarations" warning.
2023-07-03 19:40:31 +02:00
Wim Taymans
3b3146e852 examples: fix type of getopt_long return value 2023-04-18 09:48:19 +02:00
Ashok Sidipotu
805a1c61d9 adapter-control: avoid the divide by zero while generating sequence. 2023-04-05 16:33:09 +05:30
Ashok Sidipotu
b61bf8a27d adapter-control: bundle the volume ramp parmeters with volume 2023-04-03 19:04:55 +00:00
Ashok Sidipotu
e75fe4d469 adapter-control: add support of scale volume ramp param 2023-04-03 19:04:55 +00:00
Ashok Sidipotu
7b91d506f1 adapter-control: add support for volume ramp time params
- Add support for both native and non-native modes
- Add "examples" in the help text
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
075fd49ccc adapter-control: add CLI options
-To select between non-native(via control channel) and native modes(via audio
adapter ). The control port will be opened only in the non-native mode.
-To select different sample and sample step sizes. The Legacy non-native
 mode also uses these params now.
-To provide the alsa device.
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
b1b5367d40 adapter-control: use the volume ramp parameters to ramp volume
Add a compiler macro for now to switch between the inband(control port based)
volume ramping and out of band(using volume ramp parameters)
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
2a12dfeb47 adapter-control: add more debug messages 2023-04-03 19:04:55 +00:00
Ashok Sidipotu
3ed282fad5 adapter-control: enable SPA debug logs
Also add timestamp to the logs.
2023-04-03 19:04:55 +00:00
Wim Taymans
7da61e2dfa examples: fix adapter control
target_rate and duration need to be configured now.

Fixes #3125
2023-03-30 15:15:41 +02:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
e0af67b670 examples: fix spelling mistake 2022-06-16 16:40:47 +02:00
Wim Taymans
f74b59b39f examples: fix volume fade in and out with control 2022-06-16 09:09:27 +02:00
Wim Taymans
708b57aa64 examples: add control support to adapter
Based on patches by Julian Bouzas  in !222
2022-06-16 09:09:27 +02:00
Wim Taymans
fa9baa6488 examples: fix up adapter-control
Negotiate format, then buffers.
Give quantum-limit as a property when making nodes.
Set clock and position io and fill in rate and duration.
2022-06-16 09:09:27 +02:00
Barnabás Pőcze
2b110af366 treewide: meson.build: use dependency variable for SPA
Use `spa_dep` everywhere instead of `spa_inc`,
and remove `spa_inc` altogether.
2021-12-28 18:34:06 +01:00
Pauli Virtanen
bbc2136e89 meson: ensure all examples are included in doc
Move declaration of examples to use same file lists for build and docs.
2021-11-02 09:46:14 +00:00
Pauli Virtanen
98a0e54d5f doc: link examples to Doxygen docs
Include examples to the documentation, using Doxygen's example system.
2021-10-10 00:35:46 +03:00
Peter Hutterer
0054319d88 meson.build: add -D_GNU_SOURCE to the project arguments
This appends it to every compilation command so we can get rid of the c_args
for (almost all) executables.
2021-06-09 07:47:51 +00:00
Peter Hutterer
92514d57e4 treewide: replace plain strcmp() calls with spa_streq 2021-05-18 22:10:27 +10:00
Peter Hutterer
2405f0942b spa/buffer: rename SPA_MEMBER to SPA_PTROFF
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
2021-05-06 09:39:39 +00:00
Peter Hutterer
223f20709d meson: replace join_paths(a, b) with a / b
More readable and from the meson reference manual:
(since 0.49.0) Using the/ operator on strings is equivalent to calling join_paths.
2021-04-15 06:57:00 +00:00
Thibault Saunier
485bae5eb0 meson: Use feature options everywhere it makes sense 2021-03-10 20:18:34 +00:00
Wim Taymans
5295caf0f3 examples: dlclose on some errors 2020-07-02 16:07:54 +02:00
Wim Taymans
f08c35259c avoid uninitialized variables 2020-06-23 15:25:27 +02:00
Simon McVittie
b852b58f82 Optionally install examples and tests
This makes it easier to test PipeWire in its "as-installed" state,
for example in an OS distribution.

The .test metadata files in ${datadir}/installed-tests/${package} are
a convention taken from GNOME's installed-tests initiative, allowing a
generic test-runner like gnome-desktop-testing to discover and run tests
in an automatic way.

The installation path ${libexecdir}/installed-tests/${package} is also
a convention borrowed from GNOME's installed-tests initiative.

In addition to the automated tests, I've installed example executables
in the same place, for manual testing. They could be separated into
a different directory if desired, but they seem like they have more
similarities with the automated tests than differences: both are there
to test that PipeWire works correctly, and neither should be relied on
for production use. Some examples are installed in deeper subdirectories
to avoid name clashes.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-16 17:58:02 +00:00
Simon McVittie
8b97d2ae74 spa examples: Load plugins from SPA_PLUGIN_DIR or installed path
This lets them be used installed or uninstalled, like pipewire itself.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-16 17:58:02 +00:00
Wim Taymans
0b47b47b6c libcamera: disable by default
Until it is at least more comon available in distros.
2020-06-04 10:50:54 +02:00
raghu447
9024cc4444 Integrating libcamera 2020-06-04 10:36:39 +02:00
Wim Taymans
0a54249718 fix error reporting
dlopen and dlsym don't set errno
2020-05-12 17:23:30 +02:00
Wim Taymans
4cb2d58e89 factory: do more version checks
So that we don't accidentally load an old plugin.
2020-04-22 18:10:26 +02:00
Wim Taymans
5da6973863 example: fix buffer check 2020-03-19 12:58:39 +01:00
Wim Taymans
a528189d26 slave -> follower
We use master/follower terminology everywhere.
2020-02-21 10:47:32 +01:00
Wim Taymans
4bd6f5a055 examples: fix some typos and indentation errors 2020-02-04 13:02:38 +01:00
Julian Bouzas
a5d17ba6d1 spa: add adapter-control example to test audioadapter nodes
Example executable that runs an output audioadapter using audiotestsrc as slave
with an input audioadapter using alsa-pcm-sink as slave for easy testing.
2020-02-04 12:00:27 +01:00
Julian Bouzas
1eba8d7f74 spa: add support system so that example-control can play audio
The example-control executable does not play audio. This is because
alsa-pcm-sink needs a data system to run. This patch fixes the example by
loading a data system from libspa-support before creating the nodes.
2020-02-04 11:55:28 +01:00
Wim Taymans
ac24743b2e the epoll shim should only be used by the system library.
All other places should use the system library to get the right
fds.
2019-11-19 15:16:18 +01:00
Gleb Popov
fd937fa378 On FreeBSD, add dependency on epoll-shim library.
FreeBSD doesn't provide timerfd and eventfd functions. These are implemented in
3rd party library called epoll-shim. Link targets requiring these functions to
this library.
2019-11-19 13:41:40 +01:00
Wim Taymans
9ffec214b8 fix includes 2019-10-25 15:01:02 +02:00
Wim Taymans
59bf522ce1 system: use the same bits as POLL and EPOLL
Use the same bits for the io mask as POLL and EPOLL so that we
can avoid conversions.
2019-09-19 13:15:38 +02:00
Wim Taymans
4381e79632 control: clean up some control includes
Remove control from channelmix, it's not used
Add control metadata
Add OSC control type
Improve some docs
2019-09-16 15:49:46 +02:00