summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/blc.h
diff options
context:
space:
mode:
authorMarvin Schmidt <marvin.schmidt1987@gmail.com>2022-08-29 20:58:47 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-30 15:26:38 +0300
commit7354fb3b890bba37c81d70fc47f551d18be5c9ba (patch)
tree9574808647181fe8bcd4623577a419fe703531dc /src/ipa/ipu3/algorithms/blc.h
parent18764a15c7062e241df3ffb587bf44d0c14c898d (diff)
test: camera: Remove redundant call of std::string::c_str()
libcamera::File::exists() takes a const reference to a std::string and clang-tidy's readability-redundant-string-cstr check warns about it: > ../test/camera/camera_reconfigure.cpp:182:21: warning: redundant call to 'c_str' [readability-redundant-string-cstr] > if (File::exists(pname.c_str())) { > ^~~~~~~~~~~~~ > pname Signed-off-by: Marvin Schmidt <marvin.schmidt1987@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/blc.h')
0 files changed, 0 insertions, 0 deletions
id='n119' href='#n119'>119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
# SPDX-License-Identifier: CC0-1.0

libcamera_public_sources = files([
    'camera.cpp',
    'camera_manager.cpp',
    'color_space.cpp',
    'controls.cpp',
    'fence.cpp',
    'framebuffer.cpp',
    'framebuffer_allocator.cpp',
    'geometry.cpp',
    'orientation.cpp',
    'pixel_format.cpp',
    'request.cpp',
    'stream.cpp',
    'transform.cpp',
])

libcamera_internal_sources = files([
    'bayer_format.cpp',
    'byte_stream_buffer.cpp',
    'camera_controls.cpp',
    'camera_lens.cpp',
    'control_serializer.cpp',
    'control_validator.cpp',
    'converter.cpp',
    'delayed_controls.cpp',
    'device_enumerator.cpp',
    'device_enumerator_sysfs.cpp',
    'dma_buf_allocator.cpp',
    'formats.cpp',
    'ipa_controls.cpp',
    'ipa_data_serializer.cpp',
    'ipa_interface.cpp',
    'ipa_manager.cpp',
    'ipa_module.cpp',
    'ipa_proxy.cpp',
    'ipc_pipe.cpp',
    'ipc_pipe_unixsocket.cpp',
    'ipc_unixsocket.cpp',
    'mapped_framebuffer.cpp',
    'media_device.cpp',
    'media_object.cpp',
    'pipeline_handler.cpp',
    'process.cpp',
    'pub_key.cpp',
    'shared_mem_object.cpp',
    'source_paths.cpp',
    'sysfs.cpp',
    'v4l2_device.cpp',
    'v4l2_pixelformat.cpp',
    'v4l2_subdevice.cpp',
    'v4l2_videodevice.cpp',
    'yaml_parser.cpp',
])

includes = [
    libcamera_includes,
]

libcamera_deps = []

libatomic = cc.find_library('atomic', required : false)
libthreads = dependency('threads')

subdir('base')
subdir('converter')
subdir('ipa')
subdir('pipeline')
subdir('proxy')
subdir('sensor')
subdir('software_isp')

null_dep = dependency('', required : false)

# TODO: Use dependency('dl') when updating to meson 0.62.0 or newer.
libdl = null_dep
if not cc.has_function('dlopen')
    libdl = cc.find_library('dl')
endif
libudev = dependency('libudev', required : get_option('udev'))
libyaml = dependency('yaml-0.1', required : false)

# Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first.
libcrypto = dependency('gnutls', required : false)
if libcrypto.found()
    config_h.set('HAVE_GNUTLS', 1)
else
    libcrypto = dependency('libcrypto', required : false)
    if libcrypto.found()
        config_h.set('HAVE_CRYPTO', 1)
    endif
endif

if not libcrypto.found()
    warning('Neither gnutls nor libcrypto found, all IPA modules will be isolated')
    summary({'IPA modules signed with': 'None (modules will run isolated)'},
            section : 'Configuration')
