mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-05-26 23:36:16 +00:00
inline emax_u()
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
|
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
@@ -58,7 +57,7 @@ void device_init(struct device_t *dev, struct device_runtime_t *run) {
|
|||||||
dev->height = 480;
|
dev->height = 480;
|
||||||
dev->format = V4L2_PIX_FMT_YUYV;
|
dev->format = V4L2_PIX_FMT_YUYV;
|
||||||
dev->standard = V4L2_STD_UNKNOWN;
|
dev->standard = V4L2_STD_UNKNOWN;
|
||||||
dev->n_buffers = MAX(sysconf(_SC_NPROCESSORS_ONLN), 1) + 1;
|
dev->n_buffers = max_u(sysconf(_SC_NPROCESSORS_ONLN), 1) + 1;
|
||||||
dev->jpeg_quality = 80;
|
dev->jpeg_quality = 80;
|
||||||
dev->timeout = 1;
|
dev->timeout = 1;
|
||||||
dev->error_timeout = 1;
|
dev->error_timeout = 1;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ unsigned log_level;
|
|||||||
#define XIOCTL_RETRIES 4
|
#define XIOCTL_RETRIES 4
|
||||||
|
|
||||||
|
|
||||||
|
INLINE unsigned max_u(unsigned a, unsigned b) {
|
||||||
|
return (a > b ? a : b);
|
||||||
|
}
|
||||||
|
|
||||||
INLINE void now_ms(time_t *sec, long *msec) {
|
INLINE void now_ms(time_t *sec, long *msec) {
|
||||||
struct timespec spec;
|
struct timespec spec;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user