add template + medium to metadata

This commit is contained in:
Alex Baines 2017-12-31 15:10:40 +00:00
parent f1e39e0513
commit 6fe3ed8dad
2 changed files with 10 additions and 2 deletions

View File

@ -24,6 +24,10 @@ typedef struct {
char** annotators; char** annotators;
size_t annotator_count; size_t annotator_count;
char* template;
char* medium;
} HMML_VideoMetaData; } HMML_VideoMetaData;
typedef struct { typedef struct {

View File

@ -5,7 +5,7 @@
#include "stb_sb.h" #include "stb_sb.h"
#include "hmmlib.h" #include "hmmlib.h"
const struct HMML_Version hmml_version = { 0, 1, 0 }; const struct HMML_Version hmml_version = { 0, 2, 0 };
typedef struct { typedef struct {
int line; int line;
@ -119,6 +119,8 @@ RB \]
<VIDEO>title{S}= { yyextra->attr = V_(title); BEGIN(V_ATTR); } <VIDEO>title{S}= { yyextra->attr = V_(title); BEGIN(V_ATTR); }
<VIDEO>vod_platform{S}= { yyextra->attr = V_(vod_platform); BEGIN(V_ATTR); } <VIDEO>vod_platform{S}= { yyextra->attr = V_(vod_platform); BEGIN(V_ATTR); }
<VIDEO>id{S}= { yyextra->attr = V_(id); BEGIN(V_ATTR); } <VIDEO>id{S}= { yyextra->attr = V_(id); BEGIN(V_ATTR); }
<VIDEO>template{S}= { yyextra->attr = V_(template); BEGIN(V_ATTR); }
<VIDEO>medium{S}= { yyextra->attr = V_(medium); BEGIN(V_ATTR); }
<VIDEO>co\-host{S}= { yyextra->attr = V_(co_hosts); BEGIN(V2_ATTR); } <VIDEO>co\-host{S}= { yyextra->attr = V_(co_hosts); BEGIN(V2_ATTR); }
<VIDEO>guest{S}= { yyextra->attr = V_(guests); BEGIN(V2_ATTR); } <VIDEO>guest{S}= { yyextra->attr = V_(guests); BEGIN(V2_ATTR); }
<VIDEO>annotator{S}= { yyextra->attr = V_(annotators); BEGIN(V2_ATTR); } <VIDEO>annotator{S}= { yyextra->attr = V_(annotators); BEGIN(V2_ATTR); }
@ -320,6 +322,8 @@ void hmml_free(HMML_Output* hmml){
free(hmml->metadata.title); free(hmml->metadata.title);
free(hmml->metadata.vod_platform); free(hmml->metadata.vod_platform);
free(hmml->metadata.id); free(hmml->metadata.id);
free(hmml->metadata.template);
free(hmml->metadata.medium);
sb_each(i, hmml->metadata.co_hosts) free(*i); sb_each(i, hmml->metadata.co_hosts) free(*i);
sb_each(i, hmml->metadata.guests) free(*i); sb_each(i, hmml->metadata.guests) free(*i);
@ -350,7 +354,7 @@ Index* index_find(Index* base, const char* text){
void hmml_dump(HMML_Output* hmml){ void hmml_dump(HMML_Output* hmml){
if(!hmml){ if(!hmml){
puts("(null"); puts("(null)");
return; return;
} }