feat: add v2 multi-plane field ingress
This commit is contained in:
@@ -739,13 +739,44 @@ RasterArrayHostFieldSubmitResult RasterArraySource::submitHostField(const std::s
|
||||
return RasterArrayHostFieldSubmitResult::RejectedAdapter;
|
||||
}
|
||||
|
||||
auto snapshot = std::move(*decoded.snapshot);
|
||||
Log::Info(Event::Render,
|
||||
"ParticleField: event=HOST_FIELD_LEGACY_VECTOR_ONLY sourceId=" + getID() +
|
||||
" payloadBytes=" + std::to_string(payload.size()));
|
||||
return submitDecodedHostField(std::move(*decoded.snapshot));
|
||||
}
|
||||
|
||||
RasterArrayHostFieldSubmitResult RasterArraySource::submitHostField(
|
||||
const std::string& metadataText,
|
||||
const particle::ParticleFieldPayloadBundle& payloads) {
|
||||
const auto bytes = [](const std::optional<std::vector<char>>& plane) {
|
||||
return plane ? std::to_string(plane->size()) : std::string("absent");
|
||||
};
|
||||
Log::Info(Event::Render,
|
||||
"ParticleField: event=HOST_FIELD_V2_SUBMIT_REQUEST sourceId=" + getID() + " metadataBytes=" +
|
||||
std::to_string(metadataText.size()) + " scalarBytes=" + bytes(payloads.scalar) +
|
||||
" vectorBytes=" + bytes(payloads.vector) + " validityBytes=" + bytes(payloads.validity));
|
||||
if (!impl().hostFieldSubmission) {
|
||||
return RasterArrayHostFieldSubmitResult::RejectedSourceMode;
|
||||
}
|
||||
auto decoded = particle::LocalParticleFieldFeed::load(metadataText, payloads);
|
||||
if (!decoded) {
|
||||
Log::Warning(Event::Render,
|
||||
"ParticleField: event=HOST_FIELD_V2_SUBMIT_REJECTED sourceId=" + getID() +
|
||||
" result=REJECTED_ADAPTER errorCode=" + particle::particleFieldAdapterErrorName(decoded.error) +
|
||||
" error=" + decoded.message);
|
||||
return RasterArrayHostFieldSubmitResult::RejectedAdapter;
|
||||
}
|
||||
return submitDecodedHostField(std::move(*decoded.snapshot));
|
||||
}
|
||||
|
||||
RasterArrayHostFieldSubmitResult RasterArraySource::submitDecodedHostField(particle::ParticleFieldSnapshot snapshot) {
|
||||
Log::Info(Event::Render,
|
||||
"ParticleField: event=HOST_FIELD_SNAPSHOT_READY sourceId=" + getID() + " fieldId=" + snapshot.fieldID +
|
||||
" generation=" + std::to_string(snapshot.generation) +
|
||||
" validTime=" + std::to_string(snapshot.validTime) + " width=" + std::to_string(snapshot.width) +
|
||||
" height=" + std::to_string(snapshot.height) +
|
||||
" layout=interleaved-uv encoding=float32-le payloadBytes=" + std::to_string(payload.size()));
|
||||
" height=" + std::to_string(snapshot.height) + " scalar=" +
|
||||
(snapshot.hasScalar() ? "present" : "absent") + " vector=" +
|
||||
(snapshot.hasVector() ? "present" : "absent") + " validity=present");
|
||||
|
||||
std::shared_ptr<const particle::ParticleFieldSnapshot> previous;
|
||||
if (timeline) {
|
||||
|
||||
Reference in New Issue
Block a user