改代码前

This commit is contained in:
2026-08-26 10:55:29 +08:00
parent 65799cfc2a
commit 5ecb12b8f7
59 changed files with 4224 additions and 2458 deletions
+7 -12
View File
@@ -7,31 +7,26 @@
#include <span>
#include <string_view>
#include <vector>
namespace aethera::web {
enum class Video_Pixel_Layout : std::uint8_t {
enum struct Video_Pixel_Layout : std::uint8_t {
bgra,
rgba
};
enum class Video_Encoder_Backend : std::uint8_t {
enum struct Video_Encoder_Backend : std::uint8_t {
nvenc,
vulkan_video
};
[[nodiscard]] std::string_view video_encoder_backend_name(
Video_Encoder_Backend backend) noexcept;
[[nodiscard]] std::string_view h264_profile_level_id() noexcept;
struct Encoded_Video_Frame {
std::vector<std::byte> annex_b{}; /* 带起始码的完整 H.264 access unit,可直接交给 RTP packetizer。 */
std::chrono::microseconds presentation_time{}; /* 从 Plot 帧时钟起点累计的媒体时间戳。 */
std::uint64_t sequence{}; /* 对应 Render_Frame 的单调序号。 */
std::vector<std::byte> annex_b{}; /* 带起始码的完整 H.264 access unit,可直接交给 RTP packetizer。 */
std::chrono::microseconds presentation_time{}; /* 从 Plot 帧时钟起点累计的媒体时间戳。 */
std::uint64_t sequence{}; /* 对应 Render_Frame 的单调序号。 */
Video_Encoder_Backend backend{Video_Encoder_Backend::nvenc}; /* 实际产生本 access unit 的硬件编码后端。 */
bool key_frame{}; /* 本 access unit 是否可独立解码。 */
bool key_frame{}; /* 本 access unit 是否可独立解码。 */
};
class H264_Encoder final {
struct H264_Encoder final {
public:
explicit H264_Encoder(double frame_rate);
~H264_Encoder();