• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1v4l2_sources = [
2  'gstv4l2.c',
3  'gstv4l2element.c',
4  'gstv4l2allocator.c',
5  'gstv4l2codec.c',
6  'gstv4l2colorbalance.c',
7  'gstv4l2deviceprovider.c',
8  'gstv4l2object.c',
9  'gstv4l2bufferpool.c',
10  'gstv4l2sink.c',
11  'gstv4l2src.c',
12  'gstv4l2radio.c',
13  'gstv4l2tuner.c',
14  'gstv4l2transform.c',
15  'gstv4l2videodec.c',
16  'gstv4l2videoenc.c',
17  'gstv4l2fwhtenc.c',
18  'gstv4l2h263enc.c',
19  'gstv4l2h264codec.c',
20  'gstv4l2h264enc.c',
21  'gstv4l2h265codec.c',
22  'gstv4l2h265enc.c',
23  'gstv4l2jpegenc.c',
24  'gstv4l2mpeg2codec.c',
25  'gstv4l2mpeg4codec.c',
26  'gstv4l2mpeg4enc.c',
27  'gstv4l2vidorient.c',
28  'gstv4l2vp8codec.c',
29  'gstv4l2vp8enc.c',
30  'gstv4l2vp9codec.c',
31  'gstv4l2vp9enc.c',
32  'v4l2_calls.c',
33  'v4l2-utils.c',
34  'tuner.c',
35  'tunerchannel.c',
36  'tunernorm.c'
37]
38
39v4l2 = get_option('v4l2')
40if v4l2.disabled()
41  have_v4l2 = false
42  message('V4L2 plugin is disabled')
43else
44  have_v4l2 = cc.has_header('linux/videodev2.h') or cc.has_header('sys/videodev2.h') or cc.has_header('sys/videoio.h')
45  if v4l2.enabled() and not have_v4l2
46    error('V4L2 is requested but headers were not found')
47  endif
48endif
49
50cdata.set('GST_V4L2_ENABLE_PROBE', get_option('v4l2-probe'))
51
52if have_v4l2
53  message('building v4l2 plugin')
54  cdata.set('HAVE_GST_V4L2', true)
55  gudev_dep = dependency('gudev-1.0', version : '>=147', required : get_option('v4l2-gudev'))
56  cdata.set('HAVE_GUDEV', gudev_dep.found())
57
58  # libv4l2 is only needed for converting some obscure formats
59  # FIXME: Add a full list of the formats here
60  libv4l2_dep = dependency('libv4l2', required : get_option('v4l2-libv4l2'))
61  cdata.set('HAVE_LIBV4L2', libv4l2_dep.found())
62
63  gstv4l2 = library('gstvideo4linux2',
64    v4l2_sources,
65    c_args : gst_plugins_good_args,
66    include_directories : [configinc, libsinc],
67    dependencies : [gstbase_dep, gstvideo_dep, gstallocators_dep, gudev_dep, libv4l2_dep],
68    install : true,
69    install_dir : plugins_install_dir,
70  )
71  pkgconfig.generate(gstv4l2, install_dir : plugins_pkgconfig_install_dir)
72  plugins += [gstv4l2]
73endif
74