Reads the first few bytes from the provided buffer, checks if this stream is a RIFF stream, and determines document type.
This function takes ownership of buf
so it should not be used anymore after calling this function.
element |
caller element (used for debugging/error). |
buf |
input buffer from which the file header will be parsed, should be at least 12 bytes long. |
doctype |
a fourcc (returned by this function) to indicate the type of document (according to the header). |
FALSE if this is not a RIFF stream (in which case the caller should error out; we already throw an error), or TRUE if it is. |