summaryrefslogtreecommitdiff
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
parent32b6f82fb55b7f9ce1cd8a9e2e8ebdc3a7ac746c (diff)
Code formatting fixes
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
-rw-r--r--kms++/src/videomode.cpp8
-rw-r--r--kms++util/inc/kms++util/endian.h18
-rw-r--r--kms++util/src/color.cpp3
-rw-r--r--kms++util/src/drawing.cpp14
-rw-r--r--py/pykms/pykmsbase.cpp44
-rw-r--r--py/pyv4l2/pyv4l2.cpp11
-rw-r--r--utils/omap-wbcap.cpp6
-rw-r--r--utils/omap-wbm2m.cpp8
-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
14 files changed, 79 insertions, 85 deletions
diff --git a/kms++/src/videomode.cpp b/kms++/src/videomode.cpp
index 0e5acf6..4be6de7 100644
--- a/kms++/src/videomode.cpp
+++ b/kms++/src/videomode.cpp
@@ -173,9 +173,10 @@ static const map<int, string> mode_aspect_map = {
{ DRM_MODE_FLAG_PIC_AR_256_135, "256:135" },
};
-static string mode_type_str(uint32_t val) {
+static string mode_type_str(uint32_t val)
+{
vector<string> s;
- for (const auto & [k, v] : mode_type_map) {
+ for (const auto& [k, v] : mode_type_map) {
if (val & k) {
if (!v.empty())
s.push_back(v);
@@ -188,7 +189,8 @@ static string mode_type_str(uint32_t val) {
return join(s, "|");
}
-static string mode_flag_str(uint32_t val) {
+static string mode_flag_str(uint32_t val)
+{
vector<string> s;
for (const auto& [k, v] : mode_flag_map) {
if (val & k) {
diff --git a/kms++util/inc/kms++util/endian.h b/kms++util/inc/kms++util/endian.h
index 0f7aecd..e77b3bd 100644
--- a/kms++util/inc/kms++util/endian.h
+++ b/kms++util/inc/kms++util/endian.h
@@ -5,7 +5,7 @@
#include <stdint.h>
static_assert((__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) ||
- (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__),
+ (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__),
"Unable to detect endianness");
enum class endian {
@@ -19,14 +19,17 @@ constexpr T byteswap(T value) noexcept
{
static_assert(std::is_integral<T>(), "Type is not integral");
static_assert(sizeof(T) == 2 ||
- sizeof(T) == 4 ||
- sizeof(T) == 8,
+ sizeof(T) == 4 ||
+ sizeof(T) == 8,
"Illegal value size");
switch (sizeof(T)) {
- case 2: return bswap_16(value);
- case 4: return bswap_32(value);
- case 8: return bswap_64(value);
+ case 2:
+ return bswap_16(value);
+ case 4:
+ return bswap_32(value);
+ case 8:
+ return bswap_64(value);
}
}
@@ -39,8 +42,7 @@ static void write_endian(T* dst, T val)
*dst = val;
}
-[[maybe_unused]]
-static void write16le(uint16_t* dst, uint16_t val)
+[[maybe_unused]] static void write16le(uint16_t* dst, uint16_t val)
{
write_endian<endian::little, uint16_t>(dst, val);
}
diff --git a/kms++util/src/color.cpp b/kms++util/src/color.cpp
index 74ff8c9..c761e40 100644
--- a/kms++util/src/color.cpp
+++ b/kms++util/src/color.cpp
@@ -114,7 +114,8 @@ YUV RGB::yuv(YUVType type) const
{ \
((int)((a)*CF_ONE)), ((int)((b)*CF_ONE)), ((int)((c)*CF_ONE)) \
}
-#define CLAMP(a) ((a) > (CF_ONE - 1) ? (CF_ONE - 1) : (a) < 0 ? 0 : (a))
+#define CLAMP(a) ((a) > (CF_ONE - 1) ? (CF_ONE - 1) : (a) < 0 ? 0 \
+ : (a))
const int YUVcoef[static_cast<unsigned>(YUVType::MAX)][3][3] = {
[static_cast<unsigned>(YUVType::BT601_Lim)] = {
diff --git a/kms++util/src/drawing.cpp b/kms++util/src/drawing.cpp
index 2631f14..862638b 100644
--- a/kms++util/src/drawing.cpp
+++ b/kms++util/src/drawing.cpp
@@ -181,7 +181,7 @@ static void draw_yuv422_packed_macropixel(IFramebuffer& buf, unsigned x, unsigne
}
static void draw_y2xx_packed_macropixel(IFramebuffer& buf, unsigned x, unsigned y,
- YUV yuv1, YUV yuv2)
+ YUV yuv1, YUV yuv2)
{
const uint32_t macro_size = 4;
uint16_t* p = (uint16_t*)(buf.map(0) + buf.stride(0) * y + x * macro_size);
@@ -191,8 +191,8 @@ static void draw_y2xx_packed_macropixel(IFramebuffer& buf, unsigned x, unsigned
// XXX naive expansion to 10 bits, similar to 10-bit funcs in class RGB
uint16_t y0 = yuv1.y << 2;
uint16_t y1 = yuv2.y << 2;
- uint16_t cb = ((yuv1.u << 2) + (yuv2.u << 2)) / 2;
- uint16_t cr = ((yuv1.v << 2) + (yuv2.v << 2)) / 2;
+ uint16_t cb = ((yuv1.u << 2) + (yuv2.u << 2)) / 2;
+ uint16_t cr = ((yuv1.v << 2) + (yuv2.v << 2)) / 2;
// The 10 bits occupy the msb, so we shift left by 16-10 = 6
write16le(&p[0], y0 << 6);
@@ -206,8 +206,8 @@ static void draw_y2xx_packed_macropixel(IFramebuffer& buf, unsigned x, unsigned
// XXX naive expansion to 12 bits
uint16_t y0 = yuv1.y << 4;
uint16_t y1 = yuv2.y << 4;
- uint16_t cb = ((yuv1.u << 4) + (yuv2.u << 4)) / 2;
- uint16_t cr = ((yuv1.v << 4) + (yuv2.v << 4)) / 2;
+ uint16_t cb = ((yuv1.u << 4) + (yuv2.u << 4)) / 2;
+ uint16_t cr = ((yuv1.v << 4) + (yuv2.v << 4)) / 2;
// The 10 bits occupy the msb, so we shift left by 16-12 = 4
write16le(&p[0], y0 << 4);
@@ -221,8 +221,8 @@ static void draw_y2xx_packed_macropixel(IFramebuffer& buf, unsigned x, unsigned
// XXX naive expansion to 16 bits
uint16_t y0 = yuv1.y << 8;
uint16_t y1 = yuv2.y << 8;
- uint16_t cb = ((yuv1.u << 8) + (yuv2.u << 8)) / 2;
- uint16_t cr = ((yuv1.v << 8) + (yuv2.v << 8)) / 2;
+ uint16_t cb = ((yuv1.u << 8) + (yuv2.u << 8)) / 2;
+ uint16_t cr = ((yuv1.v << 8) + (yuv2.v << 8)) / 2;
write16le(&p[0], y0);
write16le(&p[1], cb);
diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp
index 79ddbf6..7484770 100644
--- a/py/pykms/pykmsbase.cpp
+++ b/py/pykms/pykmsbase.cpp
@@ -65,7 +65,7 @@ void init_pykmsbase(py::module& m)
.def("refresh_props", &DrmPropObject::refresh_props)
.def_property_readonly("prop_map", &DrmPropObject::get_prop_map)
.def("get_prop_value", (uint64_t(DrmPropObject::*)(const string&) const) & DrmPropObject::get_prop_value)
- .def("set_prop_value", (int (DrmPropObject::*)(const string&, uint64_t)) & DrmPropObject::set_prop_value)
+ .def("set_prop_value", (int(DrmPropObject::*)(const string&, uint64_t)) & DrmPropObject::set_prop_value)
.def("get_prop_value_as_blob", &DrmPropObject::get_prop_value_as_blob)
.def("get_prop", &DrmPropObject::get_prop)
.def("has_prop", &DrmPropObject::has_prop);
@@ -85,8 +85,8 @@ void init_pykmsbase(py::module& m)
.def("refresh", &Connector::refresh);
py::class_<Crtc, DrmPropObject, unique_ptr<Crtc, py::nodelete>>(m, "Crtc")
- .def("set_mode", (int (Crtc::*)(Connector*, const Videomode&)) & Crtc::set_mode)
- .def("set_mode", (int (Crtc::*)(Connector*, Framebuffer&, const Videomode&)) & Crtc::set_mode)
+ .def("set_mode", (int(Crtc::*)(Connector*, const Videomode&)) & Crtc::set_mode)
+ .def("set_mode", (int(Crtc::*)(Connector*, Framebuffer&, const Videomode&)) & Crtc::set_mode)
.def("disable_mode", &Crtc::disable_mode)
.def(
"page_flip",
@@ -123,8 +123,7 @@ void init_pykmsbase(py::module& m)
.def_property_readonly("type", &Property::type)
.def_property_readonly("enums", &Property::get_enums)
.def_property_readonly("values", &Property::get_values)
- .def("__repr__", [](const Property& o) { return "<pykms.Property " + to_string(o.id()) + " '" + o.name() + "'>"; })
- ;
+ .def("__repr__", [](const Property& o) { return "<pykms.Property " + to_string(o.id()) + " '" + o.name() + "'>"; });
py::enum_<PropertyType>(m, "PropertyType")
.value("Range", PropertyType::Range)
@@ -132,8 +131,7 @@ void init_pykmsbase(py::module& m)
.value("Blob", PropertyType::Blob)
.value("Bitmask", PropertyType::Bitmask)
.value("Object", PropertyType::Object)
- .value("SignedRange", PropertyType::SignedRange)
- ;
+ .value("SignedRange", PropertyType::SignedRange);
py::class_<Blob>(m, "Blob")
.def(py::init([](Card& card, py::buffer buf) {
@@ -165,8 +163,8 @@ void init_pykmsbase(py::module& m)
.def("offset", &Framebuffer::offset)
.def("fd", &Framebuffer::prime_fd)
- .def("flush", (void (Framebuffer::*)(void)) & Framebuffer::flush)
- .def("flush", (void (Framebuffer::*)(uint32_t x, uint32_t y, uint32_t width, uint32_t height)) & Framebuffer::flush)
+ .def("flush", (void(Framebuffer::*)(void)) & Framebuffer::flush)
+ .def("flush", (void(Framebuffer::*)(uint32_t x, uint32_t y, uint32_t width, uint32_t height)) & Framebuffer::flush)
// XXX pybind11 doesn't support a base object (DrmObject) with custom holder-type,
// and a subclass with standard holder-type.
@@ -181,16 +179,14 @@ void init_pykmsbase(py::module& m)
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
.def(py::init<Card&, uint32_t, uint32_t, PixelFormat>(),
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
- .def("__repr__", [](const DumbFramebuffer& o) { return "<pykms.DumbFramebuffer " + to_string(o.id()) + ">"; })
- ;
+ .def("__repr__", [](const DumbFramebuffer& o) { return "<pykms.DumbFramebuffer " + to_string(o.id()) + ">"; });
py::class_<DmabufFramebuffer, Framebuffer>(m, "DmabufFramebuffer")
.def(py::init<Card&, uint32_t, uint32_t, const string&, vector<int>, vector<uint32_t>, vector<uint32_t>>(),
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
.def(py::init<Card&, uint32_t, uint32_t, PixelFormat, vector<int>, vector<uint32_t>, vector<uint32_t>>(),
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
- .def("__repr__", [](const DmabufFramebuffer& o) { return "<pykms.DmabufFramebuffer " + to_string(o.id()) + ">"; })
- ;
+ .def("__repr__", [](const DmabufFramebuffer& o) { return "<pykms.DmabufFramebuffer " + to_string(o.id()) + ">"; });
py::enum_<PixelFormat>(m, "PixelFormat")
.value("Undefined", PixelFormat::Undefined)
@@ -291,9 +287,9 @@ void init_pykmsbase(py::module& m)
py::class_<AtomicReq>(m, "AtomicReq")
.def(py::init<Card&>(),
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
- .def("add", (void (AtomicReq::*)(DrmPropObject*, const string&, uint64_t)) & AtomicReq::add)
- .def("add", (void (AtomicReq::*)(DrmPropObject*, Property*, uint64_t)) & AtomicReq::add)
- .def("add", (void (AtomicReq::*)(DrmPropObject*, const map<string, uint64_t>&)) & AtomicReq::add)
+ .def("add", (void(AtomicReq::*)(DrmPropObject*, const string&, uint64_t)) & AtomicReq::add)
+ .def("add", (void(AtomicReq::*)(DrmPropObject*, Property*, uint64_t)) & AtomicReq::add)
+ .def("add", (void(AtomicReq::*)(DrmPropObject*, const map<string, uint64_t>&)) & AtomicReq::add)
.def("test", &AtomicReq::test, py::arg("allow_modeset") = false)
.def(
"commit",
@@ -306,17 +302,17 @@ void init_pykmsbase(py::module& m)
py::class_<PixelFormatPlaneInfo>(m, "PixelFormatPlaneInfo")
.def_readonly("bitspp", &PixelFormatPlaneInfo::bitspp)
.def_readonly("xsub", &PixelFormatPlaneInfo::xsub)
- .def_readonly("ysub", &PixelFormatPlaneInfo::ysub)
- ;
+ .def_readonly("ysub", &PixelFormatPlaneInfo::ysub);
py::class_<PixelFormatInfo>(m, "PixelFormatInfo")
.def_readonly("num_planes", &PixelFormatInfo::num_planes)
- .def("plane", [](const PixelFormatInfo& self, uint32_t idx) {
- if (idx >= self.num_planes)
- throw runtime_error("invalid plane number");
- return self.planes[idx];
- }, py::return_value_policy::reference_internal)
- ;
+ .def(
+ "plane", [](const PixelFormatInfo& self, uint32_t idx) {
+ if (idx >= self.num_planes)
+ throw runtime_error("invalid plane number");
+ return self.planes[idx];
+ },
+ py::return_value_policy::reference_internal);
m.def("get_pixel_format_info", &get_pixel_format_info,
py::return_value_policy::reference_internal);
diff --git a/py/pyv4l2/pyv4l2.cpp b/py/pyv4l2/pyv4l2.cpp
index 33d5f26..b88ab5e 100644
--- a/py/pyv4l2/pyv4l2.cpp
+++ b/py/pyv4l2/pyv4l2.cpp
@@ -25,18 +25,17 @@ PYBIND11_MODULE(pyv4l2, m)
py::enum_<VideoMemoryType>(m, "VideoMemoryType")
.value("MMAP", VideoMemoryType::MMAP)
- .value("DMABUF", VideoMemoryType::DMABUF)
- ;
+ .value("DMABUF", VideoMemoryType::DMABUF);
m.def("create_dmabuffer", [](int fd) {
- VideoBuffer buf {};
+ VideoBuffer buf{};
buf.m_mem_type = VideoMemoryType::DMABUF;
buf.m_fd = fd;
return buf;
});
m.def("create_mmapbuffer", []() {
- VideoBuffer buf {};
+ VideoBuffer buf{};
buf.m_mem_type = VideoMemoryType::MMAP;
return buf;
});
@@ -45,8 +44,7 @@ PYBIND11_MODULE(pyv4l2, m)
.def_readonly("index", &VideoBuffer::m_index)
.def_readonly("offset", &VideoBuffer::m_offset)
.def_readonly("fd", &VideoBuffer::m_fd)
- .def_readonly("length", &VideoBuffer::m_length)
- ;
+ .def_readonly("length", &VideoBuffer::m_length);
py::class_<VideoStreamer>(m, "VideoStreamer")
.def_property_readonly("fd", &VideoStreamer::fd)
@@ -113,7 +111,6 @@ PYBIND11_MODULE(pyv4l2, m)
.value("META_8", PixelFormat::META_8)
.value("META_16", PixelFormat::META_16);
-
m.def("fourcc_to_pixelformat", &FourCCToPixelFormat);
m.def("pixelformat_to_fourcc", &PixelFormatToFourCC);
m.def("drm_fourcc_to_pixelformat", &DRMFourCCToPixelFormat);
diff --git a/utils/omap-wbcap.cpp b/utils/omap-wbcap.cpp
index 5080159..fc004cc 100644
--- a/utils/omap-wbcap.cpp
+++ b/utils/omap-wbcap.cpp
@@ -31,7 +31,7 @@ public:
m_capdev.set_queue_size(s_fbs.size(), v4l2::VideoMemoryType::DMABUF);
for (auto fb : s_free_fbs) {
- v4l2::VideoBuffer vbuf {};
+ v4l2::VideoBuffer vbuf{};
vbuf.m_mem_type = v4l2::VideoMemoryType::DMABUF;
vbuf.m_fd = fb->prime_fd(0);
@@ -65,7 +65,7 @@ public:
{
auto vbuf = m_capdev.dequeue();
- auto iter = find_if(s_wb_fbs.begin(), s_wb_fbs.end(), [fd=vbuf.m_fd](auto& fb) { return fb->prime_fd(0) == fd; });
+ auto iter = find_if(s_wb_fbs.begin(), s_wb_fbs.end(), [fd = vbuf.m_fd](auto& fb) { return fb->prime_fd(0) == fd; });
auto fb = *iter;
s_wb_fbs.erase(iter);
@@ -82,7 +82,7 @@ public:
auto fb = s_free_fbs.back();
s_free_fbs.pop_back();
- v4l2::VideoBuffer vbuf {};
+ v4l2::VideoBuffer vbuf{};
vbuf.m_mem_type = v4l2::VideoMemoryType::DMABUF;
vbuf.m_fd = fb->prime_fd(0);
diff --git a/utils/omap-wbm2m.cpp b/utils/omap-wbm2m.cpp
index 6ac08e0..7dcae2e 100644
--- a/utils/omap-wbm2m.cpp
+++ b/utils/omap-wbm2m.cpp
@@ -136,7 +136,7 @@ int main(int argc, char** argv)
out_fbs.push_back(fb);
- v4l2::VideoBuffer vbuf {};
+ v4l2::VideoBuffer vbuf{};
vbuf.m_mem_type = v4l2::VideoMemoryType::DMABUF;
vbuf.m_fd = fb->prime_fd(0);
@@ -150,7 +150,7 @@ int main(int argc, char** argv)
in_fbs.push_back(fb);
- v4l2::VideoBuffer vbuf {};
+ v4l2::VideoBuffer vbuf{};
vbuf.m_mem_type = v4l2::VideoMemoryType::DMABUF;
vbuf.m_fd = fb->prime_fd(0);
@@ -184,7 +184,7 @@ int main(int argc, char** argv)
try {
auto dst_vbuf = in->dequeue();
- auto dst_fb = *find_if(in_fbs.begin(), in_fbs.end(), [fd=dst_vbuf.m_fd](auto& fb) { return fb->prime_fd(0) == fd; });
+ auto dst_fb = *find_if(in_fbs.begin(), in_fbs.end(), [fd = dst_vbuf.m_fd](auto& fb) { return fb->prime_fd(0) == fd; });
printf("Writing frame %u\n", dst_frame_num);
for (unsigned i = 0; i < dst_fb->num_planes(); ++i)
@@ -205,7 +205,7 @@ int main(int argc, char** argv)
auto src_vbuf = out->dequeue();
- auto src_fb = *find_if(out_fbs.begin(), out_fbs.end(), [fd=src_vbuf.m_fd](auto& fb) { return fb->prime_fd(0) == fd; });
+ auto src_fb = *find_if(out_fbs.begin(), out_fbs.end(), [fd = src_vbuf.m_fd](auto& fb) { return fb->prime_fd(0) == fd; });
if (src_frame_num < num_src_frames) {
read_frame(src_fb, src_frame_num++);
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);