LibGfx/ISOBMFF: Put string literals in box type ENUMERATE_ONE()

This allows types that have spaces in their FourCC.
This commit is contained in:
Nico Weber 2024-03-22 11:56:10 -04:00 committed by Tim Schumacher
parent bdb4f6bd49
commit e81009b338
Notes: sideshowbarker 2024-07-17 04:41:05 +09:00

View File

@ -13,17 +13,17 @@
namespace Gfx::ISOBMFF {
// Define all Box types:
#define ENUMERATE_ALL() \
ENUMERATE_ONE(FileTypeBox, ftyp) \
ENUMERATE_ONE(MetaBox, meta) \
ENUMERATE_ONE(MovieBox, moov) \
ENUMERATE_ONE(MediaDataBox, mdat) \
ENUMERATE_ONE(FreeBox, free)
#define ENUMERATE_ALL() \
ENUMERATE_ONE(FileTypeBox, "ftyp") \
ENUMERATE_ONE(MetaBox, "meta") \
ENUMERATE_ONE(MovieBox, "moov") \
ENUMERATE_ONE(MediaDataBox, "mdat") \
ENUMERATE_ONE(FreeBox, "free")
enum class BoxType : u32 {
None = 0,
#define ENUMERATE_ONE(box_name, box_4cc) box_name = RIFF::ChunkID(#box_4cc).as_number(),
#define ENUMERATE_ONE(box_name, box_4cc) box_name = RIFF::ChunkID(box_4cc).as_number(),
ENUMERATE_ALL()