safesight-edge/include/media/encoded_video_meta.h
sladro 80e7abcd08
Some checks are pending
CI / host-build (push) Waiting to run
CI / rk3588-cross-build (push) Waiting to run
优化性能
2026-01-06 16:26:39 +08:00

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