ipa: raspberrypi: Rename the controller namespace from Rpi to RpiController

This avoids a namespace clash with the RPi namespace used by the ipa and
pipeline handlers, and cleans up the syntax slightly.

There are no functional changes in this commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2020-09-24 10:19:25 +01:00 committed by Kieran Bingham
parent 2ba3c68b67
commit 2f46dec949
50 changed files with 99 additions and 99 deletions

View file

@ -16,7 +16,7 @@
#include "cam_helper.hpp" #include "cam_helper.hpp"
#include "md_parser.hpp" #include "md_parser.hpp"
using namespace RPi; using namespace RPiController;
static std::map<std::string, CamHelperCreateFunc> cam_helpers; static std::map<std::string, CamHelperCreateFunc> cam_helpers;

View file

@ -13,7 +13,7 @@
#include "libcamera/internal/v4l2_videodevice.h" #include "libcamera/internal/v4l2_videodevice.h"
namespace RPi { namespace RPiController {
// The CamHelper class provides a number of facilities that anyone trying // The CamHelper class provides a number of facilities that anyone trying
// trying to drive a camera will need to know, but which are not provided by // trying to drive a camera will need to know, but which are not provided by

View file

@ -23,7 +23,7 @@
#include "md_parser_rpi.hpp" #include "md_parser_rpi.hpp"
#endif #endif
using namespace RPi; using namespace RPiController;
/* Metadata parser implementation specific to Sony IMX219 sensors. */ /* Metadata parser implementation specific to Sony IMX219 sensors. */

View file

@ -13,7 +13,7 @@
#include "cam_helper.hpp" #include "cam_helper.hpp"
#include "md_parser.hpp" #include "md_parser.hpp"
using namespace RPi; using namespace RPiController;
/* Metadata parser implementation specific to Sony IMX477 sensors. */ /* Metadata parser implementation specific to Sony IMX477 sensors. */

View file

@ -10,7 +10,7 @@
#include "cam_helper.hpp" #include "cam_helper.hpp"
#include "md_parser_rpi.hpp" #include "md_parser_rpi.hpp"
using namespace RPi; using namespace RPiController;
class CamHelperOv5647 : public CamHelper class CamHelperOv5647 : public CamHelper
{ {

View file

@ -8,7 +8,7 @@
#include "algorithm.hpp" #include "algorithm.hpp"
namespace RPi { namespace RPiController {
class AgcAlgorithm : public Algorithm class AgcAlgorithm : public Algorithm
{ {
@ -25,4 +25,4 @@ public:
SetConstraintMode(std::string const &contraint_mode_name) = 0; SetConstraintMode(std::string const &contraint_mode_name) = 0;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -7,7 +7,7 @@
#include "algorithm.hpp" #include "algorithm.hpp"
using namespace RPi; using namespace RPiController;
void Algorithm::Read([[maybe_unused]] boost::property_tree::ptree const &params) void Algorithm::Read([[maybe_unused]] boost::property_tree::ptree const &params)
{ {
@ -32,7 +32,7 @@ void Algorithm::Process([[maybe_unused]] StatisticsPtr &stats,
// For registering algorithms with the system: // For registering algorithms with the system:
static std::map<std::string, AlgoCreateFunc> algorithms; static std::map<std::string, AlgoCreateFunc> algorithms;
std::map<std::string, AlgoCreateFunc> const &RPi::GetAlgorithms() std::map<std::string, AlgoCreateFunc> const &RPiController::GetAlgorithms()
{ {
return algorithms; return algorithms;
} }

View file

@ -19,7 +19,7 @@
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
namespace RPi { namespace RPiController {
// This defines the basic interface for all control algorithms. // This defines the basic interface for all control algorithms.
@ -59,4 +59,4 @@ struct RegisterAlgorithm {
}; };
std::map<std::string, AlgoCreateFunc> const &GetAlgorithms(); std::map<std::string, AlgoCreateFunc> const &GetAlgorithms();
} // namespace RPi } // namespace RPiController

View file

@ -8,7 +8,7 @@
#include "algorithm.hpp" #include "algorithm.hpp"
namespace RPi { namespace RPiController {
class AwbAlgorithm : public Algorithm class AwbAlgorithm : public Algorithm
{ {
@ -19,4 +19,4 @@ public:
virtual void SetManualGains(double manual_r, double manual_b) = 0; virtual void SetManualGains(double manual_r, double manual_b) = 0;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -8,7 +8,7 @@
#include "algorithm.hpp" #include "algorithm.hpp"
namespace RPi { namespace RPiController {
class CcmAlgorithm : public Algorithm class CcmAlgorithm : public Algorithm
{ {
@ -18,4 +18,4 @@ public:
virtual void SetSaturation(double saturation) = 0; virtual void SetSaturation(double saturation) = 0;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -8,7 +8,7 @@
#include "algorithm.hpp" #include "algorithm.hpp"
namespace RPi { namespace RPiController {
class ContrastAlgorithm : public Algorithm class ContrastAlgorithm : public Algorithm
{ {
@ -19,4 +19,4 @@ public:
virtual void SetContrast(double contrast) = 0; virtual void SetContrast(double contrast) = 0;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -11,7 +11,7 @@
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
using namespace RPi; using namespace RPiController;
Controller::Controller() Controller::Controller()
: switch_mode_called_(false) {} : switch_mode_called_(false) {}

View file

@ -19,7 +19,7 @@
#include "device_status.h" #include "device_status.h"
#include "metadata.hpp" #include "metadata.hpp"
namespace RPi { namespace RPiController {
class Algorithm; class Algorithm;
typedef std::unique_ptr<Algorithm> AlgorithmPtr; typedef std::unique_ptr<Algorithm> AlgorithmPtr;
@ -51,4 +51,4 @@ protected:
bool switch_mode_called_; bool switch_mode_called_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -9,7 +9,7 @@
#include "histogram.hpp" #include "histogram.hpp"
using namespace RPi; using namespace RPiController;
uint64_t Histogram::CumulativeFreq(double bin) const uint64_t Histogram::CumulativeFreq(double bin) const
{ {

View file

@ -13,7 +13,7 @@
// A simple histogram class, for use in particular to find "quantiles" and // A simple histogram class, for use in particular to find "quantiles" and
// averages between "quantiles". // averages between "quantiles".
namespace RPi { namespace RPiController {
class Histogram class Histogram
{ {
@ -41,4 +41,4 @@ private:
std::vector<uint64_t> cumulative_; std::vector<uint64_t> cumulative_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -15,7 +15,7 @@
#include <boost/any.hpp> #include <boost/any.hpp>
namespace RPi { namespace RPiController {
class Metadata class Metadata
{ {
@ -74,4 +74,4 @@ private:
typedef std::shared_ptr<Metadata> MetadataPtr; typedef std::shared_ptr<Metadata> MetadataPtr;
} // namespace RPi } // namespace RPiController

View file

@ -10,7 +10,7 @@
#include "pwl.hpp" #include "pwl.hpp"
using namespace RPi; using namespace RPiController;
void Pwl::Read(boost::property_tree::ptree const &params) void Pwl::Read(boost::property_tree::ptree const &params)
{ {

View file

@ -11,7 +11,7 @@
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
namespace RPi { namespace RPiController {
class Pwl class Pwl
{ {
@ -106,4 +106,4 @@ private:
std::vector<Point> points_; std::vector<Point> points_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -18,7 +18,7 @@
#include "agc.hpp" #include "agc.hpp"
using namespace RPi; using namespace RPiController;
#define NAME "rpi.agc" #define NAME "rpi.agc"

View file

@ -20,7 +20,7 @@
#define AGC_STATS_SIZE 15 #define AGC_STATS_SIZE 15
namespace RPi { namespace RPiController {
struct AgcMeteringMode { struct AgcMeteringMode {
double weights[AGC_STATS_SIZE]; double weights[AGC_STATS_SIZE];
@ -121,4 +121,4 @@ private:
double fixed_analogue_gain_; double fixed_analogue_gain_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -11,7 +11,7 @@
// Raspberry Pi ALSC (Auto Lens Shading Correction) algorithm. // Raspberry Pi ALSC (Auto Lens Shading Correction) algorithm.
using namespace RPi; using namespace RPiController;
#define NAME "rpi.alsc" #define NAME "rpi.alsc"

View file

@ -13,7 +13,7 @@
#include "../algorithm.hpp" #include "../algorithm.hpp"
#include "../alsc_status.h" #include "../alsc_status.h"
namespace RPi { namespace RPiController {
// Algorithm to generate automagic LSC (Lens Shading Correction) tables. // Algorithm to generate automagic LSC (Lens Shading Correction) tables.
@ -102,4 +102,4 @@ private:
double lambda_b_[ALSC_CELLS_X * ALSC_CELLS_Y]; double lambda_b_[ALSC_CELLS_X * ALSC_CELLS_Y];
}; };
} // namespace RPi } // namespace RPiController

View file

@ -10,7 +10,7 @@
#include "awb.hpp" #include "awb.hpp"
using namespace RPi; using namespace RPiController;
#define NAME "rpi.awb" #define NAME "rpi.awb"

View file

@ -14,7 +14,7 @@
#include "../pwl.hpp" #include "../pwl.hpp"
#include "../awb_status.h" #include "../awb_status.h"
namespace RPi { namespace RPiController {
// Control algorithm to perform AWB calculations. // Control algorithm to perform AWB calculations.
@ -175,4 +175,4 @@ static inline Awb::RGB operator*(Awb::RGB const &rgb, double d)
return d * rgb; return d * rgb;
} }
} // namespace RPi } // namespace RPiController

View file

@ -13,7 +13,7 @@
#include "black_level.hpp" #include "black_level.hpp"
using namespace RPi; using namespace RPiController;
#define NAME "rpi.black_level" #define NAME "rpi.black_level"

View file

@ -11,7 +11,7 @@
// This is our implementation of the "black level algorithm". // This is our implementation of the "black level algorithm".
namespace RPi { namespace RPiController {
class BlackLevel : public Algorithm class BlackLevel : public Algorithm
{ {
@ -27,4 +27,4 @@ private:
double black_level_b_; double black_level_b_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -13,7 +13,7 @@
#include "ccm.hpp" #include "ccm.hpp"
using namespace RPi; using namespace RPiController;
// This algorithm selects a CCM (Colour Correction Matrix) according to the // This algorithm selects a CCM (Colour Correction Matrix) according to the
// colour temperature estimated by AWB (interpolating between known matricies as // colour temperature estimated by AWB (interpolating between known matricies as

View file

@ -12,7 +12,7 @@
#include "../ccm_algorithm.hpp" #include "../ccm_algorithm.hpp"
#include "../pwl.hpp" #include "../pwl.hpp"
namespace RPi { namespace RPiController {
// Algorithm to calculate colour matrix. Should be placed after AWB. // Algorithm to calculate colour matrix. Should be placed after AWB.
@ -73,4 +73,4 @@ private:
std::atomic<double> saturation_; std::atomic<double> saturation_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -11,7 +11,7 @@
#include "contrast.hpp" #include "contrast.hpp"
using namespace RPi; using namespace RPiController;
// This is a very simple control algorithm which simply retrieves the results of // This is a very simple control algorithm which simply retrieves the results of
// AGC and AWB via their "status" metadata, and applies digital gain to the // AGC and AWB via their "status" metadata, and applies digital gain to the

View file

@ -12,7 +12,7 @@
#include "../contrast_algorithm.hpp" #include "../contrast_algorithm.hpp"
#include "../pwl.hpp" #include "../pwl.hpp"
namespace RPi { namespace RPiController {
// Back End algorithm to appaly correct digital gain. Should be placed after // Back End algorithm to appaly correct digital gain. Should be placed after
// Back End AWB. // Back End AWB.
@ -48,4 +48,4 @@ private:
std::mutex mutex_; std::mutex mutex_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -8,7 +8,7 @@
#include "../logging.hpp" #include "../logging.hpp"
#include "dpc.hpp" #include "dpc.hpp"
using namespace RPi; using namespace RPiController;
// We use the lux status so that we can apply stronger settings in darkness (if // We use the lux status so that we can apply stronger settings in darkness (if
// necessary). // necessary).

View file

@ -9,7 +9,7 @@
#include "../algorithm.hpp" #include "../algorithm.hpp"
#include "../dpc_status.h" #include "../dpc_status.h"
namespace RPi { namespace RPiController {
// Back End algorithm to apply appropriate GEQ settings. // Back End algorithm to apply appropriate GEQ settings.
@ -29,4 +29,4 @@ private:
DpcConfig config_; DpcConfig config_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -11,7 +11,7 @@
#include "../focus_status.h" #include "../focus_status.h"
#include "focus.hpp" #include "focus.hpp"
using namespace RPi; using namespace RPiController;
using namespace libcamera; using namespace libcamera;
LOG_DEFINE_CATEGORY(RPiFocus) LOG_DEFINE_CATEGORY(RPiFocus)

View file

@ -15,7 +15,7 @@
* control. * control.
*/ */
namespace RPi { namespace RPiController {
class Focus : public Algorithm class Focus : public Algorithm
{ {
@ -25,4 +25,4 @@ public:
void Process(StatisticsPtr &stats, Metadata *image_metadata) override; void Process(StatisticsPtr &stats, Metadata *image_metadata) override;
}; };
} /* namespace RPi */ } /* namespace RPiController */

View file

@ -12,7 +12,7 @@
#include "geq.hpp" #include "geq.hpp"
using namespace RPi; using namespace RPiController;
// We use the lux status so that we can apply stronger settings in darkness (if // We use the lux status so that we can apply stronger settings in darkness (if
// necessary). // necessary).

View file

@ -9,7 +9,7 @@
#include "../algorithm.hpp" #include "../algorithm.hpp"
#include "../geq_status.h" #include "../geq_status.h"
namespace RPi { namespace RPiController {
// Back End algorithm to apply appropriate GEQ settings. // Back End algorithm to apply appropriate GEQ settings.
@ -31,4 +31,4 @@ private:
GeqConfig config_; GeqConfig config_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -13,7 +13,7 @@
#include "lux.hpp" #include "lux.hpp"
using namespace RPi; using namespace RPiController;
#define NAME "rpi.lux" #define NAME "rpi.lux"

View file

@ -14,7 +14,7 @@
// This is our implementation of the "lux control algorithm". // This is our implementation of the "lux control algorithm".
namespace RPi { namespace RPiController {
class Lux : public Algorithm class Lux : public Algorithm
{ {
@ -39,4 +39,4 @@ private:
std::mutex mutex_; std::mutex mutex_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -13,7 +13,7 @@
#include "noise.hpp" #include "noise.hpp"
using namespace RPi; using namespace RPiController;
#define NAME "rpi.noise" #define NAME "rpi.noise"

View file

@ -11,7 +11,7 @@
// This is our implementation of the "noise algorithm". // This is our implementation of the "noise algorithm".
namespace RPi { namespace RPiController {
class Noise : public Algorithm class Noise : public Algorithm
{ {
@ -29,4 +29,4 @@ private:
std::atomic<double> mode_factor_; std::atomic<double> mode_factor_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -10,7 +10,7 @@
#include "sdn.hpp" #include "sdn.hpp"
using namespace RPi; using namespace RPiController;
// Calculate settings for the spatial denoise block using the noise profile in // Calculate settings for the spatial denoise block using the noise profile in
// the image metadata. // the image metadata.

View file

@ -8,7 +8,7 @@
#include "../algorithm.hpp" #include "../algorithm.hpp"
namespace RPi { namespace RPiController {
// Algorithm to calculate correct spatial denoise (SDN) settings. // Algorithm to calculate correct spatial denoise (SDN) settings.
@ -26,4 +26,4 @@ private:
double strength_; double strength_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -12,7 +12,7 @@
#include "sharpen.hpp" #include "sharpen.hpp"
using namespace RPi; using namespace RPiController;
#define NAME "rpi.sharpen" #define NAME "rpi.sharpen"

View file

@ -11,7 +11,7 @@
// This is our implementation of the "sharpen algorithm". // This is our implementation of the "sharpen algorithm".
namespace RPi { namespace RPiController {
class Sharpen : public SharpenAlgorithm class Sharpen : public SharpenAlgorithm
{ {
@ -31,4 +31,4 @@ private:
double user_strength_; double user_strength_;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -8,7 +8,7 @@
#include "algorithm.hpp" #include "algorithm.hpp"
namespace RPi { namespace RPiController {
class SharpenAlgorithm : public Algorithm class SharpenAlgorithm : public Algorithm
{ {
@ -18,4 +18,4 @@ public:
virtual void SetStrength(double strength) = 0; virtual void SetStrength(double strength) = 0;
}; };
} // namespace RPi } // namespace RPiController

View file

@ -11,7 +11,7 @@
#include "md_parser.hpp" #include "md_parser.hpp"
using namespace RPi; using namespace RPiController;
// This function goes through the embedded data to find the offsets (not // This function goes through the embedded data to find the offsets (not
// values!), in the data block, where the values of the given registers can // values!), in the data block, where the values of the given registers can

View file

@ -50,7 +50,7 @@ parser->Reset();
before calling Parse again. */ before calling Parse again. */
namespace RPi { namespace RPiController {
// Abstract base class from which other metadata parsers are derived. // Abstract base class from which other metadata parsers are derived.

View file

@ -9,7 +9,7 @@
#include "md_parser_rpi.hpp" #include "md_parser_rpi.hpp"
using namespace RPi; using namespace RPiController;
MdParserRPi::MdParserRPi() MdParserRPi::MdParserRPi()
{ {

View file

@ -8,7 +8,7 @@
#include "md_parser.hpp" #include "md_parser.hpp"
namespace RPi { namespace RPiController {
class MdParserRPi : public MdParser class MdParserRPi : public MdParser
{ {

View file

@ -125,10 +125,10 @@ private:
CameraMode lastMode_; CameraMode lastMode_;
/* Raspberry Pi controller specific defines. */ /* Raspberry Pi controller specific defines. */
std::unique_ptr<RPi::CamHelper> helper_; std::unique_ptr<RPiController::CamHelper> helper_;
RPi::Controller controller_; RPiController::Controller controller_;
bool controllerInit_; bool controllerInit_;
RPi::Metadata rpiMetadata_; RPiController::Metadata rpiMetadata_;
/* /*
* We count frames to decide if the frame must be hidden (e.g. from * We count frames to decide if the frame must be hidden (e.g. from
@ -211,7 +211,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,
*/ */
std::string cameraName(sensorInfo.model); std::string cameraName(sensorInfo.model);
if (!helper_) { if (!helper_) {
helper_ = std::unique_ptr<RPi::CamHelper>(RPi::CamHelper::Create(cameraName)); helper_ = std::unique_ptr<RPiController::CamHelper>(RPiController::CamHelper::Create(cameraName));
/* /*
* Pass out the sensor config to the pipeline handler in order * Pass out the sensor config to the pipeline handler in order
* to setup the staggered writer class. * to setup the staggered writer class.
@ -295,7 +295,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,
agcStatus.analogue_gain = DEFAULT_ANALOGUE_GAIN; agcStatus.analogue_gain = DEFAULT_ANALOGUE_GAIN;
} }
RPi::Metadata metadata; RPiController::Metadata metadata;
controller_.SwitchMode(mode_, &metadata); controller_.SwitchMode(mode_, &metadata);
/* SwitchMode may supply updated exposure/gain values to use. */ /* SwitchMode may supply updated exposure/gain values to use. */
@ -397,7 +397,7 @@ void IPARPi::processEvent(const IPAOperationData &event)
void IPARPi::reportMetadata() void IPARPi::reportMetadata()
{ {
std::unique_lock<RPi::Metadata> lock(rpiMetadata_); std::unique_lock<RPiController::Metadata> lock(rpiMetadata_);
/* /*
* Certain information about the current frame and how it will be * Certain information about the current frame and how it will be
@ -502,7 +502,7 @@ void IPARPi::queueRequest(const ControlList &controls)
switch (ctrl.first) { switch (ctrl.first) {
case controls::AE_ENABLE: { case controls::AE_ENABLE: {
RPi::Algorithm *agc = controller_.GetAlgorithm("agc"); RPiController::Algorithm *agc = controller_.GetAlgorithm("agc");
ASSERT(agc); ASSERT(agc);
if (ctrl.second.get<bool>() == false) if (ctrl.second.get<bool>() == false)
agc->Pause(); agc->Pause();
@ -514,7 +514,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::EXPOSURE_TIME: { case controls::EXPOSURE_TIME: {
RPi::AgcAlgorithm *agc = dynamic_cast<RPi::AgcAlgorithm *>( RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
controller_.GetAlgorithm("agc")); controller_.GetAlgorithm("agc"));
ASSERT(agc); ASSERT(agc);
/* This expects units of micro-seconds. */ /* This expects units of micro-seconds. */
@ -528,7 +528,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::ANALOGUE_GAIN: { case controls::ANALOGUE_GAIN: {
RPi::AgcAlgorithm *agc = dynamic_cast<RPi::AgcAlgorithm *>( RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
controller_.GetAlgorithm("agc")); controller_.GetAlgorithm("agc"));
ASSERT(agc); ASSERT(agc);
agc->SetFixedAnalogueGain(ctrl.second.get<float>()); agc->SetFixedAnalogueGain(ctrl.second.get<float>());
@ -542,7 +542,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::AE_METERING_MODE: { case controls::AE_METERING_MODE: {
RPi::AgcAlgorithm *agc = dynamic_cast<RPi::AgcAlgorithm *>( RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
controller_.GetAlgorithm("agc")); controller_.GetAlgorithm("agc"));
ASSERT(agc); ASSERT(agc);
@ -558,7 +558,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::AE_CONSTRAINT_MODE: { case controls::AE_CONSTRAINT_MODE: {
RPi::AgcAlgorithm *agc = dynamic_cast<RPi::AgcAlgorithm *>( RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
controller_.GetAlgorithm("agc")); controller_.GetAlgorithm("agc"));
ASSERT(agc); ASSERT(agc);
@ -574,7 +574,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::AE_EXPOSURE_MODE: { case controls::AE_EXPOSURE_MODE: {
RPi::AgcAlgorithm *agc = dynamic_cast<RPi::AgcAlgorithm *>( RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
controller_.GetAlgorithm("agc")); controller_.GetAlgorithm("agc"));
ASSERT(agc); ASSERT(agc);
@ -590,7 +590,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::EXPOSURE_VALUE: { case controls::EXPOSURE_VALUE: {
RPi::AgcAlgorithm *agc = dynamic_cast<RPi::AgcAlgorithm *>( RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
controller_.GetAlgorithm("agc")); controller_.GetAlgorithm("agc"));
ASSERT(agc); ASSERT(agc);
@ -606,7 +606,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::AWB_ENABLE: { case controls::AWB_ENABLE: {
RPi::Algorithm *awb = controller_.GetAlgorithm("awb"); RPiController::Algorithm *awb = controller_.GetAlgorithm("awb");
ASSERT(awb); ASSERT(awb);
if (ctrl.second.get<bool>() == false) if (ctrl.second.get<bool>() == false)
@ -620,7 +620,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::AWB_MODE: { case controls::AWB_MODE: {
RPi::AwbAlgorithm *awb = dynamic_cast<RPi::AwbAlgorithm *>( RPiController::AwbAlgorithm *awb = dynamic_cast<RPiController::AwbAlgorithm *>(
controller_.GetAlgorithm("awb")); controller_.GetAlgorithm("awb"));
ASSERT(awb); ASSERT(awb);
@ -637,7 +637,7 @@ void IPARPi::queueRequest(const ControlList &controls)
case controls::COLOUR_GAINS: { case controls::COLOUR_GAINS: {
auto gains = ctrl.second.get<Span<const float>>(); auto gains = ctrl.second.get<Span<const float>>();
RPi::AwbAlgorithm *awb = dynamic_cast<RPi::AwbAlgorithm *>( RPiController::AwbAlgorithm *awb = dynamic_cast<RPiController::AwbAlgorithm *>(
controller_.GetAlgorithm("awb")); controller_.GetAlgorithm("awb"));
ASSERT(awb); ASSERT(awb);
@ -650,7 +650,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::BRIGHTNESS: { case controls::BRIGHTNESS: {
RPi::ContrastAlgorithm *contrast = dynamic_cast<RPi::ContrastAlgorithm *>( RPiController::ContrastAlgorithm *contrast = dynamic_cast<RPiController::ContrastAlgorithm *>(
controller_.GetAlgorithm("contrast")); controller_.GetAlgorithm("contrast"));
ASSERT(contrast); ASSERT(contrast);
@ -661,7 +661,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::CONTRAST: { case controls::CONTRAST: {
RPi::ContrastAlgorithm *contrast = dynamic_cast<RPi::ContrastAlgorithm *>( RPiController::ContrastAlgorithm *contrast = dynamic_cast<RPiController::ContrastAlgorithm *>(
controller_.GetAlgorithm("contrast")); controller_.GetAlgorithm("contrast"));
ASSERT(contrast); ASSERT(contrast);
@ -672,7 +672,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::SATURATION: { case controls::SATURATION: {
RPi::CcmAlgorithm *ccm = dynamic_cast<RPi::CcmAlgorithm *>( RPiController::CcmAlgorithm *ccm = dynamic_cast<RPiController::CcmAlgorithm *>(
controller_.GetAlgorithm("ccm")); controller_.GetAlgorithm("ccm"));
ASSERT(ccm); ASSERT(ccm);
@ -683,7 +683,7 @@ void IPARPi::queueRequest(const ControlList &controls)
} }
case controls::SHARPNESS: { case controls::SHARPNESS: {
RPi::SharpenAlgorithm *sharpen = dynamic_cast<RPi::SharpenAlgorithm *>( RPiController::SharpenAlgorithm *sharpen = dynamic_cast<RPiController::SharpenAlgorithm *>(
controller_.GetAlgorithm("sharpen")); controller_.GetAlgorithm("sharpen"));
ASSERT(sharpen); ASSERT(sharpen);
@ -726,7 +726,7 @@ void IPARPi::prepareISP(unsigned int bufferId)
controller_.Prepare(&rpiMetadata_); controller_.Prepare(&rpiMetadata_);
/* Lock the metadata buffer to avoid constant locks/unlocks. */ /* Lock the metadata buffer to avoid constant locks/unlocks. */
std::unique_lock<RPi::Metadata> lock(rpiMetadata_); std::unique_lock<RPiController::Metadata> lock(rpiMetadata_);
AwbStatus *awbStatus = rpiMetadata_.GetLocked<AwbStatus>("awb.status"); AwbStatus *awbStatus = rpiMetadata_.GetLocked<AwbStatus>("awb.status");
if (awbStatus) if (awbStatus)
@ -787,18 +787,18 @@ bool IPARPi::parseEmbeddedData(unsigned int bufferId, struct DeviceStatus &devic
int size = buffers_.find(bufferId)->second.planes()[0].length; int size = buffers_.find(bufferId)->second.planes()[0].length;
helper_->Parser().SetBufferSize(size); helper_->Parser().SetBufferSize(size);
RPi::MdParser::Status status = helper_->Parser().Parse(it->second); RPiController::MdParser::Status status = helper_->Parser().Parse(it->second);
if (status != RPi::MdParser::Status::OK) { if (status != RPiController::MdParser::Status::OK) {
LOG(IPARPI, Error) << "Embedded Buffer parsing failed, error " << status; LOG(IPARPI, Error) << "Embedded Buffer parsing failed, error " << status;
} else { } else {
uint32_t exposure_lines, gain_code; uint32_t exposure_lines, gain_code;
if (helper_->Parser().GetExposureLines(exposure_lines) != RPi::MdParser::Status::OK) { if (helper_->Parser().GetExposureLines(exposure_lines) != RPiController::MdParser::Status::OK) {
LOG(IPARPI, Error) << "Exposure time failed"; LOG(IPARPI, Error) << "Exposure time failed";
return false; return false;
} }
deviceStatus.shutter_speed = helper_->Exposure(exposure_lines); deviceStatus.shutter_speed = helper_->Exposure(exposure_lines);
if (helper_->Parser().GetGainCode(gain_code) != RPi::MdParser::Status::OK) { if (helper_->Parser().GetGainCode(gain_code) != RPiController::MdParser::Status::OK) {
LOG(IPARPI, Error) << "Gain failed"; LOG(IPARPI, Error) << "Gain failed";
return false; return false;
} }
@ -821,7 +821,7 @@ void IPARPi::processStats(unsigned int bufferId)
} }
bcm2835_isp_stats *stats = static_cast<bcm2835_isp_stats *>(it->second); bcm2835_isp_stats *stats = static_cast<bcm2835_isp_stats *>(it->second);
RPi::StatisticsPtr statistics = std::make_shared<bcm2835_isp_stats>(*stats); RPiController::StatisticsPtr statistics = std::make_shared<bcm2835_isp_stats>(*stats);
controller_.Process(statistics, &rpiMetadata_); controller_.Process(statistics, &rpiMetadata_);
struct AgcStatus agcStatus; struct AgcStatus agcStatus;