Utility functions which help to operate with data. More...
Functions | |
MP4Err | MP4NewHandle (u32 handleSize, MP4Handle *outHandle) |
Creates a new handle, and allocates handleSize bytes for it. | |
MP4Err | MP4SetHandleSize (MP4Handle theHandle, u32 handleSize) |
Sets the logical size of the handle to requestedSize bytes. | |
MP4Err | MP4DisposeHandle (MP4Handle theHandle) |
Frees the memory that was allocated for a handle. | |
MP4Err | MP4GetHandleSize (MP4Handle theHandle, u32 *outSize) |
Use this to determine the present logical size (in bytes) of a handle. | |
MP4Err | MP4HandleCat (MP4Handle theDstHandle, MP4Handle theSrcHandle) |
Appends the data contained in theSrcHandle to data contained in theDstHandle by reallocating, if necessary, the number of bytes allocated for theDstHandle. | |
MP4Err | MP4SetHandleOffset (MP4Handle theHandle, u32 offset) |
Sets the handle so that subsequent de-references of it refer to the data starting at the given byte offset. | |
Utility functions which help to operate with data.
Frees the memory that was allocated for a handle.
theHandle | input handle to kill |
Use this to determine the present logical size (in bytes) of a handle.
theHandle | input handle |
outSize | output size in bytes |
Appends the data contained in theSrcHandle to data contained in theDstHandle by reallocating, if necessary, the number of bytes allocated for theDstHandle.
theDstHandle | destination handle |
theSrcHandle | source handle |
Creates a new handle, and allocates handleSize bytes for it.
It is OK to call this with a size of zero. This is commonly done when the handle will be used as a parameter to a function that will size it appropriately.
handleSize | number of bytes to allocate |
outHandle | output handle |
Sets the handle so that subsequent de-references of it refer to the data starting at the given byte offset.
This can be used to cause data to be read from or written to locations after the beginning, leaving room (for example) for an encryption header.
theHandle | input handle |
offset | byte offset |
Sets the logical size of the handle to requestedSize bytes.
If this is larger than the number of bytes allocated for this handle, the handle will be grown accordingly. If the new size is smaller than the allocated size the memory is not freed. The only way to free this memory is to dispose of the handle.
theHandle | input handle |
requestedSize | new size in bytes |