else
    summary({'IPA modules signed with' : libcrypto.name()}, section : 'Configuration')
endif

if liblttng.found()
    tracing_enabled = true
    config_h.set('HAVE_TRACING', 1)
    libcamera_internal_sources += files(['tracepoints.cpp'])
else
    tracing_enabled = false
endif

if libudev.found()
    config_h.set('HAVE_LIBUDEV', 1)
    libcamera_internal_sources += files([
        'device_enumerator_udev.cpp',
    ])
endif

# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP.
if not libyaml.found()
    cmake = import('cmake')

    libyaml_vars = cmake.subproject_options()
    libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'})
    libyaml_vars.append_compile_args('c', '-Wno-unused-value')
    libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars)
    libyaml = libyaml_wrap.dependency('yaml')
endif

control_sources = []

controls_mode_files = {
    'controls': [
        controls_files,
        'control_ids.cpp',
    ],
    'properties': [
        properties_files,
        'property_ids.cpp',
    ],
}

foreach mode, inout_files : controls_mode_files
    input_files = inout_files[0]
    output_file = inout_files[1]

    template_file = files('control_ids.cpp.in')
    ranges_file = files('control_ranges.yaml')

    control_sources += custom_target(mode + '_ids_cpp',
                                     input : input_files,
                                     output : output_file,
                                     command : [gen_controls, '-o', '@OUTPUT@',
                                                '--mode', mode, '-t', template_file,
                                                '-r', ranges_file, '@INPUT@'],
                                     env : py_build_env)
endforeach

libcamera_public_sources += control_sources

gen_version = meson.project_source_root() / 'utils' / 'gen-version.sh'

# Use vcs_tag() and not configure_file() or run_command(), to ensure that the
# version gets updated with every ninja build and not just at meson setup time.
version_cpp = vcs_tag(command : [gen_version, meson.project_build_root(), meson.project_source_root()],
                      input : 'version.cpp.in',
                      output : 'version.cpp',
                      fallback : meson.project_version())

libcamera_public_sources += version_cpp

if ipa_sign_module
    ipa_pub_key_cpp = custom_target('ipa_pub_key_cpp',
                                    input : [ipa_priv_key, 'ipa_pub_key.cpp.in'],
                                    output : 'ipa_pub_key.cpp',
                                    command : [gen_ipa_pub_key, '@INPUT@', '@OUTPUT@'])

    libcamera_internal_sources += ipa_pub_key_cpp
endif

libcamera_deps += [
    libatomic,
    libcamera_base,
    libcamera_base_private,
    libcrypto,
    libdl,
    liblttng,
    libudev,
    libyaml,
]

# We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.
# The build_rpath is stripped at install time by meson, so we determine at
# runtime if the library is running from an installed location by checking
# for the presence or abscence of the dynamic tag.

libcamera = shared_library('libcamera',
                           [
                               libcamera_public_headers,
                               libcamera_public_sources,
                               libcamera_ipa_headers,
                               libcamera_internal_headers,
                               libcamera_internal_sources,
                           ],
                           version : libcamera_version,
                           soversion : libcamera_soversion,
                           name_prefix : '',
                           install : true,
                           include_directories : includes,
                           build_rpath : '/',
                           dependencies : libcamera_deps)

libcamera_public = declare_dependency(sources : [
                                          libcamera_public_headers,
                                      ],
                                      include_directories : libcamera_includes,
                                      dependencies : libcamera_base,
                                      link_with : libcamera)

# Internal dependency for components and plugins which can use private APIs
libcamera_private = declare_dependency(sources : [
                                           libcamera_ipa_headers,
                                       ],
                                       dependencies : [
                                           libcamera_public,
                                           libcamera_base_private,
                                       ])

pkg_mod = import('pkgconfig')
pkg_mod.generate(libcamera,
                 libraries : libcamera_base_lib,
                 description : 'Complex Camera Support Library',
                 subdirs : 'libcamera')

meson.override_dependency('libcamera', libcamera_public)

subdir('proxy/worker')