Commit Graph

59 Commits

Author SHA1 Message Date
Dmitry Sharshakov
996f8a5832 v4l2: ignore symlinks in case of openat passthrough 2023-01-09 12:27:17 +00:00
Dmitry Sharshakov
549e543444 v4l2: report framerate using VIDIOC_G_PARM 2023-01-08 09:12:33 +00:00
Wim Taymans
ed9d3e7320 v4l2: fix some compiler warnings
Compare poiters with NULL and without ordering.
2023-01-06 10:32:25 +01:00
Dmitry Sharshakov
bb23fd787e v4l2: support setting controls 2023-01-03 12:19:14 +00:00
Dmitry Sharshakov
08107f1a02 v4l2: support querying controls 2023-01-03 12:19:14 +00:00
Dmitry Sharshakov
5c96928d12 v4l2: follow symlinks 2023-01-03 12:19:14 +00:00
Dmitry Sharshakov
bb24c8545d pw-uninstalled: make v4l2 easily available 2022-11-08 20:45:50 +00:00
Wim Taymans
8a2e154bae v4l2: turn some info to debug again 2022-11-08 16:37:22 +01:00
Wim Taymans
0d24f6b35f v4l2: Use the node format when available
When the node we try to link to already has a format, return that to the
application because we can't renegotiate to a new format.
2022-11-08 16:25:21 +01:00
Wim Taymans
53796a45cd v4l2: mark the fd as closed instead of -1
Or else we won't be able to close the fd later.
2022-11-08 15:47:55 +01:00
Wim Taymans
332fc0d9a5 v4l2: improve debug 2022-11-07 12:29:54 +01:00
Wim Taymans
6cffabd09d v4l2: don't mmap when the buffer has data already
When the buffer has data (but no fd), don't mmap the buffer but simply
use the data pointer directly.

This makes v4l2 work with inlined buffer memory.
2022-11-07 11:52:02 +01:00
Wim Taymans
6bae31e519 v4l2: pretend a dupped fd is the same as the original one
This makes it possible to reqbufs on a dupped fd with previously
reqbufs.
2022-11-07 11:50:35 +01:00
Wim Taymans
492920ca35 test: add another 6.1 channelmix test
Reorder the bitmask in the natural channel order to avoid confusion.
Add another test with RL/RR/RC channels.

See #2809
2022-11-06 10:57:25 +01:00
Wim Taymans
59f9ed41fb v4l2: use param_info to track param updates 2022-11-05 14:01:27 +01:00
Wim Taymans
11ab47e4c9 v4l2: suggest stride in Buffer param 2022-11-05 13:12:24 +01:00
Wim Taymans
c3206fa687 v4l2: release ref after adding file to maps 2022-11-05 13:12:01 +01:00
Wim Taymans
46123cfcec v4l2: improve debug 2022-11-05 13:11:43 +01:00
Wim Taymans
0e8ea21098 v4l2: fix compilation on older versions 2022-11-04 21:26:19 +01:00
Wim Taymans
b6f1935cfb v4l2: fix streaming compliance test
Add sequence number to frames.
Fix mmap tracking.
Improve debug.
Set right flags on dupped fds.
Handle blocking dqbuf.
Set timestamp and field on buffers.
Dequeue buffers in streamoff.
2022-11-04 17:34:04 +01:00
Wim Taymans
503bb94645 v4l2: we can request just 1 buffer perfectly fine 2022-11-04 15:21:32 +01:00
Wim Taymans
4186e3da6b v4l2: implement G/S_PRIORITY
Return busy when reqbufs is called from an fd that is not the owner
of the current reqbufs.
2022-11-04 13:14:46 +01:00
Wim Taymans
5a299e5685 v4l2: improve debug 2022-11-04 11:00:56 +01:00
Wim Taymans
4a92f355ad v4l2: fix enum_input, don't clear the index 2022-11-04 11:00:19 +01:00
Wim Taymans
8900722f55 v4l2: only accept CAPTURE buffer types in try_fmt 2022-11-04 10:59:39 +01:00
Wim Taymans
5a262b4bd3 v4l2: return a default format from G_FMT 2022-11-04 10:59:13 +01:00
Wim Taymans
73ad5d9057 v4l2: set colorspace 2022-11-04 10:58:50 +01:00
Wim Taymans
0f13d5a65e v4l2: reuse fd when opening the same path
When we open the same device multiple times, reuse the file structure
and dup the fd.
2022-11-04 10:36:49 +01:00
Wim Taymans
4cb1c790a4 v4l2: set the description correctly
The description needs to match what is expected by the compliance
test.
2022-11-03 17:36:55 +01:00
Wim Taymans
9aff5dfc8f v4l2: make bus_info compliant
It needs to start with something accepted by the compiance test.
2022-11-03 17:35:48 +01:00
Wim Taymans
2c4b574b8f v4l2: handle errors better
Only store the eventfd when valid or else we will try to close an
invalid fd.
Keep the errno value around, just in case it gets overwritten by
the free_file call.
2022-11-03 17:34:00 +01:00
Wim Taymans
faab559568 v4l2: handle multiple /dev/videoX nodes
Associate each PipeWire video source to a video device and let
applications probe and open multiple sources.
2022-11-03 13:27:49 +01:00
Wim Taymans
fbd3885ff1 v4l2: small cleanups
Improve size scoring.
Check video size after parsing.
2022-11-03 13:25:44 +01:00
Wim Taymans
866ef2ef21 v4l2: improve debug of fourcc 2022-11-03 13:25:10 +01:00
Wim Taymans
a6e3ac68d2 v4l2: use the node description as the card name 2022-11-03 13:23:26 +01:00
Wim Taymans
cd9dc974f5 v4l2: improve error debugging 2022-11-03 13:22:38 +01:00
Wim Taymans
d2aa240767 introspect: handle NULL result from info updates 2022-10-27 20:06:54 +02:00
Wim Taymans
d22feab92a spa: add macro to simplify array iterations some more
uint32_t i;
	for (i = 0; i < SPA_N_ELEMENTS(some_array); i++)
		.. stuff with some_array[i].foo ...

   becomes:

	SPA_FOR_EACH_ELEMENT_VAR(some_array, p)
		.. stuff with p->foo ..
