[vlc-commits] [Git][videolan/vlc][master] 10 commits: modules: meson: fix indentation

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Mar 29 13:33:21 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
761ccb7d by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
modules: meson: fix indentation

- - - - -
f7025773 by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
modules: meson: add enabled flag for dependencies

The 'enabled' field will be used to define a condition for enabling the
plugin. Having this as as separate field will allow to define every
modules unconditionnally, regardless of whether they will be compiled or
not, and will allow to express runtime dependencies for executables.

- - - - -
c69d877e by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
modules: meson: move video_chroma subdir up

The video_chroma meson definition file defines chroma_copy_lib, which is
used by codecs like omxil. It must be sourced before then.

- - - - -
146a4f4c by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
test: meson: disable test with disabled module dependencies

Some tests will require some modules to be present to run correctly, but
it cannot be probed at compile time. However, as soon as every modules
will be declared unconditionnally, we'll be able to depend on a disabled
module and disable the matching tests.

Ideally, we'd skip it so that the test is still reported, but there's no
code to do that yet.

- - - - -
555e527b by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
module: meson: always fetch frameworks

Since the dependencies are declared conditionnally, it was not possible
to unconditionnally create plugins that would depend on them. By always
declaring them, they are now defined as a disabler() when the condition
are not met, without even the need to probe them.

In addition, the setup factors together the conditions that are needed
to probe or not the dependencies, and put everything in a single
location that can be shared between the different Apple platforms. It
also makes it clearer what kind of dependency is linked, though meson
was already abstracting all of the framework handling, and what is the
real name that should be found in the documentation.

- - - - -
850442bc by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
meson: use frameworks[] for referencing

Now that frameworks are probed into the frameworks dictionary, use them
everywhere a framework was set as dependency. See previous commit for
rationale.

- - - - -
47c63ce0 by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
module: meson: always fetch windows dependencies

- - - - -
8e33c54e by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
access: meson: use 'enabled' property for plugins

- - - - -
253a8563 by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
codec: meson: use 'enabled' field for modules

- - - - -
dc83b3ed by Alexandre Janniaux at 2024-03-29T13:06:20+00:00
video_chroma: meson: use 'enabled' property for plugins

- - - - -


8 changed files:

- modules/access/meson.build
- modules/audio_output/meson.build
- modules/codec/meson.build
- modules/meson.build
- modules/video_chroma/meson.build
- modules/video_filter/meson.build
- modules/video_output/apple/meson.build
- test/meson.build


Changes:

=====================================
modules/access/meson.build
=====================================
@@ -70,45 +70,44 @@ if get_option('oss').disable_auto_if(
 endif
 
 # JACK input module
-if jack_dep.found()
-    vlc_modules += {
-        'name' : 'access_jack',
-        'sources' : files('jack.c'),
-        'dependencies' : [jack_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'access_jack',
+    'sources' : files('jack.c'),
+    'dependencies' : [jack_dep],
+    'enabled' : jack_dep.found(),
+}
 
 # Pulseaudio module
-if pulse_dep.found()
-    vlc_modules += {
-        'name' : 'pulsesrc',
-        'sources' : files('pulse.c'),
-        'dependencies' : [pulse_dep],
-        'link_with' : [libvlc_pulse],
-    }
-endif
+vlc_modules += {
+    'name' : 'pulsesrc',
+    'sources' : files('pulse.c'),
+    'dependencies' : [pulse_dep],
+    'link_with' : [libvlc_pulse],
+    'enabled' : pulse_dep.found(),
+}
 
 # AVFoundation audio capture access
-if have_osx
-    vlc_modules += {
-        'name' : 'avaudiocapture',
-        'sources' : files('avaudiocapture.m'),
-        'objc_args' : ['-fobjc-arc'],
-        'dependencies' : [avfoundation_dep, coremedia_dep, foundation_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'avaudiocapture',
+    'sources' : files('avaudiocapture.m'),
+    'objc_args' : ['-fobjc-arc'],
+    'dependencies' : [
+        frameworks['Foundation'],
+        frameworks['AVFoundation'],
+        frameworks['CoreMedia'],
+    ],
+    'enabled' : have_osx,
+}
 
 # WASAPI access
-if (get_option('wasapi')
-    .require(host_system == 'windows', error_message: 'WASAPI requires Windows')
-    .allowed() and ksuser_lib.found())
-    vlc_modules += {
-        'name' : 'access_wasapi',
-        'sources' : files('wasapi.c'),
-        'dependencies' : [ksuser_lib]
-    }
-endif
-
+vlc_modules += {
+    'name' : 'access_wasapi',
+    'sources' : files('wasapi.c'),
+    'dependencies' : [ksuser_lib],
+    'enabled' : get_option('wasapi')
+      .require(host_system == 'windows', error_message: 'WASAPI requires Windows')
+      .allowed() and ksuser_lib.found()
+}
 
 ## Video capture
 
@@ -120,7 +119,12 @@ if (get_option('macosx_avfoundation')
         'name' : 'avcapture',
         'sources' : files('avcapture.m'),
         'objc_args' : ['-fobjc-arc'],
-        'dependencies' : [avfoundation_dep, coremedia_dep, foundation_dep, corevideo_dep],
+        'dependencies' : [
+            frameworks['Foundation'],
+            frameworks['AVFoundation'],
+            frameworks['CoreMedia'],
+            frameworks['CoreVideo'],
+        ],
     }
 endif
 


=====================================
modules/audio_output/meson.build
=====================================
@@ -52,11 +52,11 @@ if have_osx
         'name' : 'auhal',
         'sources' : files('auhal.c', 'coreaudio_common.c'),
         'dependencies' : [
-            corefoundation_dep,
-            audiounit_dep,
-            audiotoolbox_dep,
-            coreaudio_dep,
-        ]
+            frameworks['CoreFoundation'],
+            frameworks['AudioUnit'],
+            frameworks['AudioToolbox'],
+            frameworks['CoreAudio'],
+        ],
     }
 endif
 
@@ -66,10 +66,10 @@ if have_ios or have_tvos
         'name' : 'audiounit_ios',
         'sources' : files('audiounit_ios.m', 'coreaudio_common.c'),
         'dependencies' : [
-            foundation_dep,
-            avfoundation_dep,
-            audiotoolbox_dep,
-            coreaudio_dep,
-        ]
+            frameworks['Foundation'],
+            frameworks['AVFoundation'],
+            frameworks['AudioToolbox'],
+            frameworks['CoreAudio'],
+        ],
     }
 endif


