1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:17:34 +00:00

LibGfx: Add initial ISO BMFF parsing and a utility to print file info

Currently, the `isobmff` utility will only print the media file type
info from the FileTypeBox (major brand and compatible brands), as well
as the names and sizes of top-level boxes.
This commit is contained in:
Zaggy1024 2023-02-18 17:46:27 -06:00 committed by Sam Atkins
parent 9caa0bda7d
commit 66c9696687
13 changed files with 510 additions and 0 deletions

View file

@ -0,0 +1,36 @@
/*
* Copyright (c) 2023, Gregory Bertilson <Zaggy1024@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/MaybeOwned.h>
#include <AK/Stream.h>
#include "Boxes.h"
namespace Gfx::ISOBMFF {
class Reader {
public:
static ErrorOr<Reader> create(MaybeOwned<SeekableStream> stream);
ErrorOr<BoxList> read_entire_file();
ErrorOr<BrandIdentifier> get_major_brand();
ErrorOr<Vector<BrandIdentifier>> get_minor_brands();
private:
Reader(MaybeOwned<SeekableStream> stream)
: m_stream(move(stream))
{
}
ErrorOr<void> parse_initial_data();
MaybeOwned<SeekableStream> m_stream;
};
}