123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- #ifndef EASYCODEC_VFORMAT_H_
- #define EASYCODEC_VFORMAT_H_
- #include <cstdint>
- #define CN_MAXIMUM_PLANE 3
- namespace edk {
- struct Geometry {
- unsigned int w;
- unsigned int h;
- };
- enum class PixelFmt {
- NV12 = 0,
- NV21,
- I420,
- YV12,
- YUYV,
- UYVY,
- YVYU,
- VYUY,
- P010,
- YUV420_10BIT,
- YUV444_10BIT,
- ARGB,
- ABGR,
- BGRA,
- RGBA,
- AYUV,
- RGB565,
- RAW,
- TOTAL_COUNT
- };
- enum class CodecType {
- MPEG2 = 0,
- MPEG4,
- H264,
- H265,
- VP8,
- VP9,
- AVS,
- MJPEG,
- JPEG
- };
- enum class ColorStd {
- ITU_BT_709 = 0,
- ITU_BT_601,
- ITU_BT_2020,
- ITU_BT_601_ER,
- ITU_BT_709_ER,
- COLOR_STANDARD_INVALID,
- };
- struct CnFrame {
-
- uint64_t buf_id{0};
-
- uint64_t pts{0};
-
- uint32_t height{0};
-
- uint32_t width{0};
-
- uint64_t frame_size{0};
-
- PixelFmt pformat{PixelFmt::NV12};
-
- ColorStd color_std{ColorStd::ITU_BT_709};
-
- int device_id{0};
-
- int channel_id{0};
-
- bool cpu_decode{false};
-
- uint32_t n_planes{0};
-
- uint32_t strides[CN_MAXIMUM_PLANE]{0, 0, 0};
-
- void* ptrs[CN_MAXIMUM_PLANE]{nullptr, nullptr, nullptr};
- };
- enum class BitStreamSliceType { SPS_PPS, FRAME };
- struct CnPacket {
-
- uint64_t buf_id{0};
-
- void* data{nullptr};
-
- uint64_t length{0};
-
- uint64_t pts{0};
-
- CodecType codec_type{CodecType::H264};
-
- BitStreamSliceType slice_type{BitStreamSliceType::FRAME};
- };
- }
- #endif
|