Skip to content
Snippets Groups Projects
Commit ccb2ce7f authored by Nicolas Pope's avatar Nicolas Pope
Browse files

WIP File format changes to codec

parent c1b7e004
No related branches found
No related tags found
1 merge request!127Implements #196 stream capturing
...@@ -14,7 +14,14 @@ enum struct codec_t : uint8_t { ...@@ -14,7 +14,14 @@ enum struct codec_t : uint8_t {
JPG = 0, JPG = 0,
PNG, PNG,
H264, 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 { ...@@ -29,6 +36,8 @@ enum struct definition_t : uint8_t {
SD480 = 5, SD480 = 5,
LD360 = 6, LD360 = 6,
Any = 7 Any = 7
// TODO: Add audio definitions
}; };
/** /**
......
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
namespace ftl { namespace ftl {
namespace codecs { 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 * A single network packet for the compressed video stream. It includes the raw
* data along with any block metadata required to reconstruct. The underlying * data along with any block metadata required to reconstruct. The underlying
...@@ -21,9 +27,10 @@ struct Packet { ...@@ -21,9 +27,10 @@ struct Packet {
ftl::codecs::definition_t definition; ftl::codecs::definition_t definition;
uint8_t block_total; // Packets expected per frame uint8_t block_total; // Packets expected per frame
uint8_t block_number; // This packets number within a frame uint8_t block_number; // This packets number within a frame
uint8_t flags; // Codec dependent flags
std::vector<uint8_t> data; 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 { ...@@ -33,9 +40,10 @@ struct Packet {
*/ */
struct StreamPacket { struct StreamPacket {
int64_t timestamp; int64_t timestamp;
uint8_t streamID; // Source number...
uint8_t channel; // first bit = channel, second bit indicates second channel being sent uint8_t channel; // first bit = channel, second bit indicates second channel being sent
MSGPACK_DEFINE(timestamp, channel); MSGPACK_DEFINE(timestamp, streamID, channel);
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment