summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg/meson.build
blob: 0a0217ccf9c5904f0431cc25eeb15fb7749c0403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
libavformat_dep = dependency('libavformat', version: '>= 57.40', required: get_option('ffmpeg'))
libavcodec_dep = dependency('libavcodec', version: '>= 57.48', required: get_option('ffmpeg'))
libavutil_dep = dependency('libavutil', version: '>= 55.27', required: get_option('ffmpeg'))
conf.set('HAVE_LIBAVUTIL', libavutil_dep.found())

enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()
conf.set('ENABLE_FFMPEG', enable_ffmpeg)

if enable_ffmpeg
  libavfilter_dep = dependency('libavfilter', required: false)
else
  libavfilter_dep = dependency('', required: false)
endif
conf.set('HAVE_LIBAVFILTER', libavfilter_dep.found())

if not enable_ffmpeg
  ffmpeg_dep = dependency('', required: false)
  subdir_done()
endif

ffmpeg_sources = []
if libavfilter_dep.found()
  ffmpeg_sources += 'Filter.cxx'
endif

ffmpeg = static_library(
  'ffmpeg',
  'Init.cxx',
  'LogError.cxx',
  'LogCallback.cxx',
  'Error.cxx',
  'Domain.cxx',
  ffmpeg_sources,
  include_directories: inc,
  dependencies: [
    libavformat_dep,
    libavcodec_dep,
    libavfilter_dep,
    libavutil_dep,
  ],
)

ffmpeg_dep = declare_dependency(
  link_with: ffmpeg,
  dependencies: [
    libavformat_dep,
    libavcodec_dep,
    libavfilter_dep,
    libavutil_dep,
  ],
)