Skip to content

Commit

Permalink
TAF Header generation example
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Aug 30, 2023
1 parent faa2091 commit 5a07154
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/toniefile.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "ogg/ogg.h"
#include "server_helpers.h"
#include "version.h"
#include "proto/toniebox.pb.taf-header.pb-c.h"

struct toniefile_s
{
Expand Down Expand Up @@ -44,6 +45,22 @@ static void comment_add(uint8_t *buffer, size_t *length, const char *str)
*length += strlen(str);
}

static void generate_taf_header(uint8_t *buffer, size_t *length, TonieboxAudioFileHeader *tafHeader)
{
/*
TonieboxAudioFileHeader tafHeaderS = TONIEBOX_AUDIO_FILE_HEADER__INIT;
tafHeaderS.n_track_page_nums = 0;
tafHeaderS.track_page_nums = malloc(sizeof(uint32_t) * 99);
tafHeaderS.track_page_nums[freshReqCloud.n_track_page_nums++] = 1234;
*/
size_t dataLen = tonie_freshness_check_request__get_packed_size(tafHeader);
if (dataLength <= length)
{
tonie_freshness_check_request__pack(tafHeader, buffer);
}
tonie_freshness_check_request__free_unpacked(tafHeader, NULL);
}

toniefile_t *toniefile_create(const char *fullPath)
{
int err;
Expand Down

0 comments on commit 5a07154

Please sign in to comment.