ISOBMFF
ISO Base Media File Format Reference Software Documentation
 
Loading...
Searching...
No Matches
Utility functions

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.
 

Detailed Description

Utility functions which help to operate with data.

Function Documentation

◆ MP4DisposeHandle()

MP4Err MP4DisposeHandle ( MP4Handle  theHandle)

Frees the memory that was allocated for a handle.

Parameters
theHandleinput handle to kill
Returns
MP4Err error code

◆ MP4GetHandleSize()

MP4Err MP4GetHandleSize ( MP4Handle  theHandle,
u32 *  outSize 
)

Use this to determine the present logical size (in bytes) of a handle.

Parameters
theHandleinput handle
outSizeoutput size in bytes
Returns
MP4Err error code

◆ MP4HandleCat()

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.

Parameters
theDstHandledestination handle
theSrcHandlesource handle
Returns
MP4Err error code

◆ MP4NewHandle()

MP4Err MP4NewHandle ( u32  handleSize,
MP4Handle outHandle 
)

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.

Parameters
handleSizenumber of bytes to allocate
outHandleoutput handle
Returns
MP4Err error code

◆ MP4SetHandleOffset()

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.

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.

Parameters
theHandleinput handle
offsetbyte offset
Returns
MP4Err error code

◆ MP4SetHandleSize()

MP4Err MP4SetHandleSize ( MP4Handle  theHandle,
u32  handleSize 
)

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.

Parameters
theHandleinput handle
requestedSizenew size in bytes
Returns
MP4Err error code