Commit graph

314 commits

Author SHA1 Message Date
Wim Taymans
ecd1d3e1d7 Move node.pause-on-idle setting to config files
So that we can configure it.
Add some more docs to the config file
2021-02-08 17:19:47 +01:00
Wim Taymans
2b44f42845 pass the complete buffer size to snprintf
There is no reason to pass size-1, snprintf will always put a \0
at the end.
2021-02-02 12:09:29 +01:00
Wim Taymans
af092a9a7e v4l2: respect allowed data types
Check if we can do DmaBuf as the data type before we attempt this.
Otherwise we don't get any data in clients that can't deal with
DmaBuf.
2021-01-21 16:04:37 +01:00
Wim Taymans
938e2b1451 v4l2: profiles params are not implement yet 2020-12-17 16:13:19 +01:00
Wim Taymans
22c793aa87 v4l2: add inotify support
Wait with inotify until we can access the device node before emiting
the new device.
Clean up alsa-udev and make it more like v4l2-udev
2020-12-17 10:43:57 +01:00
Wim Taymans
bd4663b3cc v4l2: log open/close as info 2020-12-09 17:24:54 +01:00
Wim Taymans
9639f32db5 v4l2: zero some structures before ioctl 2020-09-29 17:06:53 +02:00
Wim Taymans
ced338ad7d v4l2: mmap the buffer again
Some drivers need a mmaped buffer...
2020-09-29 17:06:24 +02:00
Wim Taymans
ed1ee3f164 v4l2: detect driver reusing buffers
Some drivers seem to only use 2 buffers when asked for 16 buffers. We
can see this because the buffer is already queued. In this case, just
use the 2 buffers.

See #294
2020-09-29 12:33:14 +02:00
Wim Taymans
9f1d84e37c v4l2: in alloc buffer, don't mmap, just pass the fd
If we can't use EXPBUF, just put the fd and mapoffset in the buffer
memory. This way we can pass the fd to the client and let it mmap .
2020-09-27 17:07:29 +02:00
Wim Taymans
59990ea049 v4l2: fall back to mmap when EXPBUF fails
If EXPBUF returns and error, try to mmap instead.

Fixes #294
2020-09-27 16:30:51 +02:00
Wim Taymans
cce8f3fb08 v4l2: improve debug 2020-09-27 16:30:06 +02:00
Wim Taymans
7a2741c9e1 v4l2: do TRY_FMT on the filter format
Do a TRY_FMT on the filter format before enumerating the sizes with it
because some drivers don't check the format anymore.

Fixes #294
2020-09-19 13:32:47 +02:00
Wim Taymans
67b692396b v4l2: remove format checks
When a caller sets a format, we do this regardless of the currently
configured format.
2020-06-18 18:26:00 +02:00
Wim Taymans
6e74edc14e v4l2: always stop and clear buffer when setting a format
The caller frees the buffers after setting a new format.
2020-06-18 18:23:36 +02:00
Wim Taymans
ff4a314022 use fstat when we can
This avoids having things change between the stat and open.
2020-05-20 15:24:25 +02:00
Wim Taymans
42af40675d v4l2: mark data CORRUPTED
We need to mark the data corrupted in the chunk, not buffer flags.
2020-05-09 19:38:16 +02:00
Wim Taymans
8dcd6c4417 improve debug 2020-05-09 19:21:55 +02:00
Wim Taymans
1ca7713057 implement NEAREST flag
when the NEAREST flag is set and the param could not be completely
set, set_param should return 1 to indicate this.
2020-05-08 17:52:30 +02:00
Wim Taymans
12b8e095c7 v4l2: log error when format doesn't match 2020-05-08 17:35:57 +02:00
Wim Taymans
aafd1e7298 improve debug
Improve log so that debug level 3 gives a reasonably readable overview
of what is going on.
2020-04-22 12:47:18 +02:00
Wim Taymans
a1846c9780 udev: don't loop forever on errors
When we can't find the v4l2 device id, unref the device and continue
instead of looping forever and consuming all memory.

Fixes #219
2020-03-24 15:54:58 +01:00
Wim Taymans
a9b191971c v4l2: fix buffer recycle
Only set the OUTSTANDING flag when we placed the buffer in an
io area and need to recycle it later.
When we captured a frame, put it in the queue. Then dequeue it
into the io area after recycling buffers.

