libcamera v0.7.0+1-4ceceb68
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
benchmark.h
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2024, Red Hat Inc.
4 *
5 * Authors:
6 * Hans de Goede <hdegoede@redhat.com>
7 *
8 * Simple builtin benchmark to measure software ISP processing times
9 */
10
11#pragma once
12
13#include <stdint.h>
14#include <time.h>
15#include <libcamera/base/log.h>
16#include "libcamera/internal/global_configuration.h"
17
18namespace libcamera {
19
21{
22public:
23 Benchmark(const GlobalConfiguration &configuration);
24 ~Benchmark();
25
26 void startFrame(void);
27 void finishFrame(void);
28
29private:
30 timespec frameStartTime_;
31 bool measure;
32 /* Skip 30 frames for things to stabilize then measure 30 frames */
33 unsigned int encounteredFrames_ = 0;
34 int64_t frameProcessTime_ = 0;
35 unsigned int skipBeforeMeasure_ = 30;
36 unsigned int framesToMeasure_ = 30;
37};
38
39} /* namespace libcamera */
Simple builtin benchmark.
Definition benchmark.h:21
void finishFrame(void)
Finish measuring process time for a single frame.
Definition benchmark.cpp:76
void startFrame(void)
Start measuring process time for a single frame.
Definition benchmark.cpp:55
Support for global libcamera configuration.
Definition global_configuration.h:22
Logging infrastructure.
Top-level libcamera namespace.
Definition backtrace.h:17