feat: wire V4 QBIN host API into RasterArraySource
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/particle/field/field_binding.hpp>
|
||||
#include <mbgl/particle/field/offline_fixture_particle_adapter.hpp>
|
||||
#include <mbgl/particle/ingress/qbin_v2_decoder.hpp>
|
||||
#include <mbgl/style/source.hpp>
|
||||
|
||||
#include <chrono>
|
||||
@@ -142,6 +144,24 @@ enum class RasterArrayHostFieldSubmitResult : int8_t {
|
||||
|
||||
const char* rasterArrayHostFieldSubmitResultName(RasterArrayHostFieldSubmitResult);
|
||||
|
||||
// Stable outcome for the isolated QBIN V4 Host ingress. This is deliberately
|
||||
// separate from the legacy V3 host-field result above: V4 does not populate a
|
||||
// renderer-facing T0/T1 timeline.
|
||||
enum class RasterArrayEncodedFieldSubmitResult : int8_t {
|
||||
RejectedDecode = -1,
|
||||
RejectedContract = -2,
|
||||
RejectedInvalidFieldKey = -3,
|
||||
RejectedIdentityConflict = -4,
|
||||
RejectedStaleRevision = -5,
|
||||
RejectedIncompatible = -6,
|
||||
RejectedCapacity = -7,
|
||||
AcceptedInserted = 1,
|
||||
AcceptedReplacedRevision = 2,
|
||||
Duplicate = 3,
|
||||
};
|
||||
|
||||
const char* rasterArrayEncodedFieldSubmitResultName(RasterArrayEncodedFieldSubmitResult);
|
||||
|
||||
class RasterArraySource final : public Source {
|
||||
public:
|
||||
RasterArraySource(std::string id,
|
||||
@@ -181,6 +201,25 @@ public:
|
||||
// Clears producer-owned Host ingress state while retaining the Source and
|
||||
// its Style layers for a subsequent T0/T1 submission.
|
||||
bool clearHostFields();
|
||||
|
||||
// V4 QBIN ingress is a parallel, Core-only owner. It retains per-field
|
||||
// series and a requested forecast clock but never writes V3 T0/T1/MIX or
|
||||
// renderer snapshots.
|
||||
RasterArrayEncodedFieldSubmitResult submitEncodedField(
|
||||
const std::string& fieldKey,
|
||||
const particle::ingress::EncodedFieldRuntimeMetadata& runtimeMetadata,
|
||||
const particle::ResolvedFieldProfileContract& contract,
|
||||
const std::vector<uint8_t>& rawQbinBytes);
|
||||
void setColorBinding(particle::ColorBinding);
|
||||
void setParticleBinding(particle::ParticleBinding);
|
||||
bool setRequestedForecastTime(uint64_t timestampMs);
|
||||
void setForecastPlaybackState(particle::ForecastPlaybackState);
|
||||
bool setForecastPlaybackSpeed(float);
|
||||
bool advanceForecastClock(uint64_t elapsedMs);
|
||||
particle::ColorProjectionResult resolveColorProjection() const;
|
||||
particle::ParticleProjectionResult resolveParticleProjection() const;
|
||||
bool clearEncodedField(const std::string& fieldKey);
|
||||
void clearAllEncodedFields();
|
||||
// Producer-facing timestamp seek. Core alone selects T0/T1 and MIX.
|
||||
bool seekRuntimeTimelineToTimestamp(uint64_t timestamp);
|
||||
// Low-frequency JNI commands for the Source-owned validation timeline.
|
||||
@@ -234,6 +273,12 @@ private:
|
||||
uint64_t runtimeUpdateSequence = 0;
|
||||
std::shared_ptr<RasterArrayTimelineRuntime> timeline;
|
||||
RasterArrayTargetFps targetFps = RasterArrayTargetFps::Auto;
|
||||
// Deliberately independent from `timeline`: V4 bindings retain Host intent
|
||||
// across clear operations and resolve their own field-keyed windows.
|
||||
particle::EncodedFieldStore encodedFieldStore;
|
||||
particle::ForecastClock forecastClock;
|
||||
std::optional<particle::ColorBinding> colorBinding;
|
||||
std::optional<particle::ParticleBinding> particleBinding;
|
||||
mapbox::base::WeakPtrFactory<Source> weakFactory{this};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user