gstreamer/subprojects/gst-plugins-bad/sys/uvcgadget/meson.build
Michael Grzeschik 5d82deb2c5 uvcsink: add new bin element around v4l2sink
This patch adds an element to stream video data to an uvc video gadget.
The element handles the uvc events STREAMON, STREAMOFF, SETUP and DATA.
to start, stop and configure the video buffer flow by the use of pad
probes. It works with linux kernels of versions higher than v6.1.

The element makes use of the v4l2sink proxy property v4l2sink::device
to locate the corresponding device to parse the configfs for additional
data.

The code in uvc.c is basically derived from /lib/uvc.c in
https://git.ideasonboard.org/uvc-gadget.git.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00

40 lines
1.4 KiB
Meson

uvcgadget_sources = [
'gstuvcsink.c',
'configfs.c',
'uvc.c'
]
libgudev_dep = dependency('gudev-1.0', required: get_option('uvcgadget'))
if get_option('uvcgadget').disabled()
have_v4l2 = false
message('UVCSink plugin is disabled')
else
# Should only be built on Linux, check for Linux kernel headers even though
# we have our own copy.
have_v4l2 = cc.has_header('linux/videodev2.h') or cc.has_header('sys/videodev2.h') or cc.has_header('sys/videoio.h')
if get_option('uvcgadget').enabled() and not have_v4l2
error('UVCGADGET is requested but kernel headers were not found')
endif
# Find makedev in various header files. Different operating systems put the
# macro in different header files.
foreach name: ['mkdev', 'sysmacros', 'types']
have_makedev = cc.has_header_symbol('sys/@0@.h'.format(name), 'makedev')
cdata.set10('HAVE_MAKEDEV_IN_' + name.to_upper(), have_makedev)
endforeach
endif
if have_v4l2 and libgudev_dep.found()
gstuvcgadget = library('gstuvcgadget',
uvcgadget_sources,
c_args : gst_plugins_bad_args,
cpp_args: gst_plugins_bad_args,
include_directories : [configinc, include_directories('../v4l2codecs')],
dependencies : [gstbase_dep, gstvideo_dep, gstallocators_dep, libgudev_dep, gstpbutils_dep,],
install : true,
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstuvcgadget, install_dir : plugins_pkgconfig_install_dir)
plugins += [gstuvcgadget]
endif