2022-09-30 16:24:26 +02:00
Pauli Virtanen
240d212822 pipewire-v4l2: disable _FORTIFY_SOURCE when defining override functions
_FORTIFY_SOURCE defines always_inline versions of open etc. functions,
which conflict with our exported override versions.  Disable it for the
file that defines the override functions.
2022-07-10 16:05:27 +03:00
Lucas Holt
6a15a02ec2 Add support for MidnightBSD
Fix build issue

Fix build issue
2022-06-19 18:22:47 +00:00
Wim Taymans
61d318125e move PIPEWIRE_PROPS to stream and filter
Make all streams and filters handle PIPEWIRE_PROPS.
The order for applying stream/filter properties is:

1) application provided properties.
2) generic config.
3) match rules.
4) environment variables (PIPEWIRE_PROPS, ...) from generic to
   more specific.
5) defaults.
2022-04-22 09:37:21 +02:00
Wim Taymans
b9ace709dc pw-v4l2: clamp buffers to max
See #2029
2022-01-18 13:46:32 +01:00
Wim Taymans
35cbe4e939 buffers: make alignment optional
Make the alignment parameter optional when negotiating buffers.
Default to a 16 bytes alignment and adjust for the max cpu
alignment.
Remove the useless align buffer parameter in plugins, we always
set it to 16 anyway.
2022-01-03 12:32:26 +01:00
Wim Taymans
c387e83c65 pipewire-v4l2: avoid overflow in id calculation 2021-11-17 13:16:27 +01:00
Wim Taymans
5ed4977b38 destroy proxies when global is removed
When a global is removed, also remove the proxies. We can have multiple
proxies to a global otherwise when a client has a sequence of events
queued from the server like this:

Global 1 added
Global 1 removed
Global 1 added

The proxy we added in the firt event would not be destroyed because the
server did not know about it when global 1 was removed and then a
second one would be made.
2021-11-08 12:55:41 +01:00
Wim Taymans
9fee88239a pipewire-v4l2: only compile V4L2_BUF_CAP_SUPPORTS* when defined
Fixes #1766
2021-11-02 09:43:59 +01:00
Peter Hutterer
6fab8fabca meson: add a libv4l2-path option to match libjack-path
pw-v4l2 uses the gnu ld's ${LIB} features, see meson.build.
Make it possible to work around this by specifying an explicit path,
just like for pw-jac.

Fixes #1751
2021-10-28 07:38:02 +00:00
Arseny Maslennikov
ddb38bd742 pipewire-v4l2: pw-v4l2.in: fix parameter expansion in quotes
`@LIBV4L2_PATH@` can be expanded into a string containing literally
`${LIB}`, which is then reexpanded by the shell since it's enclosed in
double quotes. We fix this by using single quotes instead.
2021-10-23 04:35:31 +03:00
Gleb Popov
35c9de34e8 Add FreeBSD variant of the ioctl request check. 2021-10-22 19:09:16 +03:00
Barnabás Pőcze
0651e12ad8 pipewire-v4l2: actually close file descriptors
Close every file descriptor of a given `struct file` object
in `v4l2_close()` apart from the "main" file descriptor.
2021-10-18 09:03:12 +00:00