Fixes #217
2020-03-19 13:15:49 +01:00
Wim Taymans
6085c0eaee v4l2: use the buffer time as pts
Don't try to use the seq number as pts, just use the timestamp
returned from v4l2 if any so it can be matched against the clock.
2020-02-11 11:21:34 +01:00
Wim Taymans
65caf8832c spa: install in versioned directory
So that we can run old and new plugins side by side.
2020-01-29 15:51:41 +01:00
Wim Taymans
9ffa9c0b08 v4l2: handle suspend 2020-01-08 13:23:35 +01:00
Michael Tretter
8e6a5a1714 v4l2: print pixelformat as string
The pixelformats are actual 4 letter sequences. Print the letters
instead of the hex value to make the output more readable.
2019-12-19 15:43:13 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
feb8dd3a34 Add include of keys.h 2019-11-21 09:34:08 +01:00
Wim Taymans
18974f90f6 pod: rename context to flags in spa_pod_prop
Flags are more useful when we can use them to describe how to
filter properties later.
2019-11-21 09:32:08 +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
d94019ccd2 io: Add current video frame size to position
Add some padding, tweak some padding
Remove count in the clock, it's useless
For video frames we will want to use metadata to place
this on individual buffers.
2019-10-29 14:08:40 +01:00
Wim Taymans
9ffec214b8 fix includes 2019-10-25 15:01:02 +02:00
Wim Taymans
9d842fb5eb improve debug and error reporting 2019-10-08 22:33:31 +02:00
Wim Taymans
6e0ffb0c47 flags: change flag macros
SPA_FLAG_CHECK -> SPA_FLAG_IS_SET
SPA_FLAG_UNSET -> SPA_FLAG_CLEAR
Add SPA_FLAG_UPDATE
2019-10-02 18:00:42 +02:00
Wim Taymans
f59a43a4f0 v4l2: improve is_capture check 2019-10-01 10:13:42 +02:00
Wim Taymans
82ee139f65 spa: improve object properties 2019-10-01 10:04:22 +02:00
Wim Taymans
77e07e1948 improve properties on globals and ports 2019-09-20 13:28:06 +02:00
Wim Taymans
6756a3c8fc monitor: remove monitor API and use device
Remove the monitor API, we can use the device API for it. Make sure
we support creating devices (like alsa) from another device (udev).

Use new object.id to store the object id in the object properties. Use
the port.id/node.id etc to make relations to other objects.
2019-09-20 13:04:14 +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
Wim Taymans
8b85cc225e rename HAVE/NEED_BUFFER -> HAVE/NEED_DATA
It is more generic and works with control-only ports as well
2019-09-16 12:55:23 +02:00
Wim Taymans
b356c83d32 node: add support for transport
Move some things around. Move the duration of the current cycle
to the clock. Also add the estimated next timeout to the clock.
Add a generic media specific counter to the clock.

Clean up the position_bar info. We can do with only a double beat
value and make the signature in floats.

Flesh out the io_position info. This has now the information needed
to convert a raw clock time into a stream time. It basically has
the same kind of features as GStreamer segments such as looping,
variable rate playback etc.. It also contains the state of the
timeline (paused/playing) and it can be used to update the position
and state from clients.

There is also extended information in the position field that
clients can update when they can.

Plugins basically only update the clock info they get (and use
the position info to check if they are slaved or not).

Before each cycle, check if there is a pending position update and
apply it.
2019-08-27 14:41:47 +02:00
Wim Taymans
774e11bc10 keys: rename device.id to device.bus-id 2019-08-16 21:52:32 +02:00
Wim Taymans
78765e8d82 v4l2: set port ref to implementation 2019-08-15 18:40:22 +02:00
Wim Taymans
0af87d2685 client-node: keep port buffers in special location
Keep the output port buffers in a special mix info. They should
stay there even when the mix is removed and should only be cleared
explicitly with a NULL Format or 0 use_buffers.
2019-08-15 11:49:32 +02:00
Wim Taymans
c6a7b3eedb channelmix: implement per channel volume
Implement per channel volume on channelmix. Extend control on stream to
take an array of values when possible.

Remove name argument from pw_node_new and pw_device_new. We can pass
this as a property instead.

Improve properties on nodes to more closely match what pulseaudio does.
Don't let the monitor do too much with the udev properties but let the
session manager set the description and icon-names.

Remove some change_mask flags for things that don't change in
introspect. Use the flags to mark changes in -cli and -monitor.
2019-08-12 15:14:39 +02:00
Wim Taymans
e76a7abceb Add support for client fd memory
Remove the node buffers reply again. We don't need it. Instead add a
new method to the client-node to upload an array of buffer datas.
This method is called after the client has allocated buffer mem. It
will update the buffers on the server side with the client allocated
memory.

Wait for the async reply of use_buffers when doing alloc_buffers so
that we can get the updated buffer mem before we continue.

Let the link follow the states of the ports.

Add some error code to the port error states.

Add PW_STREAM_FLAG_ALLOC_BUFFERS flag to make the client alloc buffer
memory.
2019-07-26 16:17:39 +02:00
Wim Taymans
deb6c52f76 node: remove port_alloc_buffers
Remove the now obsolete port_alloc_buffer, rework to use the
port_use_buffers with the ALLOC flag.
2019-07-25 14:08:43 +02:00
Wim Taymans
8590ac158b node: add flags to port_use_buffer
Remove the CAN_USE_BUFFERS flag, it is redundant. We can know this
because of the IO params and buffer params.

Add flags to the port_use_buffer call. We also want this call to
replace port_alloc_buffer. Together with a new result event we can
ask the node to (a)synchronously fill up the buffer data for us. This
is part of a plan to let remote nodes provide buffer data.
2019-07-25 13:19:39 +02:00