ChapterForge
Loading...
Searching...
No Matches
meta_builder.hpp
Go to the documentation of this file.
1//
2// meta_builder.hpp
3// ChapterForge
4//
5// Created by Till Toenshoff on 12/9/25.
6// Copyright © 2025 Till Toenshoff. All rights reserved.
7//
8
9#pragma once
10#include <memory>
11#include <string>
12#include <vector>
13
14#include "metadata_set.hpp"
15#include "mp4_atoms.hpp"
16
17// ILST key/data builder.
18std::unique_ptr<Atom> build_ilst_item(const std::string &fourcc, const std::vector<uint8_t> &data,
19 uint32_t data_type = 1);
20
21// ILST container builder.
22std::unique_ptr<Atom> build_ilst(std::vector<std::unique_ptr<Atom>> items);
23
24// Meta box builder.
25std::unique_ptr<Atom> build_meta(std::unique_ptr<Atom> ilst);
26// additional boxes such as `chpl` when constructing the final `udta`
27std::unique_ptr<Atom> build_meta_atom(const MetadataSet &meta);
28
29// Build a `meta` atom by reusing an existing `ilst` payload (as parsed from an.
30// MP4/M4A). The payload must be the raw ilst payload (no atom header)
31std::unique_ptr<Atom> build_meta_atom_from_ilst(const std::vector<uint8_t> &ilst_payload);
constexpr uint32_t fourcc(const char a, const char b, const char c, const char d)
Definition fourcc_utils.hpp:16
Definition metadata_set.hpp:16
std::unique_ptr< Atom > build_ilst_item(const std::string &fourcc, const std::vector< uint8_t > &data, uint32_t data_type=1)
std::unique_ptr< Atom > build_meta(std::unique_ptr< Atom > ilst)
std::unique_ptr< Atom > build_meta_atom_from_ilst(const std::vector< uint8_t > &ilst_payload)
std::unique_ptr< Atom > build_ilst(std::vector< std::unique_ptr< Atom > > items)
std::unique_ptr< Atom > build_meta_atom(const MetadataSet &meta)