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 { namespace Gfx::ISOBMFF {
// Define all Box types: // Define all Box types:
#define ENUMERATE_ALL() \ #define ENUMERATE_ALL() \
ENUMERATE_ONE(FileTypeBox, ftyp) \ ENUMERATE_ONE(FileTypeBox, "ftyp") \
ENUMERATE_ONE(MetaBox, meta) \ ENUMERATE_ONE(MetaBox, "meta") \
ENUMERATE_ONE(MovieBox, moov) \ ENUMERATE_ONE(MovieBox, "moov") \
ENUMERATE_ONE(MediaDataBox, mdat) \ ENUMERATE_ONE(MediaDataBox, "mdat") \
ENUMERATE_ONE(FreeBox, free) ENUMERATE_ONE(FreeBox, "free")
enum class BoxType : u32 { enum class BoxType : u32 {
None = 0, 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() ENUMERATE_ALL()