feat(filter_protocol): Filter Editor SDK contract + registry service#122
Open
pabloinigoblasco wants to merge 1 commit into
Open
feat(filter_protocol): Filter Editor SDK contract + registry service#122pabloinigoblasco wants to merge 1 commit into
pabloinigoblasco wants to merge 1 commit into
Conversation
cb85861 to
c31f1c5
Compare
c31f1c5 to
ae50933
Compare
5 tasks
Exposes the FilterTransform contract and the FilterRegistryService as a
shared cross-DSO surface so the host (PJ4) and the Filter Editor toolbox
plugin can agree on a single set of builtin transforms — same registry,
same instances, no duplicated factories.
- pj_plugins/filter_protocol/sdk:
- FilterTransform + builtin_transforms (12 vendored stateful operators:
scale, offset, abs, derivative, integral, moving_average, moving_rms,
moving_variance, outlier_removal, samples_counter, binary_filter,
time_since_previous, none).
- FilterTransformFactory: typed registry keyed by string id; create()
returns shared_ptr<FilterTransform> with a deleter that pins the
library_owner (cross-DSO lifetime safety).
- FilterRegistryService C ABI + FilterRegistryView C++ wrapper that
plugins use to register transforms during bind() and resolve them
later. Live instances bridged via a static catalogue so the per-id
deleter handed back to plugins can free them after the host shuts
down.
- pj_plugins/host/filter_registry_host.hpp: thin adapter that wraps a
FilterTransformFactory in the service vtable, with a noexcept-correct
C ABI and idempotent unregister.
6f44d81 to
c3c9ec2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SDK surface for the Filter Editor: the abstract
FilterTransformcontract plugins implement, the 12 builtin strategy classes vendored header-only, and thepj.filter_registry.v1host service through which plugins register their classes and consumers resolve transforms by id at runtime.What this PR delivers
pj_plugins/sdk/filter_transform.hpp— abstractFilterTransforminterface. Streaming-friendly:calculateNextPoint(SISO),appendTail(chunked, default loopscalculateNextPoint, classes override for O(Δsamples)),applyBatch(one-shot). PlussaveParams/loadParams(JSON) andclone(). POD inputs/outputs only (PJ::sdk::Point2+std::stringJSON).pj_plugins/sdk/builtin_transforms.hpp— 12 strategies, header-only. Mirrors PJ3'sTransformFunction_SISOcatalogue:NoneTransform,AbsoluteTransform,ScaleTransform,DerivativeTransform,IntegralTransformMovingAverageTransform,MovingRMSTransform,MovingVarianceTransformOutlierRemovalTransform,SamplesCounterTransform,BinaryFilterTransform,TimeSincePreviousTransformpj_plugins/sdk/filter_transform_factory.hpp— id → (create_fn,delete_fn,library_owner) registry.create(id)returns ashared_ptr<FilterTransform>whose deleter pairs with the entry's deleter and pins thelibrary_ownerref, so cross-DSO destruction happens on the side that did thenewand the registering DSO stays loaded while any of its entries is reachable.pj_plugins/sdk/filter_registry_abi.h+filter_registry_service.hpp— C ABI fat-pointer forpj.filter_registry.v1plus the typedFilterRegistryView(registerTransform<Class>(id, owner)/create(id)/registeredIds()) andTraitsforServiceRegistrylookup.pj_plugins/host/filter_registry_host.hpp— in-process adapter wrapping aFilterTransformFactoryas the C-ABI service ctx. A host instantiates one, exposes it viaServiceRegistryBuilder, plugins consume it from theirbind().pj_base/point2.hpp— liftPJ::sdk::Point2out ofpj_base/builtin/image_annotations.hppinto its own header (struct layout unchanged). Lets filter-protocol pull the type without dragging in image-annotations.tags—PluginDescriptorandRuntimeToolboxPluginnow carry atagsstring vector parsed frommanifest.json's"tags"array. Lets the host route generic actions (e.g. a plot's right-click "Apply Filter…") to whichever toolbox declares the matching tag.Versioning
Additive vs the previous installed surface — no existing header, struct layout, or signature changes. Required release level when merged: MINOR.
Stack
pj-official-pluginsPR — Filter Editor toolbox plugin.PJ4PR — Filter Editor host integration.Test plan
./build.sh+ctest: 44/44 pass.#include "pj_plugins/sdk/filter_transform.hpp"resolves transitively fromplotjuggler_sdk::plugin_sdk.