Contracts
Builder-level validation rules and reports. More...
Classes Index
| struct | ValidationContext |
|
Context passed to contracts during validation. More... | |
| class | Contract |
|
A single validation rule applied to an ordered node list. More... | |
| class | ContractRegistry |
|
Holds a set of Contracts and runs them to produce a ValidationReport. More... | |
| struct | ContractPortSpec |
|
Per-port contract: the shape/type/segment requirements for one input or output. More... | |
| struct | ContractFieldSpec |
|
Per-field contract: where the field value comes from and the override policy. More... | |
| struct | NodeContractDefinition |
|
Bundle of port and field specs that fully describes a Node's contract. More... | |
| struct | ValidationIssue |
| class | ValidationReport |
|
Report produced by running a ContractRegistry. More... | |
Enumerations Index
| enum class | MemoryContract { ... } |
|
How a Node (or Graph) wants buffer memory to be sourced/handed back. More... | |
| enum class | CapsMemory { ... } |
|
Memory class to advertise in GStreamer caps. More... | |
| enum class | ContractFieldSource { ... } |
|
Where the value of a contract field originates. More... | |
| enum class | ContractOverridePolicy { ... } |
|
Whether the Builder may override a contract field at build time. More... | |
| enum class | ValidationSeverity { ... } |
|
Severity level for validation issues. More... | |
Functions Index
| std::shared_ptr< Contract > | NonEmptyPipeline () |
|
Ensures the node list is not empty. More... | |
| std::shared_ptr< Contract > | NoNullNodes () |
|
Ensures there are no null node pointers in the node list. More... | |
| std::shared_ptr< Contract > | SinkLastForRun (std::string sink_kind="Output") |
|
Ensures the configured sink kind exists and is last when ctx.mode == Run. More... | |
| std::shared_ptr< Contract > | RtspRequiresSource (std::string source_kind="StillImageInput") |
|
Ensures an RTSP source node exists when ctx.mode == Rtsp. More... | |
| ContractRegistry | DefaultRegistry () |
|
Reasonable default set of builder-level contracts. More... | |
Description
Builder-level validation rules and reports.
Enumerations
CapsMemory
| strong |
Memory class to advertise in GStreamer caps.
- Enumeration values
-
Any Don't constrain memory class in caps (= 0) SystemMemory Force caps to advertise memory:SystemMemory
Any means "don't constrain in caps"; SystemMemory forces the caps to carry memory:SystemMemory so upstream/downstream negotiation picks CPU-mappable buffers.
Definition at line 54 of file ContractTypes.h.
ContractFieldSource
| strong |
Where the value of a contract field originates.
- Enumeration values
-
Fixed Value is hard-coded in the contract definition BuilderOption Value comes from a builder-level option/argument ModelOnly Value is supplied by the model file (e.g., MPK contract) InputOnly Value is determined by external input only UpstreamOnly Value is derived from the upstream Node's output spec GraphOwned Value is owned by the enclosing Graph (cross-Node)
Used by the Builder to decide whether a field is fully bound at definition time, supplied by a builder option, derived from upstream caps, baked into a model file, or owned by the Graph as a whole.
Definition at line 31 of file NodeContractDefinition.h.
ContractOverridePolicy
| strong |
Whether the Builder may override a contract field at build time.
- Enumeration values
-
Forbidden Field cannot be overridden; attempts are validation errors BuilderOnly Builder code may override; user-facing API may not
Definition at line 44 of file NodeContractDefinition.h.
MemoryContract
| strong |
How a Node (or Graph) wants buffer memory to be sourced/handed back.
- Enumeration values
Drives the runner's behavior at output time and contributes to caps negotiation: requiring CPU-mappable memory forces a (potentially copying) conversion, while PreferDeviceZeroCopy lets the runner keep device memory whenever possible.
Definition at line 30 of file ContractTypes.h.
ValidationSeverity
| strong |
Severity level for validation issues.
- Enumeration values
-
Info Informational only; never blocks a run (= 0) Warning Soft contract violation; pipeline may still run Error Hard contract violation; pipeline must not run
Definition at line 29 of file ValidationReport.h.
Functions
DefaultRegistry()
| inline |
Reasonable default set of builder-level contracts.
Bundles NonEmptyPipeline, NoNullNodes, SinkLastForRun, and RtspRequiresSource into a fresh registry. Keep this purely structural (no GStreamer); domain-specific contracts should be added on top.
- Returns
New ContractRegistry populated with the default contracts.
Definition at line 213 of file Validators.h.
NonEmptyPipeline()
| inline |
Ensures the node list is not empty.
Issues EMPTY_PIPELINE error when validated against an empty node list.
- Returns
Shared pointer to a fresh Contract instance.
Definition at line 42 of file Validators.h.
NoNullNodes()
| inline |
Ensures there are no null node pointers in the node list.
Issues a NULL_NODE error per offending index.
- Returns
Shared pointer to a fresh Contract instance.
Definition at line 71 of file Validators.h.
RtspRequiresSource()
| inline |
Ensures an RTSP source node exists when ctx.mode == Rtsp.
Builder-level: we only check presence of StillImageInput (or another configured kind). Issues RTSP_SOURCE_MISSING if no Node of the expected kind is found in the node list.
- Parameters
-
source_kind The Node kind expected to act as the RTSP source.
- Returns
Shared pointer to a fresh Contract instance.
Definition at line 162 of file Validators.h.
SinkLastForRun()
| inline |
Ensures the configured sink kind exists and is last when ctx.mode == Run.
This is the builder-level version of the "sink last" contract described in the architecture. Issues SINK_NOT_LAST if the last Node isn't of the expected kind, and MULTIPLE_SINKS if a sink-kind Node is found earlier in the chain.
- Parameters
-
sink_kind The Node kind expected as the terminal (default "Output").
- Returns
Shared pointer to a fresh Contract instance.
Definition at line 106 of file Validators.h.
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.