=====================================
modules/codec/meson.build
=====================================
@@ -24,23 +24,21 @@ vlc_modules += {
 
 # a52 codec
 a52_lib = cc.find_library('a52', required: get_option('a52'))
-if a52_lib.found()
-    vlc_modules += {
-        'name' : 'a52',
-        'sources' : files('a52.c'),
-        'dependencies' : [a52_lib]
-    }
-endif
+vlc_modules += {
+    'name' : 'a52',
+    'sources' : files('a52.c'),
+    'dependencies' : [a52_lib],
+    'enabled' : a52_lib.found(),
+}
 
 # DTS Coherent Acoustics decoder
 dca_dep = dependency('libdca', version: '>= 0.0.5', required: get_option('dca'))
-if dca_dep.found()
-    vlc_modules += {
-        'name' : 'dca',
-        'sources' : files('dca.c'),
-        'dependencies' : [dca_dep, m_lib]
-    }
-endif
+vlc_modules += {
+    'name' : 'dca',
+    'sources' : files('dca.c'),
+    'dependencies' : [dca_dep, m_lib],
+    'enabled' : dca_dep.found(),
+}
 
 # adpcm codec
 vlc_modules += {
@@ -62,13 +60,12 @@ vlc_modules += {
 
 # faad decoder plugin
 faad_lib = cc.find_library('faad', required: get_option('faad'))
-if faad_lib.found()
-    vlc_modules += {
-        'name' : 'faad',
-        'sources' : files('faad.c'),
-        'dependencies' : [faad_lib, m_lib]
-    }
-endif
+vlc_modules += {
+    'name' : 'faad',
+    'sources' : files('faad.c'),
+    'dependencies' : [faad_lib, m_lib],
+    'enabled' : faad_lib.found(),
+}
 
 # g711 codec
 vlc_modules += {
@@ -96,23 +93,25 @@ else
     fluidsynth_dep = dependency('', required: false)
 endif
 
-if fluidsynth_dep.found()
-    vlc_modules += {
-        'name' : 'fluidsynth',
-        'sources' : files('fluidsynth.c'),
-        'dependencies' : [fluidsynth_dep, m_lib],
-        'c_args' : fluidsynth_module_flags
-    }
-endif
+vlc_modules += {
+    'name' : 'fluidsynth',
+    'sources' : files('fluidsynth.c'),
+    'dependencies' : [fluidsynth_dep, m_lib],
+    'c_args' : fluidsynth_module_flags,
+    'enabled' : fluidsynth_dep.found(),
+}
 
 # Audiotoolbox MIDI plugin (Darwin only)
-if have_osx
-    vlc_modules += {
-        'name' : 'audiotoolboxmidi',
-        'sources' : files('audiotoolbox_midi.c'),
-        'dependencies' : [corefoundation_dep, audiounit_dep, audiotoolbox_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'audiotoolboxmidi',
+    'sources' : files('audiotoolbox_midi.c'),
+    'dependencies' : [
+        frameworks['CoreFoundation'],
+        frameworks['AudioUnit'],
+        frameworks['AudioToolbox'],
+    ],
+    'enabled' : have_osx,
+}
 
 # LPCM codec
 vlc_modules += {
@@ -122,23 +121,21 @@ vlc_modules += {
 
 # libmad codec
 mad_dep = dependency('mad', required: get_option('mad'))
-if mad_dep.found()
-  vlc_modules += {
-      'name' : 'mad',
-      'sources' : files('mad.c'),
-      'dependencies' : [mad_dep]
-  }
-endif
+vlc_modules += {
+    'name' : 'mad',
+    'sources' : files('mad.c'),
+    'dependencies' : [mad_dep],
+    'enabled' : mad_dep.found(),
+}
 
 # libmpg123 decoder
 mpg123_dep = dependency('libmpg123', required: get_option('mpg123'))
-if mpg123_dep.found()
-    vlc_modules += {
-        'name' : 'mpg123',
-        'sources' : files('mpg123.c'),
-        'dependencies' : [mpg123_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'mpg123',
+    'sources' : files('mpg123.c'),
+    'dependencies' : [mpg123_dep],
+    'enabled' : mpg123_dep.found(),
+}
 
 # Ulead DV Audio codec
 vlc_modules += {
@@ -157,13 +154,12 @@ vlc_modules += {
 
 # libmpeg2 decoder
 mpeg2_dep = dependency('libmpeg2', version: '> 0.3.2', required: get_option('mpeg2'))
-if mpeg2_dep.found()
-    vlc_modules += {
-        'name' : 'libmpeg2',
-        'sources' : files('libmpeg2.c', 'synchro.c'),
-        'dependencies' : [mpeg2_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'libmpeg2',
+    'sources' : files('libmpeg2.c', 'synchro.c'),
+    'dependencies' : [mpeg2_dep],
+    'enabled' : mpeg2_dep.found(),
+}
 
 # Raw video codec
 vlc_modules += {
@@ -181,13 +177,12 @@ vlc_modules += {
 schroedinger_dep = dependency('schroedinger-1.0',
                               version: '>= 1.0.10',
                               required: get_option('schroedinger'))
-if schroedinger_dep.found()
-    vlc_modules += {
-        'name' : 'schroedinger',
-        'sources' : files('schroedinger.c'),
-        'dependencies' : [schroedinger_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'schroedinger',
+    'sources' : files('schroedinger.c'),
+    'dependencies' : [schroedinger_dep],
+    'enabled' : schroedinger_dep.found(),
+}
 
 # RTP Raw video codec
 vlc_modules += {
@@ -199,57 +194,49 @@ vlc_modules += {
 
 # PNG codec
 png_dep = dependency('libpng', required: get_option('png'))
-if png_dep.found()
-  vlc_modules += {
-      'name' : 'png',
-      'sources' : files('png.c'),
-      'dependencies' : [png_dep, m_lib]
-  }
-endif
+vlc_modules += {
+    'name' : 'png',
+    'sources' : files('png.c'),
+    'dependencies' : [png_dep, m_lib],
+    'enabled' : png_dep.found(),
+}
 
 # JPEG codec
 jpeg_dep = dependency('libjpeg', required: get_option('jpeg'))
-if jpeg_dep.found()
-  vlc_modules += {
-      'name' : 'jpeg',
-      'sources' : files('jpeg.c'),
-      'dependencies' : [jpeg_dep]
-  }
-endif
+vlc_modules += {
+    'name' : 'jpeg',
+    'sources' : files('jpeg.c'),
+    'dependencies' : [jpeg_dep],
+    'enabled' : jpeg_dep.found(),
+}
 
 # BPG codec
 bpg_lib = cc.find_library('bpg', required: get_option('bpg'))
-if bpg_lib.found()
-  vlc_modules += {
-      'name' : 'bpg',
-      'sources' : files('bpg.c'),
-      'dependencies' : [bpg_lib]
-  }
-endif
+vlc_modules += {
+    'name' : 'bpg',
+    'sources' : files('bpg.c'),
+    'dependencies' : [bpg_lib],
+    'enabled' : bpg_lib.found(),
+}
 
 # SVG image decoder
 cairo_dep = dependency('cairo', version: '>= 1.13.1', required: get_option('cairo'))
-if rsvg_dep.found() and cairo_dep.found()
-    vlc_modules += {
-        'name' : 'svgdec',
-        'sources' : files('svg.c'),
-        'dependencies' : [rsvg_dep, cairo_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'svgdec',
+    'sources' : files('svg.c'),
+    'dependencies' : [rsvg_dep, cairo_dep],
+    'enabled' : rsvg_dep.found() and cairo_dep.found(),
+}
 
 # xwd
-if (get_option('xcb')
-    .disable_auto_if(host_system in ['darwin', 'windows'])
-    .allowed())
-  xproto_dep = dependency('xproto', required: get_option('xcb'))
-  if xproto_dep.found()
-    vlc_modules += {
-        'name' : 'xwd',
-        'sources' : files('xwd.c'),
-        'dependencies' : [xproto_dep]
-    }
-  endif
-endif
+xproto_dep = dependency('xproto', required: get_option('xcb')
+    .disable_auto_if(host_system in ['darwin', 'windows']))
+vlc_modules += {
+    'name' : 'xwd',
+    'sources' : files('xwd.c'),
+    'dependencies' : [xproto_dep],
+    'enabled' : xproto_dep.found(),
+}
 
 
 ## SPU codecs
@@ -262,20 +249,24 @@ libass_dep = dependency('libass',
 libass_deps = [libass_dep]
 
 if host_system == 'darwin'
-    libass_deps += [corefoundation_dep, coregraphics_dep, coretext_dep]
+    libass_deps += [
+        frameworks['CoreFoundation'],
+        frameworks['CoreGraphics'],
+        frameworks['CoreText'],
+    ]
 endif
 
 if libass_dep.found()
     if freetype_dep.found()
         libass_deps += freetype_dep
     endif
-
-    vlc_modules += {
-        'name' : 'libass',
-        'sources' : files('libass.c'),
-        'dependencies' : libass_deps
-    }
 endif
+vlc_modules += {
+    'name' : 'libass',
+    'sources' : files('libass.c'),
+    'dependencies' : libass_deps,
+    'enabled' : libass_dep.found(),
+}
 
 # Closed captioning decoder
 vlc_modules += {
@@ -297,14 +288,13 @@ vlc_modules += {
 
 # aribsub
 aribb24_dep = dependency('aribb24', version: '>= 1.0.1', required: get_option('aribsub'))
-if aribb24_dep.found()
-  vlc_modules += {
-      'name' : 'aribsub',
-      'sources' : files('arib/aribsub.c'),
-      'dependencies' : [aribb24_dep],
-      'cpp_args' : ['-DHAVE_ARIBB24']
-  }
-endif
+vlc_modules += {
+    'name' : 'aribsub',
+    'sources' : files('arib/aribsub.c'),
+    'dependencies' : [aribb24_dep],
+    'cpp_args' : ['-DHAVE_ARIBB24'],
+    'enabled' : aribb24_dep.found()
+}
 
 # scte18 decoder
 vlc_modules += {
@@ -369,22 +359,19 @@ vlc_modules += {
 
 # zvbi
 use_zvbi = zvbi_dep.found() and get_option('zvbi').enabled()
-
-if use_zvbi
-  vlc_modules += {
-      'name' : 'zvbi',
-      'sources' : files('zvbi.c'),
-      'dependencies' : [zvbi_dep, socket_libs]
-  }
-endif
+vlc_modules += {
+    'name' : 'zvbi',
+    'sources' : files('zvbi.c'),
+    'dependencies' : [zvbi_dep, socket_libs],
+    'enabled' : use_zvbi,
+}
 
 # telx
-if not use_zvbi and get_option('telx').enabled()
-  vlc_modules += {
-      'name' : 'telx',
-      'sources' : files('telx.c')
-  }
-endif
+vlc_modules += {
+    'name' : 'telx',
+    'sources' : files('telx.c'),
+    'enabled' : not use_zvbi and get_option('telx').enabled(),
+}
 
 # textst
 vlc_modules += {
@@ -459,97 +446,88 @@ endif
 vlc_modules += {
     'name' : 'webvtt',
     'sources' : webvtt_sources,
-    'include_directories' : include_directories('webvtt')
+    'include_directories' : include_directories('webvtt'),
 }
 
-
 ## Xiph.org codecs
 
 ogg_dep = dependency('ogg', required: get_option('ogg'))
 
 # FLAC codec
 flac_dep = dependency('flac', required: get_option('flac'))
-if flac_dep.found()
-    vlc_modules += {
-        'name' : 'flac',
-        'sources' : files('flac.c'),
-        'dependencies' : [flac_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'flac',
+    'sources' : files('flac.c'),
+    'dependencies' : [flac_dep],
+    'enabled' : flac_dep.found(),
+}
 
 # Kate codec
 kate_dep = dependency('kate', version: '>= 0.3.0', required: get_option('kate'))
+kate_deps = [kate_dep, m_lib]
+kate_cpp_args = []
 if kate_dep.found()
-  kate_deps = [kate_dep, m_lib]
-  kate_cpp_args = []
-
   tiger_dep = dependency('tiger', version: '>= 0.3.1', required: get_option('tiger'))
 
   if tiger_dep.found()
     kate_cpp_args += ['-DHAVE_TIGER=1']
     kate_deps += tiger_dep
   endif
-
-  vlc_modules += {
-      'name' : 'kate',
-      'sources' : files('kate.c'),
-      'dependencies' : kate_deps,
-      'cpp_args' : kate_cpp_args
-  }
 endif
+vlc_modules += {
+    'name' : 'kate',
+    'sources' : files('kate.c'),
+    'dependencies' : kate_deps,
+    'cpp_args' : kate_cpp_args,
+    'enabled' : kate_dep.found(),
+}
 
 # Opus codec
 opus_dep = dependency('opus', version: '>= 1.0.3', required: get_option('opus'))
-if opus_dep.found() and ogg_dep.found()
-    vlc_modules += {
-        'name' : 'opus',
-        'sources' : files('opus.c', 'opus_header.c'),
-        'dependencies' : [opus_dep, ogg_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'opus',
+    'sources' : files('opus.c', 'opus_header.c'),
+    'dependencies' : [opus_dep, ogg_dep],
+    'enabled' : opus_dep.found() and ogg_dep.found(),
+}
 
 # Theora codec
 theoraenc_dep = dependency('theoraenc', required: get_option('theoraenc'))
 theoradec_dep = dependency('theoradec', version: '>= 1.0', required: get_option('theoradec'))
-if theoraenc_dep.found() and theoradec_dep.found() and ogg_dep.found()
-    vlc_modules += {
-        'name' : 'theora',
-        'sources' : files('theora.c'),
-        'dependencies' : [theoraenc_dep, theoradec_dep, ogg_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'theora',
+    'sources' : files('theora.c'),
+    'dependencies' : [theoraenc_dep, theoradec_dep, ogg_dep],
+    'enabled' : theoraenc_dep.found() and theoradec_dep.found() and ogg_dep.found(),
+}
 
 # Daala codec plugin
 daaladec_dep = dependency('daaladec', required: get_option('daaladec'))
 daalaenc_dep = dependency('daalaenc', required: get_option('daalaenc'))
-if daaladec_dep.found() and daalaenc_dep.found()
-    vlc_modules += {
-        'name' : 'daala',
-        'sources' : files('daala.c'),
-        'dependencies' : [daaladec_dep, daalaenc_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'daala',
+    'sources' : files('daala.c'),
+    'dependencies' : [daaladec_dep, daalaenc_dep],
+    'enabled' : daaladec_dep.found() and daalaenc_dep.found(),
+}
 
 # Vorbis codec
 vorbis_dep    = dependency('vorbis', version: '>= 1.1', required: get_option('vorbis'))
 vorbisenc_dep = dependency('vorbisenc', version: '>= 1.1', required: get_option('vorbis'))
-
-if vorbis_dep.found() and vorbisenc_dep.found() and ogg_dep.found()
-    vlc_modules += {
-        'name' : 'vorbis',
-        'sources' : files('vorbis.c'),
-        'dependencies' : [vorbis_dep, vorbisenc_dep, ogg_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'vorbis',
+    'sources' : files('vorbis.c'),
+    'dependencies' : [vorbis_dep, vorbisenc_dep, ogg_dep],
+    'enabled' : vorbis_dep.found() and vorbisenc_dep.found() and ogg_dep.found()
+}
 
 # OggSpots decoder
-if ogg_dep.found()
-    vlc_modules += {
-        'name' : 'oggspots',
-        'sources' : files('oggspots.c'),
-        'dependencies' : [ogg_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'oggspots',
+    'sources' : files('oggspots.c'),
+    'dependencies' : [ogg_dep],
+    'enabled' : ogg_dep.found(),
+}
 
 # VideoToolbox (Apples hardware-accelerated video decoder/encoder)
 # TODO: Set proper flags for minimum iOS/tvOS versions
@@ -575,8 +553,12 @@ if host_system == 'darwin'
             '../packetizer/h264_nal.c',
             '../packetizer/hevc_nal.c'
         ),
-        'dependencies' : [videotoolbox_dep, foundation_dep, coremedia_dep,
-                          corevideo_dep],
+        'dependencies' : [
+            frameworks['VideoToolbox'],
+            frameworks['Foundation'],
+            frameworks['CoreMedia'],
+            frameworks['CoreVideo'],
+        ],
         'link_with' : [libvlc_vtutils],
     }
 
@@ -591,8 +573,12 @@ if host_system == 'darwin'
             '../packetizer/h264_nal.c',
             '../packetizer/hevc_nal.c'
         ),
-        'dependencies' : [videotoolbox_dep, foundation_dep, coremedia_dep,
-                          corevideo_dep],
+        'dependencies' : [
+            frameworks['VideoToolbox'],
+            frameworks['Foundation'],
+            frameworks['CoreMedia'],
+            frameworks['CoreVideo'],
+        ],
         'link_with' : [libvlc_vtutils],
     }
 
@@ -612,53 +598,51 @@ if avcodec_dep.found()
 endif
 
 # FFmpeg codec module
-if avcodec_dep.found()
-    avcodec_extra_sources = []
-    if get_option('stream_outputs')
-        avcodec_extra_sources += 'avcodec/encoder.c'
-    endif
+avcodec_extra_sources = []
+if get_option('stream_outputs')
+    avcodec_extra_sources += 'avcodec/encoder.c'
+endif
 
-    # TODO: Implement the merge-ffmpeg option
+# TODO: Implement the merge-ffmpeg option
 
-    vlc_modules += {
-        'name' : 'avcodec',
-        'sources' : files(
-                'avcodec/video.c',
-                'avcodec/subtitle.c',
-                'avcodec/audio.c',
-                'avcodec/va.c',
-                'avcodec/avcodec.c',
-                '../packetizer/av1_obu.c',
-                '../packetizer/av1_obu.h',
-                '../packetizer/av1.h',
-                avcodec_extra_sources
-        ),
-        'dependencies' : [avutil_dep, avcodec_dep],
-        'link_with' : [libavcodec_common],
-        'link_args' : symbolic_linkargs
-    }
-endif
+vlc_modules += {
+    'name' : 'avcodec',
+    'sources' : files(
+            'avcodec/video.c',
+            'avcodec/subtitle.c',
+            'avcodec/audio.c',
+            'avcodec/va.c',
+            'avcodec/avcodec.c',
+            '../packetizer/av1_obu.c',
+            '../packetizer/av1_obu.h',
+            '../packetizer/av1.h',
+            avcodec_extra_sources
+    ),
+    'dependencies' : [avutil_dep, avcodec_dep],
+    'link_with' : [libavcodec_common],
+    'link_args' : symbolic_linkargs,
+    'enabled' : avcodec_dep.found(),
+}
 
 if get_option('libva').enabled() and get_option('avcodec').disabled()
     error('-Dlibva=enabled and -Davcodec=disabled options are mutually exclusive. Use -Davcodec=disabled')
 endif
 
 libva_dep = dependency('libva', version: '>= 1.0', required: get_option('libva'))
-if get_option('libva').require(
-    avcodec_dep.found() and avutil_dep.found(),
-    error_message: 'VAAPI requires avcodec').allowed() and libva_dep.found()
-
-    vlc_modules += {
-        'name' : 'vaapi',
-        'sources' : files(
-                'avcodec/vaapi.c',
-                '../hw/vaapi/vlc_vaapi.c',
-                'avcodec/va_surface.c',
-            ),
-        'dependencies' : [avcodec_dep, libva_dep, avutil_dep]
-    }
+vlc_modules += {
+    'name' : 'vaapi',
+    'sources' : files(
+            'avcodec/vaapi.c',
+            '../hw/vaapi/vlc_vaapi.c',
+            'avcodec/va_surface.c',
+        ),
+    'dependencies' : [avcodec_dep, libva_dep, avutil_dep],
+    'enabled' : get_option('libva').require(
+        avcodec_dep.found() and avutil_dep.found(),
+        error_message: 'VAAPI requires avcodec').allowed() and
+        libva_dep.found()
+}
 
-endif
 
 if host_system == 'windows'
     d3d11_common_lib = static_library('d3d11_common',
@@ -709,118 +693,112 @@ if host_system == 'windows'
 endif
 
 # OpenMAX IL codec
-if get_option('omxil')
-    vlc_modules += {
-        'name' : 'omxil',
-        'sources' : files(
-                'omxil/utils.c',
-                'omxil/qcom.c',
-                'omxil/omxil.c',
-                'omxil/omxil_core.c',
-                '../packetizer/h264_nal.c',
-                '../packetizer/hevc_nal.c',
-            ),
-        'link_with' : [chroma_copy_lib, dl_lib]
-    }
-endif
+vlc_modules += {
+    'name' : 'omxil',
+    'sources' : files(
+            'omxil/utils.c',
+            'omxil/qcom.c',
+            'omxil/omxil.c',
+            'omxil/omxil_core.c',
+            '../packetizer/h264_nal.c',
+            '../packetizer/hevc_nal.c',
+        ),
+    'dependencies' : [dl_lib],
+    'link_with' : [chroma_copy_lib],
+    'enabled' : get_option('omxil'),
+}
 
 ## x26X encoders
 
 # x265 encoder
 x265_dep = dependency('x265', required: get_option('x265'))
-if x265_dep.found()
-    vlc_modules += {
-        'name' : 'x265',
-        'sources' : files('x265.c'),
-        'dependencies' : [x265_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'x265',
+    'sources' : files('x265.c'),
+    'dependencies' : [x265_dep],
+    'enabled' : x265_dep.found(),
+}
 
 # x262 encoder
 x262_dep = dependency('x262', required: get_option('x262'))
-if x262_dep.found()
-    vlc_modules += {
-        'name' : 'x262',
-        'sources' : files('x264.c'),
-        'dependencies' : [x262_dep],
-        'c_args' : ['-DPLUGIN_X262'],
-        'link_args' : symbolic_linkargs
-    }
-endif
+vlc_modules += {
+    'name' : 'x262',
+    'sources' : files('x264.c'),
+    'dependencies' : [x262_dep],
+    'c_args' : ['-DPLUGIN_X262'],
+    'link_args' : symbolic_linkargs,
+    'enabled' : x262_dep.found(),
+}
 
 # x264 10-bit encoder (requires x264 >= 0.153)
 x26410b_dep = dependency('x264', version: '>= 0.153', required: get_option('x264'))
-if x26410b_dep.found()
-    vlc_modules += {
-        'name' : 'x26410b',
-        'sources' : files('x264.c'),
-        'dependencies' : [x26410b_dep],
-        'c_args' : ['-DPLUGIN_X264_10B'],
-        'link_args' : symbolic_linkargs
-    }
-endif
+vlc_modules += {
+    'name' : 'x26410b',
+    'sources' : files('x264.c'),
+    'dependencies' : [x26410b_dep],
+    'c_args' : ['-DPLUGIN_X264_10B'],
+    'link_args' : symbolic_linkargs,
+    'enabled' : x26410b_dep.found(),
+}
 
 # x264 encoder
 x264_dep = dependency('x264', version: '>= 0.148', required: get_option('x264'))
-if x264_dep.found()
-    vlc_modules += {
-        'name' : 'x264',
-        'sources' : files('x264.c'),
-        'dependencies' : [x264_dep],
-        'c_args' : ['-DPLUGIN_X264'],
-        'link_args' : symbolic_linkargs
-    }
-endif
+vlc_modules += {
+    'name' : 'x264',
+    'sources' : files('x264.c'),
+    'dependencies' : [x264_dep],
+    'c_args' : ['-DPLUGIN_X264'],
+    'link_args' : symbolic_linkargs,
+    'enabled' : x264_dep.found(),
+}
 
 
 ## Misc codecs
 
 # fdkaac encoder
 fdkaac_dep = dependency('fdk-aac', required: get_option('fdk-aac'))
-if fdkaac_dep.found()
-    vlc_modules += {
-        'name' : 'fdkaac',
-        'sources' : files('fdkaac.c'),
-        'dependencies' : [fdkaac_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'fdkaac',
+    'sources' : files('fdkaac.c'),
+    'dependencies' : [fdkaac_dep],
+    'enabled' : fdkaac_dep.found(),
+}
 
 # Shine MPEG Audio Layer 3 encoder
 shine_dep = dependency('shine', version: '>= 3.0.0', required: get_option('shine'))
-if shine_dep.found()
-    vlc_modules += {
-        'name' : 'shine',
-        'sources' : files('shine.c'),
-        'dependencies' : [shine_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'shine',
+    'sources' : files('shine.c'),
+    'dependencies' : [shine_dep],
+    'enabled' : shine_dep.found(),
+}
 
 # VP8/VP9 encoder/decoder (libvpx)
+vpx_c_args = []
 vpx_dep = dependency('vpx', version: '>= 1.5.0', required: get_option('vpx'))
 if vpx_dep.found()
-  vpx_c_args = []
-
-  if cc.has_function('vpx_codec_vp8_dx', dependencies: [vpx_dep])
-    vpx_c_args += '-DENABLE_VP8_DECODER'
-  endif
-  if cc.has_function('vpx_codec_vp9_dx', dependencies: [vpx_dep])
-    vpx_c_args += '-DENABLE_VP9_DECODER'
-  endif
-  if cc.has_function('vpx_codec_vp8_cx', dependencies: [vpx_dep])
-    vpx_c_args += '-DENABLE_VP8_ENCODER'
-  endif
-  if cc.has_function('vpx_codec_vp9_cx', dependencies: [vpx_dep])
-    vpx_c_args += '-DENABLE_VP9_ENCODER'
-  endif
-
-  vlc_modules += {
-      'name' : 'vpx',
-      'sources' : files('vpx.c'),
-      'c_args' : vpx_c_args,
-      'dependencies' : [vpx_dep]
-  }
+    if cc.has_function('vpx_codec_vp8_dx', dependencies: [vpx_dep])
+        vpx_c_args += '-DENABLE_VP8_DECODER'
+    endif
+    if cc.has_function('vpx_codec_vp9_dx', dependencies: [vpx_dep])
+        vpx_c_args += '-DENABLE_VP9_DECODER'
+    endif
+    if cc.has_function('vpx_codec_vp8_cx', dependencies: [vpx_dep])
+        vpx_c_args += '-DENABLE_VP8_ENCODER'
+    endif
+    if cc.has_function('vpx_codec_vp9_cx', dependencies: [vpx_dep])
+        vpx_c_args += '-DENABLE_VP9_ENCODER'
+    endif
 endif
 
+vlc_modules += {
+    'name' : 'vpx',
+    'sources' : files('vpx.c'),
+    'c_args' : vpx_c_args,
+    'dependencies' : [vpx_dep],
+    'enabled' : vpx_dep.found(),
+}
+
 # VP8/VP9 with alpha pseudo-decoder
 vpx_alpha_sources = files('vpx_alpha.c')
 vpx_alpha_with = [ ]
@@ -834,61 +812,55 @@ vlc_modules += {
     'link_with' : vpx_alpha_with
 }
 
-
 # libaom AV1 codec
 aom_dep = dependency('aom', required: get_option('aom'))
-if aom_dep.found()
-    vlc_modules += {
-        'name' : 'aom',
-        'sources' : files('aom.c'),
-        'dependencies' : [aom_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'aom',
+    'sources' : files('aom.c'),
+    'dependencies' : [aom_dep],
+    'enabled' : aom_dep.found(),
+}
 
 rav1e_dep = dependency('rav1e', required: get_option('rav1e'))
-if rav1e_dep.found()
-    vlc_modules += {
-        'name' : 'rav1e',
-        'sources' : files('rav1e.c'),
-        'dependencies' : [rav1e_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'rav1e',
+    'sources' : files('rav1e.c'),
+    'dependencies' : [rav1e_dep],
+    'enabled' : rav1e_dep.found(),
+}
 
 # Twolame MPEG Audio Layer 2 encoder
 twolame_dep = dependency('twolame', required: get_option('twolame'))
-if twolame_dep.found()
-    vlc_modules += {
-        'name' : 'twolame',
-        'sources' : files('twolame.c'),
-        'dependencies' : [twolame_dep],
-        'c_args' : ['-DLIBTWOLAME_STATIC']
-    }
-endif
+vlc_modules += {
+    'name' : 'twolame',
+    'sources' : files('twolame.c'),
+    'dependencies' : [twolame_dep],
+    'c_args' : ['-DLIBTWOLAME_STATIC'],
+    'enabled' : twolame_dep.found(),
+}
 
 # dav1d AV1 decoder
 dav1d_dep = dependency('dav1d', version: '>= 0.5.0', required: get_option('dav1d'))
-if dav1d_dep.found()
-    vlc_modules += {
-        'name' : 'dav1d',
-        'sources' : files(
-                'dav1d.c',
-                '../packetizer/av1_obu.c'
-            ),
-        'dependencies' : [dav1d_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'dav1d',
+    'sources' : files(
+            'dav1d.c',
+            '../packetizer/av1_obu.c'
+        ),
+    'dependencies' : [dav1d_dep],
+    'enabled' : dav1d_dep.found(),
+}
 
 
 ## Hardware encoders
 
 # QSV encoder
 qsv_dep = dependency('libmfx', required: get_option('mfx'))
-if qsv_dep.found()
-    vlc_modules += {
-        'name' : 'qsv',
-        'sources' : files('qsv.c'),
-        'dependencies' : [qsv_dep]
-    }
-endif
+vlc_modules += {
+    'name' : 'qsv',
+    'sources' : files('qsv.c'),
+    'dependencies' : [qsv_dep],
+    'enabled' : qsv_dep.found(),
+}
 
 ## External frameworks


=====================================
modules/meson.build
=====================================
@@ -76,44 +76,88 @@ if not jack_dep.found()
         required: false)
 endif
 
+frameworks = {}
+framework_conditions = [
+    {
+        'frameworks': [
+            'Foundation',
+            'CoreFoundation',
+            'Security',
+            'CoreMedia',
+            'AVFoundation',
+            'CoreVideo',
+            'VideoToolbox',
+            'AudioToolbox',
+            'IOKit',
+            'QuartzCore',
+            'QuartzText',
+            'CoreText',
+            'CoreAudio',
+            'CoreImage',
+            'CoreGraphics',
+            'AVKit',
+        ],
+        'condition': host_system == 'darwin'
+    },
+    {
+        'frameworks': [
+            'Cocoa',
+            'OpenGL',
+            'AudioUnit',
+        ],
+        'condition': have_osx
+    },
+    {
+        'frameworks': [
+            'UIKit',
+            'OpenGLES',
+        ],
+        'condition': have_ios or have_tvos
+    },
+]
+
+foreach framework_spec : framework_conditions
+    foreach framework_name : framework_spec['frameworks']
+        if framework_spec['condition']
+            # Not-found dependency
+            frameworks += { framework_name: disabler() }
+        else
+            frameworks += { framework_name: dependency(framework_name, required: framework_spec['condition']) }
+        endif
+    endforeach
+endforeach
+
 # Darwin-specific dependencies
-if host_system == 'darwin'
-    security_dep = dependency('Security', required: true)
-    coremedia_dep = dependency('CoreMedia', required: true)
-    avfoundation_dep = dependency('AVFoundation', required: true)
-    corevideo_dep = dependency('CoreVideo', required: true)
-    videotoolbox_dep = dependency('VideoToolbox', required: true)
-    audiotoolbox_dep = dependency('AudioToolbox', required: true)
-    iokit_dep = dependency('IOKit', required: true)
-    quartz_dep = dependency('QuartzCore', required: true)
-    coretext_dep = dependency('CoreText', required: true)
-    coreaudio_dep = dependency('CoreAudio', required: true)
-    coreimage_dep = dependency('CoreImage', required: true)
-    coregraphics_dep = dependency('CoreGraphics', required: true)
-    avkit_dep = dependency('AVKit', required: true)
-endif
+security_dep = frameworks['Security']
+coremedia_dep = frameworks['CoreMedia']
+avfoundation_dep = frameworks['AVFoundation']
+corevideo_dep = frameworks['CoreVideo']
+videotoolbox_dep = frameworks['VideoToolbox']
+audiotoolbox_dep = frameworks['AudioToolbox']
+iokit_dep = frameworks['IOKit']
+quartz_dep = frameworks['QuartzCore']
+coretext_dep = frameworks['CoreText']
+coreaudio_dep = frameworks['CoreAudio']
+coreimage_dep = frameworks['CoreImage']
+coregraphics_dep = frameworks['CoreGraphics']
+avkit_dep = frameworks['AVKit']
 
 # macOS specific dependencies
-if have_osx
-    cocoa_dep = dependency('Cocoa', required: true)
-    opengl_dep = dependency('OpenGL', required: true)
-    audiounit_dep = dependency('AudioUnit', required: true)
-endif
+cocoa_dep = frameworks['Cocoa']
+opengl_dep = frameworks['OpenGL']
+audiounit_dep = frameworks['AudioUnit']
 
 # iOS/tvOS specific dependencies
-if have_ios or have_tvos
-    uikit_dep = dependency('UIKit', required: true)
-    opengles_dep = dependency('OpenGLES', required: true)
-endif
+uikit_dep = frameworks['UIKit']
+opengles_dep = frameworks['OpenGLES']
+
 
 # Windows-specific dependencies
-if host_system == 'windows'
 
-    # WASAPI-related dependency
-    ksuser_lib = cc.find_library('ksuser',
-                                 has_headers: ['audioclient.h'],
-                                 required: get_option('wasapi'))
-endif
+# WASAPI-related dependency
+ksuser_lib = cc.find_library('ksuser',
+                             has_headers: ['audioclient.h'],
+                             required: host_system == 'windows' and get_option('wasapi'))
 
 # Helper libraries for modules
 # These are helper libraries used by some modules
@@ -157,6 +201,9 @@ libgcrypt_dep = dependency('libgcrypt',
 # Array that holds all enabled VLC module dicts
 vlc_modules = []
 
+# video chroma modules
+subdir('video_chroma')
+
 # codec modules
 subdir('codec')
 
@@ -214,9 +261,6 @@ subdir('spu')
 # text renderer modules
 subdir('text_renderer')
 
-# video chroma modules
-subdir('video_chroma')
-
 # video filter modules
 subdir('video_filter')
 
@@ -258,6 +302,7 @@ endif
 # entry with the needed build definition for a VLC plugin.
 #
 vlc_plugins_targets = {}
+vlc_plugins_manifest = {}
 foreach module : vlc_modules
     if not module.has_key('name')
         error('Got invalid vlc_modules entry without \'name\' key')
@@ -280,6 +325,7 @@ foreach module : vlc_modules
         'cpp_args',
         'objc_args',
         'extra_files',
+        'enabled',
     ]
     foreach key : module.keys()
         if key not in valid_dict_keys
@@ -288,6 +334,10 @@ foreach module : vlc_modules
         endif
     endforeach
 
+    if not module.get('enabled', true)
+        continue
+    endif
+
     common_args = [
         '-DMODULE_STRING="@0@"'.format(module['name']),
         '-DVLC_DYNAMIC_PLUGIN'
@@ -296,7 +346,7 @@ foreach module : vlc_modules
     kwargs = {}
 
     if module.has_key('link_language')
-      kwargs += { link_language: module.get('link_language') }
+        kwargs += { link_language: module.get('link_language') }
     endif
 
     vlc_plugin = library(
@@ -319,4 +369,7 @@ foreach module : vlc_modules
     vlc_plugins_targets += {
         module['name']: vlc_plugin
     }
+    vlc_plugins_manifest += {
+        module['name']: module
+    }
 endforeach


=====================================
modules/video_chroma/meson.build
=====================================
@@ -113,19 +113,22 @@ vlc_modules += {
 }
 
 # CVPX chroma converter
-if host_system == 'darwin'
-    # TODO: Set minimum versions for tvOS and iOS
-    vlc_modules += {
-        'name' : 'cvpx',
-        'sources' : files(
-            '../codec/vt_utils.c',
-            'cvpx.c',
-        ),
-        'link_with' : [chroma_copy_lib],
-        'dependencies' : [videotoolbox_dep, foundation_dep, coremedia_dep, corevideo_dep]
-    }
-endif
-
+# TODO: Set minimum versions for tvOS and iOS
+vlc_modules += {
+    'name' : 'cvpx',
+    'sources' : files(
+        '../codec/vt_utils.c',
+        'cvpx.c',
+    ),
+    'link_with' : [chroma_copy_lib],
+    'dependencies' : [
+        frameworks['VideoToolbox'],
+        frameworks['Foundation'],
+        frameworks['CoreMedia'],
+        frameworks['CoreVideo'],
+    ],
+    'enabled' : host_system == 'darwin',
+}
 
 ## Tests
 


=====================================
modules/video_filter/meson.build
=====================================
@@ -245,21 +245,19 @@ vlc_modules += {
 }
 
 # macOS/iOS accelerated video filters (CoreImage)
-if host_system == 'darwin'
-    vlc_modules += {
-        'name' : 'ci_filters',
-        'sources' : files('ci_filters.m', '../codec/vt_utils.c'),
-        'dependencies' : [
-            foundation_dep,
-            coregraphics_dep,
-            coreimage_dep,
-            corevideo_dep,
-            (have_osx) ? dependency('gl', required: true) : opengles_dep
-        ],
-        'include_directories' : [include_directories('../codec')]
-    }
-endif
-
+vlc_modules += {
+    'name' : 'ci_filters',
+    'sources' : files('ci_filters.m', '../codec/vt_utils.c'),
+    'dependencies' : [
+        frameworks['Foundation'],
+        frameworks['CoreGraphics'],
+        frameworks['CoreImage'],
+        frameworks['CoreVideo'],
+        (have_osx) ? dependency('gl', required: true) : frameworks['OpenGLES'],
+    ],
+    'include_directories' : [include_directories('../codec')],
+    'enabled' : host_system == 'darwin',
+}
 
 # deinterlace common helper lib
 deinterlacecommon_lib = static_library(


=====================================
modules/video_output/apple/meson.build
=====================================
@@ -17,13 +17,18 @@ vlc_modules += {
         '../../codec/vt_utils.c'
     ),
     'objc_args' : ['-fobjc-arc'],
-    'dependencies' : [foundation_dep, corefoundation_dep, corevideo_dep, darwingl_dep],
+    'dependencies' : [
+        frameworks['Foundation'],
+        frameworks['CoreFoundation'],
+        frameworks['CoreVideo'],
+        darwingl_dep,
+    ],
 }
 
 if have_osx
-    uifwk_dep = cocoa_dep
+    uifwk_dep = frameworks['Cocoa']
 else
-    uifwk_dep = uikit_dep
+    uifwk_dep = frameworks['UIKit']
 endif
 
 vlc_modules += {
@@ -42,13 +47,21 @@ if have_ios or have_tvos
         'name' : 'caeagl',
         'sources' : files('VLCOpenGLES2VideoView.m'),
         'objc_args' : ['-fobjc-arc'],
-        'dependencies' : [foundation_dep, uikit_dep, quartz_dep, opengles_dep],
+        'dependencies' : [
+            frameworks['Foundation'],
+            frameworks['UIKit'],
+            frameworks['QuartzCore'],
+            frameworks['OpenGLES']
+        ],
     }
 
     vlc_modules += {
         'name' : 'uiview',
         'sources' : files('VLCVideoUIView.m'),
         'objc_args' : ['-fobjc-arc'],
-        'dependencies' : [foundation_dep, uikit_dep],
+        'dependencies' : [
+            frameworks['Foundation'],
+            frameworks['UIKit'],
+        ],
     }
 endif


=====================================
test/meson.build
=====================================
@@ -37,6 +37,7 @@ foreach vlc_test: vlc_tests
         '-DTOP_SRCDIR="@0@"'.format(vlc_src_root),
     ]
 
+    disabled_dependencies = []
     test_modules_deps = []
     foreach module_name : vlc_test.get('module_depends', [])
         if module_name not in vlc_plugins_targets.keys()
@@ -44,8 +45,16 @@ foreach vlc_test: vlc_tests
                   .format(vlc_test['name'], module_name))
         endif
         test_modules_deps += vlc_plugins_targets[module_name]
+        if vlc_plugins_manifest[module_name].get('enabled', true)
+            disabled_dependencies += module_name
+        endif
     endforeach
 
+    if disabled_dependencies != []
+        # TODO: mark as skipped
+        continue
+    endif
+
     moc_sources = []
     if vlc_test.has_key('moc_headers') and qt5_dep.found()
         moc_sources += qt5.preprocess(moc_headers: vlc_test['moc_headers'],



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/976145edea26a87c4d3832a27e5bdd808f19a392...dc83b3eda8e1b90498d0ed2861e46bdc05c6b419

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/976145edea26a87c4d3832a27e5bdd808f19a392...dc83b3eda8e1b90498d0ed2861e46bdc05c6b419
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list