MP4v2

itmf_generic.h
1#ifndef MP4V2_ITMF_GENERIC_H
2#define MP4V2_ITMF_GENERIC_H
3
4/**************************************************************************/
71 typedef enum MP4ItmfBasicType_e
72{
73 MP4_ITMF_BT_IMPLICIT = 0,
74 MP4_ITMF_BT_UTF8 = 1,
75 MP4_ITMF_BT_UTF16 = 2,
76 MP4_ITMF_BT_SJIS = 3,
77 MP4_ITMF_BT_HTML = 6,
78 MP4_ITMF_BT_XML = 7,
79 MP4_ITMF_BT_UUID = 8,
80 MP4_ITMF_BT_ISRC = 9,
81 MP4_ITMF_BT_MI3P = 10,
82 MP4_ITMF_BT_GIF = 12,
83 MP4_ITMF_BT_JPEG = 13,
84 MP4_ITMF_BT_PNG = 14,
85 MP4_ITMF_BT_URL = 15,
86 MP4_ITMF_BT_DURATION = 16,
87 MP4_ITMF_BT_DATETIME = 17,
88 MP4_ITMF_BT_GENRES = 18,
89 MP4_ITMF_BT_INTEGER = 21,
90 MP4_ITMF_BT_RIAA_PA = 24,
91 MP4_ITMF_BT_UPC = 25,
92 MP4_ITMF_BT_BMP = 27,
94 MP4_ITMF_BT_UNDEFINED = 255
95} MP4ItmfBasicType;
96
100 typedef struct MP4ItmfData_s
101{
102 uint8_t typeSetIdentifier;
103 MP4ItmfBasicType typeCode;
104 uint32_t locale;
105 uint8_t* value;
106 uint32_t valueSize;
107} MP4ItmfData;
108
110 typedef struct MP4ItmfDataList_s
111{
112 MP4ItmfData* elements;
113 uint32_t size;
114} MP4ItmfDataList;
115
119 typedef struct MP4ItmfItem_s
120{
121 void* __handle;
123 char* code;
124 char* mean;
125 char* name;
126 MP4ItmfDataList dataList;
127} MP4ItmfItem;
128
130 typedef struct MP4ItmfItemList_s
131{
132 MP4ItmfItem* elements;
133 uint32_t size;
134} MP4ItmfItemList;
135
141MP4V2_EXPORT
142 MP4ItmfItem* MP4ItmfItemAlloc(
143 const char* code,
144 uint32_t numData );
145
149MP4V2_EXPORT
150 void MP4ItmfItemFree(
151 MP4ItmfItem* item );
152
156MP4V2_EXPORT
157 void MP4ItmfItemListFree(
158 MP4ItmfItemList* itemList );
159
164MP4V2_EXPORT
165 MP4ItmfItemList* MP4ItmfGetItems(
166 MP4FileHandle hFile );
167
173MP4V2_EXPORT
174 MP4ItmfItemList* MP4ItmfGetItemsByCode(
175 MP4FileHandle hFile,
176 const char* code );
177
185MP4V2_EXPORT
186 MP4ItmfItemList* MP4ItmfGetItemsByMeaning(
187 MP4FileHandle hFile,
188 const char* meaning,
189 const char* name );
190
196MP4V2_EXPORT
197 bool MP4ItmfAddItem(
198 MP4FileHandle hFile,
199 const MP4ItmfItem* item );
200
206MP4V2_EXPORT
207 bool MP4ItmfSetItem(
208 MP4FileHandle hFile,
209 const MP4ItmfItem* item );
210
216MP4V2_EXPORT
217 bool MP4ItmfRemoveItem(
218 MP4FileHandle hFile,
219 const MP4ItmfItem* item );
220
223#endif /* MP4V2_ITMF_GENERIC_H */
MP4ItmfItemFree
void MP4ItmfItemFree(MP4ItmfItem *item)
Free an item (deep free).
MP4ItmfItem
struct MP4ItmfItem_s MP4ItmfItem
Item structure.
MP4ItmfGetItemsByCode
MP4ItmfItemList * MP4ItmfGetItemsByCode(MP4FileHandle hFile, const char *code)
Get list of items by code from file.
MP4ItmfAddItem
bool MP4ItmfAddItem(MP4FileHandle hFile, const MP4ItmfItem *item)
Add an item to file.
MP4ItmfRemoveItem
bool MP4ItmfRemoveItem(MP4FileHandle hFile, const MP4ItmfItem *item)
Remove an existing item from file.
MP4ItmfDataList
struct MP4ItmfDataList_s MP4ItmfDataList
List of data.
MP4ItmfItemList
struct MP4ItmfItemList_s MP4ItmfItemList
List of items.
MP4ItmfBasicType_e
MP4ItmfBasicType_e
Basic types of value data as enumerated in spec.
Definition: itmf_generic.h:72
MP4ItmfSetItem
bool MP4ItmfSetItem(MP4FileHandle hFile, const MP4ItmfItem *item)
Overwrite an existing item in file.
MP4ItmfGetItems
MP4ItmfItemList * MP4ItmfGetItems(MP4FileHandle hFile)
Get list of all items from file.
MP4ItmfGetItemsByMeaning
MP4ItmfItemList * MP4ItmfGetItemsByMeaning(MP4FileHandle hFile, const char *meaning, const char *name)
Get list of items by meaning from file.
MP4ItmfBasicType
enum MP4ItmfBasicType_e MP4ItmfBasicType
Basic types of value data as enumerated in spec.
MP4ItmfItemAlloc
MP4ItmfItem * MP4ItmfItemAlloc(const char *code, uint32_t numData)
Allocate an item on the heap.
MP4ItmfItemListFree
void MP4ItmfItemListFree(MP4ItmfItemList *itemList)
Free an item list (deep free).
MP4ItmfData
struct MP4ItmfData_s MP4ItmfData
Data structure.
MP4_ITMF_BT_XML
@ MP4_ITMF_BT_XML
the XML header must identify the DTD or schemas
Definition: itmf_generic.h:78
MP4_ITMF_BT_UTF16
@ MP4_ITMF_BT_UTF16
also known as UTF-16BE
Definition: itmf_generic.h:75
MP4_ITMF_BT_INTEGER
@ MP4_ITMF_BT_INTEGER
a signed big-endian integer with length one of { 1,2,3,4,8 } bytes
Definition: itmf_generic.h:89
MP4_ITMF_BT_UNDEFINED
@ MP4_ITMF_BT_UNDEFINED
undefined
Definition: itmf_generic.h:94
MP4_ITMF_BT_ISRC
@ MP4_ITMF_BT_ISRC
stored as UTF-8 text (valid as an ID)
Definition: itmf_generic.h:80
MP4_ITMF_BT_UTF8
@ MP4_ITMF_BT_UTF8
without any count or null terminator
Definition: itmf_generic.h:74
MP4_ITMF_BT_BMP
@ MP4_ITMF_BT_BMP
Windows bitmap image.
Definition: itmf_generic.h:92
MP4_ITMF_BT_SJIS
@ MP4_ITMF_BT_SJIS
deprecated unless it is needed for special Japanese characters
Definition: itmf_generic.h:76
MP4_ITMF_BT_DURATION
@ MP4_ITMF_BT_DURATION
in milliseconds, 32-bit integer
Definition: itmf_generic.h:86
MP4_ITMF_BT_URL
@ MP4_ITMF_BT_URL
absolute, in UTF-8 characters
Definition: itmf_generic.h:85
MP4_ITMF_BT_GENRES
@ MP4_ITMF_BT_GENRES
a list of enumerated values
Definition: itmf_generic.h:88
MP4_ITMF_BT_JPEG
@ MP4_ITMF_BT_JPEG
a JPEG image
Definition: itmf_generic.h:83
MP4_ITMF_BT_PNG
@ MP4_ITMF_BT_PNG
a PNG image
Definition: itmf_generic.h:84
MP4_ITMF_BT_GIF
@ MP4_ITMF_BT_GIF
(deprecated) a GIF image
Definition: itmf_generic.h:82
MP4_ITMF_BT_RIAA_PA
@ MP4_ITMF_BT_RIAA_PA
RIAA parental advisory; { -1=no, 1=yes, 0=unspecified }, 8-bit ingteger.
Definition: itmf_generic.h:90
MP4_ITMF_BT_MI3P
@ MP4_ITMF_BT_MI3P
stored as UTF-8 text (valid as an ID)
Definition: itmf_generic.h:81
MP4_ITMF_BT_UUID
@ MP4_ITMF_BT_UUID
also known as GUID; stored as 16 bytes in binary (valid as an ID)
Definition: itmf_generic.h:79
MP4_ITMF_BT_IMPLICIT
@ MP4_ITMF_BT_IMPLICIT
for use with tags for which no type needs to be indicated
Definition: itmf_generic.h:73
MP4_ITMF_BT_UPC
@ MP4_ITMF_BT_UPC
Universal Product Code, in text UTF-8 format (valid as an ID)
Definition: itmf_generic.h:91
MP4_ITMF_BT_DATETIME
@ MP4_ITMF_BT_DATETIME
in UTC, counting seconds since midnight, January 1, 1904; 32 or 64-bits
Definition: itmf_generic.h:87
MP4_ITMF_BT_HTML
@ MP4_ITMF_BT_HTML
the HTML file header specifies which HTML version
Definition: itmf_generic.h:77
MP4ItmfData_s
Data structure.
Definition: itmf_generic.h:101
MP4ItmfData_s::typeSetIdentifier
uint8_t typeSetIdentifier
always zero.
Definition: itmf_generic.h:102
MP4ItmfData_s::typeCode
MP4ItmfBasicType typeCode
iTMF basic type.
Definition: itmf_generic.h:103
MP4ItmfData_s::value
uint8_t * value
may be NULL.
Definition: itmf_generic.h:105
MP4ItmfData_s::valueSize
uint32_t valueSize
value size in bytes.
Definition: itmf_generic.h:106
MP4ItmfData_s::locale
uint32_t locale
always zero.
Definition: itmf_generic.h:104
MP4ItmfDataList_s
List of data.
Definition: itmf_generic.h:111
MP4ItmfDataList_s::elements
MP4ItmfData * elements
flat array.
Definition: itmf_generic.h:112
MP4ItmfDataList_s::size
uint32_t size
number of elements.
Definition: itmf_generic.h:113
MP4ItmfItem_s
Item structure.
Definition: itmf_generic.h:120
MP4ItmfItem_s::name
char * name
may be NULL.
Definition: itmf_generic.h:125
MP4ItmfItem_s::code
char * code
four-char code identifing atom type.
Definition: itmf_generic.h:123
MP4ItmfItem_s::mean
char * mean
may be NULL.
Definition: itmf_generic.h:124
MP4ItmfItem_s::dataList
MP4ItmfDataList dataList
list of data.
Definition: itmf_generic.h:126
MP4ItmfItem_s::__handle
void * __handle
internal use only.
Definition: itmf_generic.h:121
MP4ItmfItemList_s
List of items.
Definition: itmf_generic.h:131
MP4ItmfItemList_s::elements
MP4ItmfItem * elements
flat array.
Definition: itmf_generic.h:132
MP4ItmfItemList_s::size
uint32_t size
number of elements.
Definition: itmf_generic.h:133