mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-13 19:13:41 +00:00
lint fixes
This commit is contained in:
@@ -9,7 +9,6 @@ changedir = /src
|
|||||||
[testenv:cppcheck]
|
[testenv:cppcheck]
|
||||||
allowlist_externals = cppcheck
|
allowlist_externals = cppcheck
|
||||||
commands = cppcheck \
|
commands = cppcheck \
|
||||||
-j4 \
|
|
||||||
--force \
|
--force \
|
||||||
--std=c17 \
|
--std=c17 \
|
||||||
--error-exitcode=1 \
|
--error-exitcode=1 \
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ INLINE int us_process_track_parent_death(void) {
|
|||||||
#ifdef WITH_SETPROCTITLE
|
#ifdef WITH_SETPROCTITLE
|
||||||
# pragma GCC diagnostic ignored "-Wunused-parameter"
|
# pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
INLINE void us_process_set_name_prefix(int argc, char *argv[], const char *prefix) {
|
INLINE void us_process_set_name_prefix(int argc, const char *argv[], const char *prefix) {
|
||||||
# pragma GCC diagnostic pop
|
# pragma GCC diagnostic pop
|
||||||
|
|
||||||
char *cmdline = NULL;
|
char *cmdline = NULL;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ static int _device_query_control(
|
|||||||
us_device_s *dev, struct v4l2_queryctrl *query,
|
us_device_s *dev, struct v4l2_queryctrl *query,
|
||||||
const char *name, unsigned cid, bool quiet);
|
const char *name, unsigned cid, bool quiet);
|
||||||
static void _device_set_control(
|
static void _device_set_control(
|
||||||
us_device_s *dev, struct v4l2_queryctrl *query,
|
us_device_s *dev, const struct v4l2_queryctrl *query,
|
||||||
const char *name, unsigned cid, int value, bool quiet);
|
const char *name, unsigned cid, int value, bool quiet);
|
||||||
|
|
||||||
static const char *_format_to_string_nullable(unsigned format);
|
static const char *_format_to_string_nullable(unsigned format);
|
||||||
@@ -843,7 +843,7 @@ static int _device_query_control(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void _device_set_control(
|
static void _device_set_control(
|
||||||
us_device_s *dev, struct v4l2_queryctrl *query,
|
us_device_s *dev, const struct v4l2_queryctrl *query,
|
||||||
const char *name, unsigned cid, int value, bool quiet) {
|
const char *name, unsigned cid, int value, bool quiet) {
|
||||||
|
|
||||||
if (value < query->minimum || value > query->maximum || value % query->step != 0) {
|
if (value < query->minimum || value > query->maximum || value % query->step != 0) {
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ static void _worker_job_destroy(void *v_job) {
|
|||||||
static bool _worker_run_job(us_worker_s *wr) {
|
static bool _worker_run_job(us_worker_s *wr) {
|
||||||
us_encoder_job_s *job = (us_encoder_job_s *)wr->job;
|
us_encoder_job_s *job = (us_encoder_job_s *)wr->job;
|
||||||
us_encoder_s *enc = job->enc; // Just for _ER()
|
us_encoder_s *enc = job->enc; // Just for _ER()
|
||||||
us_frame_s *src = &job->hw->raw;
|
const us_frame_s *src = &job->hw->raw;
|
||||||
us_frame_s *dest = job->dest;
|
us_frame_s *dest = job->dest;
|
||||||
|
|
||||||
assert(_ER(type) != US_ENCODER_TYPE_UNKNOWN);
|
assert(_ER(type) != US_ENCODER_TYPE_UNKNOWN);
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ static int _parse_resolution(const char *str, unsigned *width, unsigned *height,
|
|||||||
static int _check_instance_id(const char *str);
|
static int _check_instance_id(const char *str);
|
||||||
|
|
||||||
static void _features(void);
|
static void _features(void);
|
||||||
static void _help(FILE *fp, us_device_s *dev, us_encoder_s *enc, us_stream_s *stream, us_server_s *server);
|
static void _help(FILE *fp, const us_device_s *dev, const us_encoder_s *enc, const us_stream_s *stream, const us_server_s *server);
|
||||||
|
|
||||||
|
|
||||||
us_options_s *us_options_init(unsigned argc, char *argv[]) {
|
us_options_s *us_options_init(unsigned argc, char *argv[]) {
|
||||||
@@ -586,7 +586,7 @@ static void _features(void) {
|
|||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _help(FILE *fp, us_device_s *dev, us_encoder_s *enc, us_stream_s *stream, us_server_s *server) {
|
static void _help(FILE *fp, const us_device_s *dev, const us_encoder_s *enc, const us_stream_s *stream, const us_server_s *server) {
|
||||||
# define SAY(x_msg, ...) fprintf(fp, x_msg "\n", ##__VA_ARGS__)
|
# define SAY(x_msg, ...) fprintf(fp, x_msg "\n", ##__VA_ARGS__)
|
||||||
SAY("\nuStreamer - Lightweight and fast MJPEG-HTTP streamer");
|
SAY("\nuStreamer - Lightweight and fast MJPEG-HTTP streamer");
|
||||||
SAY("═══════════════════════════════════════════════════");
|
SAY("═══════════════════════════════════════════════════");
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void us_workers_pool_assign(us_workers_pool_s *pool, us_worker_s *ready_wr/*, vo
|
|||||||
US_MUTEX_UNLOCK(pool->free_workers_mutex);
|
US_MUTEX_UNLOCK(pool->free_workers_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
long double us_workers_pool_get_fluency_delay(us_workers_pool_s *pool, us_worker_s *ready_wr) {
|
long double us_workers_pool_get_fluency_delay(us_workers_pool_s *pool, const us_worker_s *ready_wr) {
|
||||||
const long double approx_job_time = pool->approx_job_time * 0.9 + ready_wr->last_job_time * 0.1;
|
const long double approx_job_time = pool->approx_job_time * 0.9 + ready_wr->last_job_time * 0.1;
|
||||||
|
|
||||||
US_LOG_VERBOSE("Correcting pool's %s approx_job_time: %.3Lf -> %.3Lf (last_job_time=%.3Lf)",
|
US_LOG_VERBOSE("Correcting pool's %s approx_job_time: %.3Lf -> %.3Lf (last_job_time=%.3Lf)",
|
||||||
|
|||||||
@@ -92,4 +92,4 @@ void us_workers_pool_destroy(us_workers_pool_s *pool);
|
|||||||
us_worker_s *us_workers_pool_wait(us_workers_pool_s *pool);
|
us_worker_s *us_workers_pool_wait(us_workers_pool_s *pool);
|
||||||
void us_workers_pool_assign(us_workers_pool_s *pool, us_worker_s *ready_wr/*, void *job*/);
|
void us_workers_pool_assign(us_workers_pool_s *pool, us_worker_s *ready_wr/*, void *job*/);
|
||||||
|
|
||||||
long double us_workers_pool_get_fluency_delay(us_workers_pool_s *pool, us_worker_s *ready_wr);
|
long double us_workers_pool_get_fluency_delay(us_workers_pool_s *pool, const us_worker_s *ready_wr);
|
||||||
|
|||||||
Reference in New Issue
Block a user