Sync the kernel copy with the bed layout map and the stream path
This commit is contained in:
1 parent
9dca991e03
commit
b43ee8f685
17 files changed
+227
-26
No files matched your search
@@ -151,6 +151,14 @@ Status build_dbmd(std::uint32_t object_count, BinauralMode mode, std::string* ou
|
||||
for (std::size_t i = 5u + 262u; i < segment10.size(); ++i) {
|
||||
segment10[i] = static_cast<char>(0x84);
|
||||
}
|
||||
// Nine 15-byte configuration trims start at byte 7; the first byte of each
|
||||
// carries the auto-trim flag in bit 0 (1 = automatic, 0 = manual). The
|
||||
// default is automatic, so a freshly rendered master opens with automatic
|
||||
// trims in the renderer.
|
||||
for (std::size_t layout = 0; layout < 9; ++layout) {
|
||||
const std::size_t flag = 7u + 15u * layout;
|
||||
segment10[flag] = static_cast<char>(static_cast<unsigned char>(segment10[flag]) | 0x01u);
|
||||
}
|
||||
const std::size_t object_modes = 4u + 2u + 1u + 9u * 15u + object_count;
|
||||
for (std::uint32_t i = 10; i < std::min<std::uint32_t>(object_count, 10u + kObjectCount); ++i) {
|
||||
const std::size_t index = object_modes + i;
|
||||
|
||||
@@ -236,6 +236,9 @@ void TrajectoryBuilder::submit_frame(std::int64_t frame_index, const oamd::OamdU
|
||||
ramp_samples = static_cast<std::int64_t>(update->ramp_duration_samples);
|
||||
}
|
||||
for (int object = 1; object <= kObjectCount; ++object) {
|
||||
if (fixed_[object - 1]) {
|
||||
continue; // 固定 bed 声道:位置由布局给出,不跟 OAMD 更新
|
||||
}
|
||||
double x = 0.0;
|
||||
double y = 0.0;
|
||||
double z = 0.0;
|
||||
@@ -260,6 +263,18 @@ Status TrajectoryBuilder::build(std::int64_t total_samples, TrajectoryMode mode,
|
||||
for (int object = 1; object <= kObjectCount; ++object) {
|
||||
Track track;
|
||||
track.name = "JOC_Object_" + std::to_string(object);
|
||||
if (fixed_[object - 1]) {
|
||||
Keyframe block;
|
||||
block.rtime_samples = 0;
|
||||
block.x = fixed_xyz_[object - 1][0];
|
||||
block.y = fixed_xyz_[object - 1][1];
|
||||
block.z = fixed_xyz_[object - 1][2];
|
||||
block.duration_samples = total_samples;
|
||||
block.interpolation_samples = 0;
|
||||
track.blocks.push_back(block);
|
||||
out->push_back(std::move(track));
|
||||
continue;
|
||||
}
|
||||
const Status status =
|
||||
(mode == TrajectoryMode::Compact)
|
||||
? expand_compact(events_[object - 1], total_samples, rate_, block_,
|
||||
|
||||
@@ -38,6 +38,18 @@ public:
|
||||
|
||||
Status build(std::int64_t total_samples, TrajectoryMode mode, std::vector<Track>* out) const;
|
||||
|
||||
// bed 声道是固定通道:OAMD 不给位置,整片静止在声明的 bed 方位。
|
||||
void set_fixed_position(int object_index, double x, double y, double z) {
|
||||
if (object_index < 1 || object_index > kObjectCount) {
|
||||
return;
|
||||
}
|
||||
const int slot = object_index - 1;
|
||||
fixed_[slot] = true;
|
||||
fixed_xyz_[slot][0] = x;
|
||||
fixed_xyz_[slot][1] = y;
|
||||
fixed_xyz_[slot][2] = z;
|
||||
}
|
||||
|
||||
const std::vector<OamdEvent>& events(int object_index) const { return events_[object_index]; }
|
||||
std::uint32_t rate() const { return rate_; }
|
||||
std::int64_t object_delay_samples() const { return object_delay_; }
|
||||
@@ -50,6 +62,8 @@ private:
|
||||
std::vector<OamdEvent> events_[kObjectCount];
|
||||
bool has_previous_[kObjectCount] = {};
|
||||
double previous_[kObjectCount][3] = {};
|
||||
bool fixed_[kObjectCount] = {};
|
||||
double fixed_xyz_[kObjectCount][3] = {};
|
||||
};
|
||||
|
||||
Status expand_compact(const std::vector<OamdEvent>& events, std::int64_t total_samples, std::uint32_t rate,
|
||||
|
||||
Reference in new issue
Block a user