summaryrefslogtreecommitdiff
path: root/v4l2++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-12-22 12:04:50 +0200
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-12-22 12:04:50 +0200
commit2bd85abc108e0688384f42b0ec83dcd5a622d50d (patch)
tree903a9f221a2dc71435b52ace7c815f68217509f3 /v4l2++
parent32b6f82fb55b7f9ce1cd8a9e2e8ebdc3a7ac746c (diff)
Code formatting fixes
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'v4l2++')
-rw-r--r--v4l2++/inc/v4l2++/helpers.h4
-rw-r--r--v4l2++/inc/v4l2++/pixelformats.h2
-rw-r--r--v4l2++/inc/v4l2++/videodevice.h10
-rw-r--r--v4l2++/src/helpers.cpp2
-rw-r--r--v4l2++/src/pixelformats.cpp24
-rw-r--r--v4l2++/src/videodevice.cpp10
6 files changed, 24 insertions, 28 deletions
diff --git a/v4l2++/inc/v4l2++/helpers.h b/v4l2++/inc/v4l2++/helpers.h
index b5c3284..f672b10 100644
--- a/v4l2++/inc/v4l2++/helpers.h
+++ b/v4l2++/inc/v4l2++/helpers.h
@@ -26,9 +26,9 @@
} while (0)
#define FAIL_IF(x, format, ...) \
- if (unlikely(x)) { \
+ if (unlikely(x)) { \
fprintf(stderr, "%s:%d: %s:\n" format "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
- abort(); \
+ abort(); \
}
#define EXIT(fmt, ...) \
diff --git a/v4l2++/inc/v4l2++/pixelformats.h b/v4l2++/inc/v4l2++/pixelformats.h
index 777d0ec..d5af2c2 100644
--- a/v4l2++/inc/v4l2++/pixelformats.h
+++ b/v4l2++/inc/v4l2++/pixelformats.h
@@ -110,4 +110,4 @@ struct PixelFormatInfo {
const struct PixelFormatInfo& get_pixel_format_info(PixelFormat format);
-} // namespace kms
+} // namespace v4l2
diff --git a/v4l2++/inc/v4l2++/videodevice.h b/v4l2++/inc/v4l2++/videodevice.h
index 9016a7f..4ceafa3 100644
--- a/v4l2++/inc/v4l2++/videodevice.h
+++ b/v4l2++/inc/v4l2++/videodevice.h
@@ -11,8 +11,7 @@ namespace v4l2
class VideoStreamer;
class MetaStreamer;
-enum class VideoMemoryType
-{
+enum class VideoMemoryType {
MMAP,
DMABUF,
};
@@ -87,10 +86,10 @@ public:
OutputMulti,
CaptureMeta,
OutputMeta,
- };
+ };
VideoStreamer(int fd, StreamerType type);
- virtual ~VideoStreamer() { }
+ virtual ~VideoStreamer() {}
std::vector<std::string> get_ports();
void set_port(uint32_t index);
@@ -117,7 +116,6 @@ protected:
std::vector<bool> m_fbs;
};
-
class MetaStreamer : public VideoStreamer
{
public:
@@ -126,4 +124,4 @@ public:
void set_format(PixelFormat fmt, uint32_t size);
};
-}
+} // namespace v4l2
diff --git a/v4l2++/src/helpers.cpp b/v4l2++/src/helpers.cpp
index db80408..d24c4f8 100644
--- a/v4l2++/src/helpers.cpp
+++ b/v4l2++/src/helpers.cpp
@@ -1,6 +1,6 @@
#include <v4l2++/helpers.h>
-void __my_throw(const char* file, int line, const char *funcname, const char *cond, fmt::string_view format, fmt::format_args args)
+void __my_throw(const char* file, int line, const char* funcname, const char* cond, fmt::string_view format, fmt::format_args args)
{
std::string str = fmt::vformat(format, args);
diff --git a/v4l2++/src/pixelformats.cpp b/v4l2++/src/pixelformats.cpp
index b7ecc7b..f892c97 100644
--- a/v4l2++/src/pixelformats.cpp
+++ b/v4l2++/src/pixelformats.cpp
@@ -270,24 +270,24 @@ static const map<PixelFormat, PixelFormatInfo> format_info_array = {
} },
{ PixelFormat::SBGGR12, {
PixelColorType::RAW,
- 1,
- { { 16, 1, 1 } },
- } },
+ 1,
+ { { 16, 1, 1 } },
+ } },
{ PixelFormat::SRGGB12, {
PixelColorType::RAW,
1,
{ { 16, 1, 1 } },
- } },
+ } },
{ PixelFormat::META_8, {
+ PixelColorType::RGB,
+ 1,
+ { { 8, 1, 1 } },
+ } },
+ { PixelFormat::META_16, {
PixelColorType::RGB,
1,
- { { 8, 1, 1 } },
- } },
- { PixelFormat::META_16, {
- PixelColorType::RGB,
- 1,
- { { 16, 1, 1 } },
- } },
+ { { 16, 1, 1 } },
+ } },
};
PixelFormat DRMFourCCToPixelFormat(const std::string& fourcc)
@@ -311,4 +311,4 @@ const struct PixelFormatInfo& get_pixel_format_info(PixelFormat format)
return format_info_array.at(format);
}
-}
+} // namespace v4l2
diff --git a/v4l2++/src/videodevice.cpp b/v4l2++/src/videodevice.cpp
index c25e9be..909cb1b 100644
--- a/v4l2++/src/videodevice.cpp
+++ b/v4l2++/src/videodevice.cpp
@@ -551,7 +551,7 @@ std::vector<PixelFormat> VideoStreamer::get_formats()
return v4l2_get_formats(m_fd, get_buf_type(m_type));
}
-int VideoStreamer::get_format(PixelFormat &fmt, uint32_t &width, uint32_t &height)
+int VideoStreamer::get_format(PixelFormat& fmt, uint32_t& width, uint32_t& height)
{
return v4l2_get_format(m_fd, get_buf_type(m_type), fmt, width, height);
}
@@ -580,7 +580,7 @@ void VideoStreamer::set_queue_size(uint32_t queue_size, VideoMemoryType mem_type
m_fbs.resize(queue_size);
}
-void VideoStreamer::queue(VideoBuffer &fb)
+void VideoStreamer::queue(VideoBuffer& fb)
{
uint32_t idx;
@@ -600,7 +600,7 @@ void VideoStreamer::queue(VideoBuffer &fb)
VideoBuffer VideoStreamer::dequeue()
{
- VideoBuffer fb {};
+ VideoBuffer fb{};
fb.m_mem_type = m_mem_type;
uint32_t idx = v4l2_dequeue(m_fd, fb, get_buf_type(m_type));
@@ -637,8 +637,6 @@ int VideoStreamer::export_buffer(uint32_t index)
return expbuf.fd;
}
-
-
MetaStreamer::MetaStreamer(int fd, StreamerType type)
: VideoStreamer(fd, type)
{
@@ -648,7 +646,7 @@ void MetaStreamer::set_format(PixelFormat fmt, uint32_t size)
{
int r;
- v4l2_format v4lfmt {};
+ v4l2_format v4lfmt{};
v4lfmt.type = get_buf_type(m_type);
//r = ioctl(m_fd, VIDIOC_G_FMT, &v4lfmt);