Skip to content

User data functions

Dimitri Podborski edited this page Sep 17, 2020 · 1 revision

These functions allow you to access and manipulate track and movie user data.

ISOAddUserData

ISOErr ISOAddUserData( MP4UserData theUserData, 
            ISOHandle dataH, u32 userDataType,
            u32 *outIndex );

Adds an entry to the user data list. Parameters are:

theUserData The user data list you are modifying

dataH An ISOHandle containing the data you are adding

userDataType The atom type that will identify this data

outIndex Returns the index (of entries of userDataType) that corresponds to this entry. You will need this to retrieve this particular entry.

ISOGetIndUserDataType

ISOErr ISOGetIndUserDataType( MP4UserData theUserData, 
            u32 typeIndex,
            u32 *outType );

Queries an indexed type of user data in the user data list. Parameters are:

theUserData The user data list you are querying

typeIndex The index for the atom type you are querying. This should be one based.

outType Returns the atom type corresponding to the given index.

ISOGetMovieUserData

ISOErr ISOGetMovieUserData( ISOMovie theMovie, MP4UserData *outUserData );

Gives you access to the Movie's user data list.

ISOGetTrackUserData

ISOErr ISOGetTrackUserData( ISOTrack theTrack, MP4UserData *outUserData );

Gives you access to the Track's user data list.

ISOGetUserDataEntryCount

ISOErr ISOGetUserDataEntryCount(MP4UserData userData,
            u32 userDataType,
            u32 *outCount );

Returns the count of user data atoms of the specified type.

ISOGetUserDataItem

ISOErr ISOGetUserDataItem(MP4UserData userData,
            ISOHandle dataH,
            u32 userDataType,
            u32 itemIndex );

Returns the contents of the requested user data item. Parameters are:

userData The user data list you are querying

dataH A handle to contain the returned data

userDataType The type of user data

itemIndex The index for the atom type you are querying. This should be one based.

ISOGetAtomFromUserData

ISOErr ISOGetAtomFromUserData(MP4UserData userData,
            MP4GenericAtom *outAtom,
            u32 userDataType,
            u32 itemIndex );

Returns the contents of the requested user data item. Parameters are:

userData The user data list you are querying

outAtom A generic atom, which will contain the requested atom

userDataType The type of user data

itemIndex The index for the atom type you are querying. This should be one based.

ISOGetUserDataTypeCount

ISOErr ISOGetUserDataTypeCount(MP4UserData userData, u32 *outCount );

Returns the count of user data types.

ISONewUserData

ISOErr ISONewUserData( MP4UserData *outUserData );

Creates a new user data list.

ISODeleteUserDataItem

ISOErr MP4DeleteUserDataItem( MP4UserData theUserData, 
            u32 userDataType, u32 itemIndex );

Deletes a user-data item, by index.

ISONewForeignAtom

ISOErr ISONewForeignAtom( 
            MP4GenericAtom *outAtom, 
            u32 atomType, 
            MP4Handle atomPayload );

Creates a new atom with the given type. The pre-serialized content of the atom is taken from the given handle.

ISONewUUIDAtom

ISOErr ISONewUUIDAtom( 
            MP4GenericAtom *outAtom, 
            u8 the_uuid[16], 
            MP4Handle atomPayload );

Creates a new extension atom with the given UUID. The pre-serialized content of the atom is taken from the given handle.

ISOGetForeignAtom

ISOErr ISOGetForeignAtom( MP4GenericAtom atom, 
            u32* atomType, 
            u8 the_uuid[16], 
            MP4Handle atomPayload );

Returns the type and contents of the given foreign atom, and, if it is a UUID atom, its UUID also.

Clone this wiki locally