Commit 93f625e7 authored by g3gg0's avatar g3gg0
Browse files

mlv_rec: added code and structures to helper routines to get version...

mlv_rec: added code and structures to helper routines to get version information embedded into the MLV file

--HG--
branch : unified
parent a98c6c65de74
......@@ -155,6 +155,23 @@ void mlv_fill_idnt(mlv_idnt_hdr_t *hdr, uint64_t start_timestamp)
trace_write(raw_rec_trace_ctx, "[IDNT] cameraName: '%s' cameraModel: 0x%08X cameraSerial: '%s'", hdr->cameraName, hdr->cameraModel, hdr->cameraSerial);
}
void mlv_build_vers(mlv_vers_hdr_t **hdr, uint64_t start_timestamp, const char *version_string)
{
int block_length = strlen(version_string) + sizeof(mlv_vers_hdr_t);
mlv_vers_hdr_t *header = malloc(block_length);
/* prepare header */
mlv_set_type((mlv_hdr_t *)header, "VERS");
mlv_set_timestamp((mlv_hdr_t *)header, start_timestamp);
header->blockSize = block_length;
header->length = strlen(version_string);
char *vers_hdr_payload = (char *)&header[1];
strcpy(vers_hdr_payload, version_string);
*hdr = header;
}
uint64_t mlv_prng_lfsr(uint64_t value)
{
uint64_t lfsr = value;
......
......@@ -231,10 +231,21 @@ typedef struct {
uint32_t blockSize;
uint64_t timestamp;
uint32_t type; /* debug data type, for now 0 - text log */
uint32_t length; /* data can be of arbitrary length and blocks are padded to 32 bits, so store real length */
uint32_t length; /* to allow that data can be of arbitrary length and blocks are padded to 32 bits, so store real length */
/* uint8_t stringData[variable]; */
} mlv_debg_hdr_t;
typedef struct {
uint8_t blockType[4]; /* VERS - Version information block, appears once per module */
uint32_t blockSize;
uint64_t timestamp;
uint32_t length; /* to allow that data can be of arbitrary length and blocks are padded to 32 bits, so store real length */
/* uint8_t stringData[variable]; // Version string, e.g. "ml-core 20130912", "mlv_rec v2.1" or "mlv_lite 0d3fbdaf crop_rec_8k"
// general format "<module_name> <version_information>"
// where <module_name> must not contain spaces whereas <version_information> may be of any characters in UTF-8 format
*/
} mlv_vers_hdr_t;
#pragma pack(pop)
/* helper routines for filling structures from generic camera information */
......@@ -244,6 +255,7 @@ void mlv_fill_lens(mlv_lens_hdr_t *hdr, uint64_t start_timestamp);
void mlv_fill_idnt(mlv_idnt_hdr_t *hdr, uint64_t start_timestamp);
void mlv_fill_wbal(mlv_wbal_hdr_t *hdr, uint64_t start_timestamp);
void mlv_fill_styl(mlv_styl_hdr_t *hdr, uint64_t start_timestamp);
void mlv_build_vers(mlv_vers_hdr_t **hdr, uint64_t start_timestamp, const char *version_string);
/* randomize the 64 bits passed in parameter using LFSR */
uint64_t mlv_prng_lfsr(uint64_t value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment