diff --git a/components/codecs/include/ftl/codecs/bitrates.hpp b/components/codecs/include/ftl/codecs/bitrates.hpp index 19572daa5600fd7b78106e951307e92e17f51e33..6c66aeec692291f00c05a785d4842554c16b6be3 100644 --- a/components/codecs/include/ftl/codecs/bitrates.hpp +++ b/components/codecs/include/ftl/codecs/bitrates.hpp @@ -14,7 +14,14 @@ enum struct codec_t : uint8_t { JPG = 0, PNG, H264, - HEVC // H265 + HEVC, // H265 + + // TODO: Add audio codecs + + JSON = 100, // A JSON string + CALIBRATION, // Camera parameters object + POSE, // 4x4 eigen matrix + RAW // Some unknown binary format (msgpack?) }; /** @@ -29,6 +36,8 @@ enum struct definition_t : uint8_t { SD480 = 5, LD360 = 6, Any = 7 + + // TODO: Add audio definitions }; /** diff --git a/components/codecs/include/ftl/codecs/packet.hpp b/components/codecs/include/ftl/codecs/packet.hpp index 98e46a60122e6813fd22b0c0be0f09e40fbc96ce..bca68530a20c1f6c2bba8228ee8c1bbadf41d71e 100644 --- a/components/codecs/include/ftl/codecs/packet.hpp +++ b/components/codecs/include/ftl/codecs/packet.hpp @@ -10,6 +10,12 @@ namespace ftl { namespace codecs { + +struct Header { + const char magic[4] = {'F','T','L','F'}; + uint8_t version; +}; + /** * A single network packet for the compressed video stream. It includes the raw * data along with any block metadata required to reconstruct. The underlying @@ -21,9 +27,10 @@ struct Packet { ftl::codecs::definition_t definition; uint8_t block_total; // Packets expected per frame uint8_t block_number; // This packets number within a frame + uint8_t flags; // Codec dependent flags std::vector<uint8_t> data; - MSGPACK_DEFINE(codec, definition, block_total, block_number, data); + MSGPACK_DEFINE(codec, definition, block_total, block_number, flags, data); }; /** @@ -33,9 +40,10 @@ struct Packet { */ struct StreamPacket { int64_t timestamp; + uint8_t streamID; // Source number... uint8_t channel; // first bit = channel, second bit indicates second channel being sent - MSGPACK_DEFINE(timestamp, channel); + MSGPACK_DEFINE(timestamp, streamID, channel); }; }