Skip to content

Commit 26bfadc

Browse files
committed
Merge branch 'master' into next
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 parents d1bdb28 + 183e373 commit 26bfadc

196 files changed

Lines changed: 3301 additions & 2025 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/guides/application-developer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ as the parameter of the ``FrameBufferAllocator::buffers()`` function.
279279

280280
.. code:: cpp
281281
282-
FrameBufferAllocator *allocator = new FrameBufferAllocator(camera);
282+
auto allocator = std::make_unique<FrameBufferAllocator>(camera);
283283
284284
for (StreamConfiguration &cfg : *config) {
285285
int ret = allocator->allocate(cfg.stream());
@@ -539,7 +539,7 @@ uses, so needs to do the following:
539539
540540
camera->stop();
541541
allocator->free(stream);
542-
delete allocator;
542+
allocator.reset();
543543
camera->release();
544544
camera.reset();
545545
cm->stop();

Documentation/guides/ipa.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,20 +387,20 @@ In the pipeline handler, we first need to construct a specialized IPA proxy.
387387
From the point of view of the pipeline hander, this is the object that is the
388388
IPA.
389389

390-
To do so, we invoke the IPAManager:
390+
To do so, we call the PipelineHandler::createIPA() function:
391391

392392
.. code-block:: C++
393393

394394
std::unique_ptr<ipa::rpi::IPAProxyRPi> ipa_ =
395-
IPAManager::createIPA<ipa::rpi::IPAProxyRPi>(pipe_, 1, 1);
395+
pipe_->createIPA<ipa::rpi::IPAProxyRPi>(1, 1);
396396

397397
The ipa::rpi namespace comes from the namespace that we defined in the mojo
398398
data definition file, in the "Namespacing" section. The name of the proxy,
399399
IPAProxyRPi, comes from the name given to the main IPA interface,
400400
IPARPiInterface, in the "The Main IPA interface" section.
401401

402-
The return value of IPAManager::createIPA shall be error-checked, to confirm
403-
that the returned pointer is not a nullptr.
402+
The return value of createIPA() shall be error-checked, to confirm that the
403+
returned pointer is not a nullptr.
404404

405405
After this, before initializing the IPA, slots should be connected to all of
406406
the IPA's signals, as defined in the Event IPA interface:

Documentation/runtime_configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ Configuration file example
8989
mode: gpu
9090
threads: 2
9191

92-
List of variables and configuration options
93-
-------------------------------------------
92+
List of environment variables and configuration options
93+
-------------------------------------------------------
9494

9595
LIBCAMERA_LOG_FILE
9696
The custom destination for log output.

REUSE.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ path = [
3939
precedence = "aggregate"
4040
SPDX-FileCopyrightText = "Copyright 2013-2020 The Chromium Authors. All rights reserved."
4141
SPDX-License-Identifier = "BSD-3-Clause"
42+
43+
[[annotations]]
44+
path = [
45+
"utils/tuning/libtuning/macbeth_ref.pgm",
46+
]
47+
precedence = "aggregate"
48+
SPDX-FileCopyrightText = "2019-2020 Raspberry Pi Ltd"
49+
SPDX-License-Identifier = "BSD-2-Clause"

include/libcamera/base/utils.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ namespace libcamera {
3737

3838
namespace utils {
3939

40+
template<class... Ts>
41+
struct overloaded : Ts... {
42+
using Ts::operator()...;
43+
};
44+
#ifndef __DOXYGEN__
45+
template<class... Ts>
46+
overloaded(Ts...) -> overloaded<Ts...>;
47+
#endif
48+
4049
const char *basename(const char *path);
4150

4251
char *secure_getenv(const char *name);

include/libcamera/internal/converter/converter_dw100.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ConverterDW100Module
3131

3232
static std::unique_ptr<ConverterDW100Module> createModule(DeviceEnumerator *enumerator);
3333

34-
int init(const YamlObject &params);
34+
int init(const ValueNode &params);
3535

3636
int configure(const StreamConfiguration &inputCfg,
3737
const std::vector<std::reference_wrapper<const StreamConfiguration>>

include/libcamera/internal/device_enumerator_udev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class DeviceEnumeratorUdev final : public DeviceEnumerator
6969

7070
struct udev *udev_;
7171
struct udev_monitor *monitor_;
72-
EventNotifier *notifier_;
72+
std::unique_ptr<EventNotifier> notifier_;
7373

7474
std::set<dev_t> orphans_;
7575
std::unordered_set<dev_t> devices_;

include/libcamera/internal/egl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class eGLImage
8888
GLenum texture_unit_; /**< Texture unit associated with this image eg (GL_TEXTURE0) */
8989
GLuint texture_; /**< OpenGL texture object ID */
9090
GLuint fbo_; /**< OpenGL frame buffer object ID */
91-
EGLImageKHR image_; /**< EGL Image handle */
9291

9392
private:
9493
LIBCAMERA_DISABLE_COPY_AND_MOVE(eGLImage)
@@ -104,7 +103,6 @@ class eGL
104103

105104
int createInputDMABufTexture2D(eGLImage &eglImage, int fd);
106105
int createOutputDMABufTexture2D(eGLImage &eglImage, int fd);
107-
void destroyDMABufTexture(eGLImage &eglImage);
108106
void createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint32_t height, void *data);
109107

110108
void pushEnv(std::vector<std::string> &shaderEnv, const char *str);

include/libcamera/internal/global_configuration.h

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,30 @@
88
#pragma once
99

1010
#include <filesystem>
11+
#include <initializer_list>
1112
#include <optional>
1213
#include <string>
1314
#include <string_view>
1415

1516
#include <libcamera/base/utils.h>
1617

17-
#include "libcamera/internal/yaml_parser.h"
18+
#include "libcamera/internal/value_node.h"
1819

1920
namespace libcamera {
2021

2122
class GlobalConfiguration
2223
{
2324
public:
24-
using Configuration = const YamlObject &;
25-
2625
GlobalConfiguration();
2726

2827
unsigned int version() const;
29-
Configuration configuration() const;
28+
const ValueNode &configuration() const;
3029

3130
template<typename T>
3231
std::optional<T> option(
3332
const std::initializer_list<std::string_view> confPath) const
3433
{
35-
const YamlObject *c = &configuration();
34+
const ValueNode *c = &configuration();
3635
for (auto part : confPath) {
3736
c = &(*c)[part];
3837
if (!*c)
@@ -43,20 +42,13 @@ class GlobalConfiguration
4342

4443
std::optional<std::vector<std::string>> listOption(
4544
const std::initializer_list<std::string_view> confPath) const;
46-
std::optional<std::string> envOption(
47-
const char *const envVariable,
48-
const std::initializer_list<std::string_view> confPath) const;
49-
std::optional<std::vector<std::string>> envListOption(
50-
const char *const envVariable,
51-
const std::initializer_list<std::string_view> confPath,
52-
const std::string delimiter = ":") const;
5345

5446
private:
55-
bool loadFile(const std::filesystem::path &fileName);
5647
void load();
48+
bool loadFile(const std::filesystem::path &fileName);
5749

58-
std::unique_ptr<YamlObject> yamlConfiguration_ =
59-
std::make_unique<YamlObject>();
50+
std::unique_ptr<ValueNode> configuration_ =
51+
std::make_unique<ValueNode>();
6052
};
6153

6254
} /* namespace libcamera */

include/libcamera/internal/ipa_manager.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,36 @@
1616
#include <libcamera/ipa/ipa_interface.h>
1717
#include <libcamera/ipa/ipa_module_info.h>
1818

19-
#include "libcamera/internal/camera_manager.h"
20-
#include "libcamera/internal/global_configuration.h"
21-
#include "libcamera/internal/ipa_module.h"
22-
#include "libcamera/internal/pipeline_handler.h"
2319
#include "libcamera/internal/pub_key.h"
2420

2521
namespace libcamera {
2622

2723
LOG_DECLARE_CATEGORY(IPAManager)
2824

25+
class CameraManager;
26+
class GlobalConfiguration;
27+
class IPAModule;
28+
class PipelineHandler;
29+
2930
class IPAManager
3031
{
3132
public:
32-
IPAManager(const GlobalConfiguration &configuration);
33+
IPAManager(const CameraManager &cm);
3334
~IPAManager();
3435

3536
template<typename T>
36-
static std::unique_ptr<T> createIPA(PipelineHandler *pipe,
37-
uint32_t minVersion,
38-
uint32_t maxVersion)
37+
std::unique_ptr<T> createIPA(PipelineHandler *pipe, uint32_t minVersion,
38+
uint32_t maxVersion)
3939
{
40-
CameraManager *cm = pipe->cameraManager();
41-
IPAManager *self = cm->_d()->ipaManager();
42-
IPAModule *m = self->module(pipe, minVersion, maxVersion);
40+
IPAModule *m = module(pipe, minVersion, maxVersion);
4341
if (!m)
4442
return nullptr;
4543

46-
const GlobalConfiguration &configuration = cm->_d()->configuration();
47-
4844
auto proxy = [&]() -> std::unique_ptr<T> {
49-
if (self->isSignatureValid(m))
50-
return std::make_unique<typename T::Threaded>(m, configuration);
45+
if (isSignatureValid(m))
46+
return std::make_unique<typename T::Threaded>(m, cm_);
5147
else
52-
return std::make_unique<typename T::Isolated>(m, configuration);
48+
return std::make_unique<typename T::Isolated>(m, cm_);
5349
}();
5450

5551
if (!proxy->isValid()) {
@@ -77,6 +73,7 @@ class IPAManager
7773

7874
bool isSignatureValid(IPAModule *ipa) const;
7975

76+
const CameraManager &cm_;
8077
std::vector<std::unique_ptr<IPAModule>> modules_;
8178

8279
#if HAVE_IPA_PUBKEY

0 commit comments

Comments
 (0)