40 lines
740 B
C++
40 lines
740 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace rk3588 {
|
|
|
|
enum class VideoCodec {
|
|
H264,
|
|
H265,
|
|
UNKNOWN,
|
|
};
|
|
|
|
struct StreamCodecInfo {
|
|
VideoCodec codec = VideoCodec::UNKNOWN;
|
|
int width = 0;
|
|
int height = 0;
|
|
int fps = 0;
|
|
|
|
// Encoder header / codec extradata. For H264/H265, AnnexB SPS/PPS(/VPS) is acceptable.
|
|
std::vector<uint8_t> extradata;
|
|
};
|
|
|
|
struct EncodedVideoPacket {
|
|
std::vector<uint8_t> data;
|
|
bool key = false;
|
|
int64_t pts_ms = 0;
|
|
};
|
|
|
|
struct EncodedVideoFrameMeta {
|
|
static constexpr uint32_t kMagic = 0x45564D31; // 'EVM1'
|
|
uint32_t magic = kMagic;
|
|
|
|
std::shared_ptr<StreamCodecInfo> codec;
|
|
EncodedVideoPacket pkt;
|
|
};
|
|
|
|
} // namespace rk3588
|