From ec470480e6fb2c23c97605c53e344421abe0647d Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sun, 23 Sep 2018 02:12:37 +0300 Subject: [PATCH] refactoring --- src/device.c | 5 +++-- src/device.h | 1 + src/http.c | 1 + src/http.h | 1 + src/jpeg.c | 2 ++ src/jpeg.h | 1 + src/logging.h | 3 ++- src/main.c | 5 +++-- src/stream.c | 4 +++- src/stream.h | 1 + 10 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/device.c b/src/device.c index 1517fc4..d60b001 100644 --- a/src/device.c +++ b/src/device.c @@ -26,6 +26,7 @@ #include #include #include + #include #include #include @@ -42,7 +43,7 @@ static const struct { {"UNKNOWN", V4L2_STD_UNKNOWN}, {"PAL", V4L2_STD_PAL}, {"NTSC", V4L2_STD_NTSC}, - {"SECAM", V4L2_STD_SECAM} + {"SECAM", V4L2_STD_SECAM}, }; static const struct { @@ -51,7 +52,7 @@ static const struct { } FORMATS[] = { {"YUYV", V4L2_PIX_FMT_YUYV}, {"UYVY", V4L2_PIX_FMT_UYVY}, - {"RGB565", V4L2_PIX_FMT_RGB565} + {"RGB565", V4L2_PIX_FMT_RGB565}, }; diff --git a/src/device.h b/src/device.h index ee9d96a..86e4777 100644 --- a/src/device.h +++ b/src/device.h @@ -24,6 +24,7 @@ #include #include #include + #include diff --git a/src/http.c b/src/http.c index dcac89f..033bd6e 100644 --- a/src/http.c +++ b/src/http.c @@ -24,6 +24,7 @@ #include #include #include + #include #include #include diff --git a/src/http.h b/src/http.h index 390e81b..90a8b16 100644 --- a/src/http.h +++ b/src/http.h @@ -21,6 +21,7 @@ #include #include + #include #include diff --git a/src/jpeg.c b/src/jpeg.c index cb916d1..ee69cd2 100644 --- a/src/jpeg.c +++ b/src/jpeg.c @@ -28,6 +28,7 @@ #include #include #include + #include #include @@ -94,6 +95,7 @@ void jpeg_compress_buffer(struct device_t *dev, int index) { # define WRITE_SCANLINES(_func) \ _func(&jpeg, line_buffer, dev->run->hw_buffers[index].start, dev->run->width, dev->run->height) switch (dev->run->format) { + // https://www.fourcc.org/yuv.php case V4L2_PIX_FMT_YUYV: WRITE_SCANLINES(_jpeg_write_scanlines_yuyv); break; case V4L2_PIX_FMT_UYVY: WRITE_SCANLINES(_jpeg_write_scanlines_uyvy); break; case V4L2_PIX_FMT_RGB565: WRITE_SCANLINES(_jpeg_write_scanlines_rgb565); break; diff --git a/src/jpeg.h b/src/jpeg.h index 6f65504..1440e53 100644 --- a/src/jpeg.h +++ b/src/jpeg.h @@ -23,6 +23,7 @@ #include #include + #include "device.h" diff --git a/src/logging.h b/src/logging.h index 66deff9..4f9966b 100644 --- a/src/logging.h +++ b/src/logging.h @@ -25,10 +25,11 @@ #include #include #include -#include #include #include +#include + #include "tools.h" diff --git a/src/main.c b/src/main.c index 2ce5418..7ba6525 100644 --- a/src/main.c +++ b/src/main.c @@ -28,9 +28,10 @@ #include #include #include -#include #include +#include + #include "tools.h" #include "logging.h" #include "device.h" @@ -61,7 +62,7 @@ static const struct option _long_opts[] = { {"debug", no_argument, NULL, 5000}, {"log-level", required_argument, NULL, 5001}, {"help", no_argument, NULL, 'h'}, - {NULL, 0, NULL, 0} + {NULL, 0, NULL, 0}, }; static void _help(struct device_t *dev, struct http_server_t *server) { diff --git a/src/stream.c b/src/stream.c index abe2b1a..dc71694 100644 --- a/src/stream.c +++ b/src/stream.c @@ -21,9 +21,11 @@ #include #include -#include #include #include + +#include + #include #include diff --git a/src/stream.h b/src/stream.h index 8d8c076..a89908a 100644 --- a/src/stream.h +++ b/src/stream.h @@ -23,6 +23,7 @@ #include #include + #include #include "device.h"