feat(streamer): add ffmpeg encoder and mcap recording

This commit is contained in:
2026-03-10 22:12:22 +08:00
parent 769d36f86f
commit 6af97ee5d3
86 changed files with 30551 additions and 1482 deletions
@@ -0,0 +1,42 @@
#pragma once
#include "cvmmap_streamer/config/runtime_config.hpp"
#include "cvmmap_streamer/encode/encoded_access_unit.hpp"
#include <expected>
#include <string>
#include <string_view>
namespace cvmmap_streamer::record {
class McapRecordSink {
public:
McapRecordSink() = default;
~McapRecordSink();
McapRecordSink(const McapRecordSink &) = delete;
McapRecordSink &operator=(const McapRecordSink &) = delete;
McapRecordSink(McapRecordSink &&other) noexcept;
McapRecordSink &operator=(McapRecordSink &&other) noexcept;
[[nodiscard]]
static std::expected<McapRecordSink, std::string> create(const RuntimeConfig &config);
[[nodiscard]]
std::expected<void, std::string> write_access_unit(const encode::EncodedAccessUnit &access_unit);
[[nodiscard]]
bool is_open() const;
[[nodiscard]]
std::string_view path() const;
void close();
private:
struct State;
State *state_{nullptr};
};
}