#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <mp4v2/mp4v2.h>
int main( int argc, char** argv )
{
if( argc != 2 ) {
printf( "usage: %s file.mp4\n", argv[0] );
return 1;
}
MP4FileHandle file =
MP4Modify( argv[1], 0 );
printf( "MP4Modify failed\n" );
return 1;
}
printf( "list=%p\n", list );
if( list ) {
printf(
"list size=%u\n", list->
size );
uint32_t i;
for( i = 0; i < list->
size; i++ ) {
printf(
"item[%u] type=%s\n", i, item->
code );
printf(
" mean=%s\n", item->
mean );
printf(
" name=%s\n", item->
name );
int j;
printf(
" data[%u] typeCode=%u valueSize=%u\n", j, data->
typeCode, data->
valueSize );
}
}
}
{
const char* const hello = "hello one";
}
{
bogus->
mean = strdup(
"com.garden.Tomato" );
bogus->
name = strdup(
"weight" );
const char* const hello = "hello two";
}
return 0;
}
MP4ItmfBasicType typeCode
iTMF basic type.
Definition: itmf_generic.h:103
uint32_t size
number of elements.
Definition: itmf_generic.h:133
char * code
four-char code identifing atom type.
Definition: itmf_generic.h:123
@ MP4_ITMF_BT_UTF8
without any count or null terminator
Definition: itmf_generic.h:74
List of items.
Definition: itmf_generic.h:130
Data structure.
Definition: itmf_generic.h:100
void MP4Close(MP4FileHandle hFile, uint32_t flags=0)
Close an mp4 file.
MP4ItmfItem * elements
flat array.
Definition: itmf_generic.h:132
MP4ItmfItem * MP4ItmfItemAlloc(const char *code, uint32_t numData)
Allocate an item on the heap.
MP4ItmfData * elements
flat array.
Definition: itmf_generic.h:112
uint8_t * value
may be NULL.
Definition: itmf_generic.h:105
#define MP4_INVALID_FILE_HANDLE
Constant: invalid MP4FileHandle.
Definition: general.h:48
Item structure.
Definition: itmf_generic.h:119
void MP4ItmfItemFree(MP4ItmfItem *item)
Free an item (deep free).
uint32_t valueSize
value size in bytes.
Definition: itmf_generic.h:106
bool MP4ItmfAddItem(MP4FileHandle hFile, const MP4ItmfItem *item)
Add an item to file.
char * mean
may be NULL.
Definition: itmf_generic.h:124
uint32_t size
number of elements.
Definition: itmf_generic.h:113
MP4ItmfItemList * MP4ItmfGetItems(MP4FileHandle hFile)
Get list of all items from file.
MP4FileHandle MP4Modify(const char *fileName, uint32_t flags=0)
Modify an existing mp4 file.
void MP4ItmfItemListFree(MP4ItmfItemList *itemList)
Free an item list (deep free).
char * name
may be NULL.
Definition: itmf_generic.h:125
MP4ItmfDataList dataList
list of data.
Definition: itmf_generic.h:126