mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-19 02:15:05 +03:00
apps: Define local functions in anonymous namespace
Multiple local functions are defined in the global namespace without the static keyword. This compiles fine for now, but will cause a missing declaration warning when we enable them. To prepare for that, move the function declaration to an anonymous namespace. While at it, for consistency, include an existing static function in the namespace and drop the static keyword. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
cdb05b3712
commit
37d81a390b
3 changed files with 13 additions and 1 deletions
|
@ -344,12 +344,16 @@ std::string CamApp::cameraName(const Camera *camera)
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
void signalHandler([[maybe_unused]] int signal)
|
void signalHandler([[maybe_unused]] int signal)
|
||||||
{
|
{
|
||||||
std::cout << "Exiting" << std::endl;
|
std::cout << "Exiting" << std::endl;
|
||||||
CamApp::instance()->quit();
|
CamApp::instance()->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* namespace */
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
CamApp app;
|
CamApp app;
|
||||||
|
|
|
@ -126,6 +126,8 @@ struct Matrix3d {
|
||||||
float m[9];
|
float m[9];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
void packScanlineSBGGR8(void *output, const void *input, unsigned int width)
|
void packScanlineSBGGR8(void *output, const void *input, unsigned int width)
|
||||||
{
|
{
|
||||||
const uint8_t *in = static_cast<const uint8_t *>(input);
|
const uint8_t *in = static_cast<const uint8_t *>(input);
|
||||||
|
@ -282,7 +284,7 @@ void thumbScanlineIPU3([[maybe_unused]] const FormatInfo &info, void *output,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const std::map<PixelFormat, FormatInfo> formatInfo = {
|
const std::map<PixelFormat, FormatInfo> formatInfo = {
|
||||||
{ formats::SBGGR8, {
|
{ formats::SBGGR8, {
|
||||||
.bitsPerSample = 8,
|
.bitsPerSample = 8,
|
||||||
.pattern = { CFAPatternBlue, CFAPatternGreen, CFAPatternGreen, CFAPatternRed },
|
.pattern = { CFAPatternBlue, CFAPatternGreen, CFAPatternGreen, CFAPatternRed },
|
||||||
|
@ -381,6 +383,8 @@ static const std::map<PixelFormat, FormatInfo> formatInfo = {
|
||||||
} },
|
} },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} /* namespace */
|
||||||
|
|
||||||
int DNGWriter::write(const char *filename, const Camera *camera,
|
int DNGWriter::write(const char *filename, const Camera *camera,
|
||||||
const StreamConfiguration &config,
|
const StreamConfiguration &config,
|
||||||
const ControlList &metadata,
|
const ControlList &metadata,
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
using namespace libcamera;
|
using namespace libcamera;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
void signalHandler([[maybe_unused]] int signal)
|
void signalHandler([[maybe_unused]] int signal)
|
||||||
{
|
{
|
||||||
qInfo() << "Exiting";
|
qInfo() << "Exiting";
|
||||||
|
@ -52,6 +54,8 @@ OptionsParser::Options parseOptions(int argc, char *argv[])
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* namespace */
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue