556a3db1 |
1 | /* |
2 | * Copyright (C) 2013 nu774 |
3 | * For conditions of distribution and use, see copyright notice in COPYING |
4 | */ |
cbb23cdb |
5 | #ifndef METADATA_H |
6 | #define METADATA_H |
7 | |
3b666b75 |
8 | #include "m4af.h" |
9 | |
cbb23cdb |
10 | typedef struct aacenc_tag_entry_t { |
3b666b75 |
11 | uint32_t tag; |
12 | char *name; |
13 | char *data; |
14 | uint32_t data_size; |
cbb23cdb |
15 | } aacenc_tag_entry_t; |
16 | |
3b666b75 |
17 | typedef struct aacenc_tag_store_t { |
cbb23cdb |
18 | aacenc_tag_entry_t *tag_table; |
19 | unsigned tag_count; |
20 | unsigned tag_table_capacity; |
3b666b75 |
21 | } aacenc_tag_store_t; |
22 | |
23 | typedef struct aacenc_translate_generic_text_tag_ctx_t { |
24 | unsigned track, track_total, disc, disc_total; |
25 | void (*add)(void *, const aacenc_tag_entry_t *); |
26 | void *add_ctx; |
27 | } aacenc_translate_generic_text_tag_ctx_t; |
28 | |
29 | typedef void (*aacenc_tag_callback_t)(void *ctx, const char *key, |
30 | const char *value, uint32_t size); |
31 | |
32 | void aacenc_translate_generic_text_tag(void *ctx, const char *key, |
33 | const char *val, uint32_t size); |
34 | |
35 | |
36 | void aacenc_add_tag_to_store(aacenc_tag_store_t *store, uint32_t tag, |
37 | const char *key, const char *value, |
38 | uint32_t size, int is_file_name); |
cbb23cdb |
39 | |
3b666b75 |
40 | void aacenc_add_tag_entry_to_store(void *store, const aacenc_tag_entry_t *tag); |
cbb23cdb |
41 | |
3b666b75 |
42 | void aacenc_free_tag_store(aacenc_tag_store_t *store); |
cbb23cdb |
43 | |
3b666b75 |
44 | void aacenc_write_tags_from_json(m4af_ctx_t *m4af, const char *json_filename); |
cbb23cdb |
45 | |
3b666b75 |
46 | void aacenc_write_tag_entry(void *m4af, const aacenc_tag_entry_t *tag); |
cbb23cdb |
47 | |
48 | #endif |