meson.build 1.2 KB
Newer Older
1 2 3
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'))
4 5 6

enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()
conf.set('ENABLE_FFMPEG', enable_ffmpeg)
7 8 9 10 11 12 13 14

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

15 16 17 18 19
if not enable_ffmpeg
  ffmpeg_dep = dependency('', required: false)
  subdir_done()
endif

20 21 22 23 24
ffmpeg_sources = []
if libavfilter_dep.found()
  ffmpeg_sources += 'Filter.cxx'
endif

25 26 27 28 29 30 31
ffmpeg = static_library(
  'ffmpeg',
  'Init.cxx',
  'LogError.cxx',
  'LogCallback.cxx',
  'Error.cxx',
  'Domain.cxx',
32
  ffmpeg_sources,
33 34 35 36
  include_directories: inc,
  dependencies: [
    libavformat_dep,
    libavcodec_dep,
37
    libavfilter_dep,
38 39 40 41 42 43
    libavutil_dep,
  ],
)

ffmpeg_dep = declare_dependency(
  link_with: ffmpeg,
44 45 46
  dependencies: [
    libavformat_dep,
    libavcodec_dep,
47
    libavfilter_dep,
48 49
    libavutil_dep,
  ],
50
)