diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/nsavi/read.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/nsavi/read.h')
-rw-r--r-- | Src/nsavi/read.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Src/nsavi/read.h b/Src/nsavi/read.h new file mode 100644 index 00000000..25044f8b --- /dev/null +++ b/Src/nsavi/read.h @@ -0,0 +1,38 @@ +#pragma once +#include "bfc/platform/types.h" +#include "avi_reader.h" + + +namespace nsavi +{ + class avi_reader; +#pragma pack(push, 4) + struct riff_chunk + { + uint32_t id; + uint32_t size; + uint32_t type; // if id is LIST or RIFF, this will be set + }; +#pragma pack(pop) + + + enum ParseState + { + NOT_READ = 0, + PARSED = 1, + NOT_FOUND = 2, + PARSE_ERROR = 3, + FOUND = 4, // we know where it is, but we havn't read it + PARSE_RESYNC = 5, // read was aborted (return code < 0). need to resync inside the avi_reader + + }; + + #define nsaviFOURCC( ch0, ch1, ch2, ch3 ) ((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8 ) | ((uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 )) + + // negative return codes are 'pass-thru' from the the avi_reader object + // interpret accordingly (e.g. in_avi might abort a long network i/o on stop or seek) + int read_riff_chunk(nsavi::avi_reader *reader, riff_chunk *chunk, uint32_t *bytes_read=0); + int skip_chunk(nsavi::avi_reader *reader, const nsavi::riff_chunk *chunk, uint32_t *out_bytes_read=0); + + +}
\ No newline at end of file |