libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
v4l2rawformat.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_V4L2
13#include <cstdint>
14#include <promeki/namespace.h>
15#include <promeki/list.h>
16#include <promeki/pixelformat.h>
18
19PROMEKI_NAMESPACE_BEGIN
20
21class UncompressedVideoPayload;
22
41struct V4l2RawFormat {
42 uint32_t fourcc = 0;
43 PixelFormat::ID pixelFormatId = PixelFormat::Invalid;
44 uint8_t bytesPerSample = 1;
45 uint8_t shift = 0;
46 uint8_t chromaVDiv = 2;
47 const char *name = "";
48
49 bool isValid() const { return fourcc != 0; }
50};
51
53const V4l2RawFormat *v4l2RawFormatForPixelFormat(PixelFormat::ID id);
54
56const V4l2RawFormat *v4l2RawFormatForFourcc(uint32_t fourcc);
57
59List<int> v4l2SupportedRawPixelFormats();
60
73void v4l2PackSemiPlanar(const UncompressedVideoPayload &src, const V4l2RawFormat &fmt,
74 const List<V4l2M2mCodec::OutPlane> &dst, List<size_t> &bytesused);
75
86void v4l2UnpackSemiPlanar(const List<V4l2M2mCodec::CapturePlane> &src, const V4l2RawFormat &fmt,
87 UncompressedVideoPayload *dst);
88
89PROMEKI_NAMESPACE_END
90
91#endif // PROMEKI_ENABLE_V4L2