The kernel copy follows the new kernel: the OAMD parser reads the trim element, the speaker renderer applies warp, per-object trim and the front-back balance, and the ADM writer carries them into the BWF metadata. joc_kernel.vcxproj lists the new speaker_trim translation unit and header, and the copied joc_version.h reports kernel 1.2.0 in the session log. The component keeps its playback settings, its speaker layout table and the side/rear channel swap; the stream interface is unchanged, so the decoder wrapper needs no edit. A stream whose OAMD asks for warp 2/3 now stops at the speaker renderer with JOC_ERR_NOT_SUPPORTED, as the reference refuses it. Builds Release-Static|x64 and |Win32. layout_table_test and channel_swap_test still pass; the render harness renders a warp-1 stream and reports the unimplemented mode for a warp-3 stream.
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
// Port of src/adm_atmos.py.
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "foundation/status.h"
|
|
#include "oamd/oamd_parser.h"
|
|
|
|
namespace joc::adm {
|
|
|
|
inline constexpr int kObjectCount = 15;
|
|
inline constexpr std::uint32_t kTrackCount = 25;
|
|
|
|
struct Keyframe {
|
|
std::int64_t rtime_samples = 0;
|
|
double x = 0.0;
|
|
double y = 0.0;
|
|
double z = 0.0;
|
|
std::int64_t duration_samples = 0;
|
|
std::int64_t interpolation_samples = 0;
|
|
};
|
|
|
|
struct Track {
|
|
std::string name;
|
|
std::vector<Keyframe> blocks;
|
|
};
|
|
|
|
// HH:MM:SS.fffff with the reference's truncation + round-half-even carry.
|
|
std::string ts(double seconds);
|
|
|
|
enum class BinauralMode : std::uint32_t { Off = 0, Near = 1, Far = 2, Mid = 3, Unspecified = 4 };
|
|
|
|
bool binaural_mode_from_name(const char* name, BinauralMode* out);
|
|
|
|
// ``trim`` is the OAMD trim element of the programme; when it is present the
|
|
// AXML carries the Dolby master-file block (content info, trim records, warp
|
|
// mode) and the dbmd chunk carries the per-configuration records and the warp
|
|
// code.
|
|
std::string build_axml(const std::vector<Track>& tracks, double duration_sec, std::uint32_t rate,
|
|
const oamd::OamdTrim* trim = nullptr);
|
|
|
|
std::string build_chna();
|
|
|
|
Status build_dbmd(std::uint32_t object_count, BinauralMode mode, std::string* out,
|
|
const oamd::OamdTrim* trim = nullptr);
|
|
|
|
} // namespace joc::adm
|