[][src]Function mp4parse_capi::mp4parse_new

#[no_mangle]pub unsafe extern "C" fn mp4parse_new(
    io: *const Mp4parseIo,
    parser_out: *mut *mut Mp4parseParser
) -> Mp4parseStatus

Allocate an Mp4parseParser* to read from the supplied Mp4parseIo and parse the content from the Mp4parseIo argument until EOF or error.

Safety

This function is unsafe because it dereferences the io and parser_out pointers given to it. The caller should ensure that the Mp4ParseIo struct passed in is a valid pointer. The caller should also ensure the members of io are valid: the read function should be sanely implemented, and the userdata pointer should be valid. The parser_out should be a valid pointer to a location containing a null pointer. Upon successful return (Mp4parseStatus::Ok), that location will contain the address of an Mp4parseParser allocated by this function.

To avoid leaking memory, any successful return of this function must be paired with a call to mp4parse_free. In the event of error, no memory will be allocated and mp4parse_free must not be called.