video

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package video provides graph-native ingress and observation-cadence policy for camera, screen, and general video sources. It deliberately performs no narration and chooses no agent response policy: its raw-image output is the existing image.FrameBatch contract consumed by perception.VisualObserver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptiveObservationDescriptor

func AdaptiveObservationDescriptor() element.Descriptor

func CancelType

func CancelType() element.Type

func DecisionType

func DecisionType() element.Type

func Descriptors

func Descriptors() []element.Descriptor

func FactoryRegistrations

func FactoryRegistrations() ([]graphruntime.FactoryRegistration, error)

func FrameIngressDescriptor

func FrameIngressDescriptor() element.Descriptor

FrameIngressDescriptor is a deliberately tiny scheduling boundary. A graph connects its outputs with => to make capture loss visible in Graph IR while its receiver keeps an external lossless boundary drained with no policy or provider work on that path.

func FrameReferenceType

func FrameReferenceType() element.Type

func ImageBatchType

func ImageBatchType() element.Type

func InlineFrameType

func InlineFrameType() element.Type

func PolicyOutcomeType

func PolicyOutcomeType() element.Type

func PolicyStateType

func PolicyStateType() element.Type

func ReferenceBatchType

func ReferenceBatchType() element.Type

func RefreshType

func RefreshType() element.Type

func RegisterDescriptors

func RegisterDescriptors(catalog *resolve.Catalog) error

func RegisterFactories

func RegisterFactories(registry *graphruntime.Registry) error

func SourceEndType

func SourceEndType() element.Type

func SourceStartType

func SourceStartType() element.Type

func TimingTickType

func TimingTickType() element.Type

Types

type AdaptiveObservationConfig

type AdaptiveObservationConfig struct {
	Source           string      `json:"source"`
	Mode             CadenceMode `json:"mode,omitempty"`
	FixedIntervalMS  int64       `json:"fixed_interval_ms,omitempty"`
	MinIntervalMS    int64       `json:"min_interval_ms,omitempty"`
	MaxIntervalMS    int64       `json:"max_interval_ms,omitempty"`
	ChangeThreshold  float64     `json:"change_threshold,omitempty"`
	MaxFrameBytes    int         `json:"max_frame_bytes,omitempty"`
	MaxChangeSamples int         `json:"max_change_samples,omitempty"`
	MaxMetadataBytes int         `json:"max_metadata_bytes,omitempty"`
	TerminalMemory   int         `json:"terminal_memory,omitempty"`
}

type CadenceMode

type CadenceMode string
const (
	CadenceFixed    CadenceMode = "fixed"
	CadenceAdaptive CadenceMode = "adaptive"
	CadenceManual   CadenceMode = "manual"
)

type Cancel

type Cancel struct {
	Source         string `json:"source"`
	StreamID       string `json:"stream_id"`
	SourceRevision uint64 `json:"source_revision"`
	CanceledNS     uint64 `json:"canceled_ns"`
	Reason         string `json:"reason,omitempty"`
}

type DecisionKind

type DecisionKind string
const (
	DecisionObserve DecisionKind = "observe"
	DecisionSkip    DecisionKind = "skip"
)

type FrameReference

type FrameReference struct {
	Source         string `json:"source"`
	StreamID       string `json:"stream_id"`
	SourceRevision uint64 `json:"source_revision"`
	Index          uint64 `json:"index"`
	CapturedNS     uint64 `json:"captured_ns"`
	Reference      string `json:"reference"`
	MIMEType       string `json:"mime_type"`
	Width          int    `json:"width,omitempty"`
	Height         int    `json:"height,omitempty"`
	Bytes          int    `json:"bytes,omitempty"`
	// Fingerprint is a source-authored immutable revision/hash token. Adaptive
	// cadence compares it for equality; it is never interpreted as authority.
	Fingerprint string `json:"fingerprint"`
}

FrameReference is a capability-free pointer to media held elsewhere. It is emitted on a distinct typed output and never silently promoted into raw image bytes or observer-authority text.

type InlineFrame

type InlineFrame struct {
	StreamID       string               `json:"stream_id"`
	SourceRevision uint64               `json:"source_revision"`
	Frame          coreperception.Frame `json:"frame"`
}

InlineFrame carries one immutable image frame. The wrapper binds the frame to a stream generation; Frame.Source, Frame.Index, and Frame.CapturedNS are checked again rather than trusted through duck typing.

type ObservationDecision

type ObservationDecision struct {
	Kind           DecisionKind `json:"kind"`
	Mode           CadenceMode  `json:"mode"`
	Reason         string       `json:"reason"`
	Source         string       `json:"source"`
	StreamID       string       `json:"stream_id"`
	SourceRevision uint64       `json:"source_revision"`
	FrameKind      string       `json:"frame_kind,omitempty"`
	FrameIndex     uint64       `json:"frame_index,omitempty"`
	FrameItemID    string       `json:"frame_item_id,omitempty"`
	TriggerItemID  string       `json:"trigger_item_id"`
	AtNS           uint64       `json:"at_ns"`
	ChangeScore    float64      `json:"change_score,omitempty"`
	NextDueNS      uint64       `json:"next_due_ns,omitempty"`
	Forced         bool         `json:"forced,omitempty"`
}

type ObservationPolicyState

type ObservationPolicyState struct {
	Sequence              uint64      `json:"sequence"`
	Phase                 PolicyPhase `json:"phase"`
	Mode                  CadenceMode `json:"mode"`
	Source                string      `json:"source"`
	StreamID              string      `json:"stream_id,omitempty"`
	SessionID             string      `json:"session_id,omitempty"`
	SourceRevision        uint64      `json:"source_revision,omitempty"`
	SourceStartItemID     string      `json:"source_start_item_id,omitempty"`
	LatestKind            string      `json:"latest_kind,omitempty"`
	LatestItemID          string      `json:"latest_item_id,omitempty"`
	LatestIndex           uint64      `json:"latest_index,omitempty"`
	LatestCapturedNS      uint64      `json:"latest_captured_ns,omitempty"`
	LastObservedIndex     uint64      `json:"last_observed_index,omitempty"`
	LastObservedNS        uint64      `json:"last_observed_ns,omitempty"`
	LastTickNS            uint64      `json:"last_tick_ns,omitempty"`
	NextDueNS             uint64      `json:"next_due_ns,omitempty"`
	ChangeScore           float64     `json:"change_score,omitempty"`
	RefreshArmed          bool        `json:"refresh_armed,omitempty"`
	AcceptedFrames        uint64      `json:"accepted_frames"`
	SupersededFrames      uint64      `json:"superseded_frames"`
	RejectedFrames        uint64      `json:"rejected_frames"`
	Observations          uint64      `json:"observations"`
	SkippedTicks          uint64      `json:"skipped_ticks"`
	TerminalTombstones    int         `json:"terminal_tombstones"`
	TerminalMemoryLimit   int         `json:"terminal_memory_limit"`
	MaxRetainedFrameBytes int         `json:"max_retained_frame_bytes"`
}

ObservationPolicyState is payload-free, bounded inspection state. It never exposes raw bytes, an external reference, or a media capability.

type OutcomeKind

type OutcomeKind string
const (
	OutcomeSucceeded OutcomeKind = "succeeded"
	OutcomeRefused   OutcomeKind = "refused"
	OutcomeCanceled  OutcomeKind = "canceled"
	OutcomeIgnored   OutcomeKind = "ignored"
)

type PolicyOutcome

type PolicyOutcome struct {
	Kind           OutcomeKind `json:"kind"`
	Operation      string      `json:"operation"`
	Source         string      `json:"source,omitempty"`
	StreamID       string      `json:"stream_id,omitempty"`
	SourceRevision uint64      `json:"source_revision,omitempty"`
	FrameIndex     uint64      `json:"frame_index,omitempty"`
	Code           string      `json:"code,omitempty"`
	Message        string      `json:"message,omitempty"`
	Terminal       bool        `json:"terminal"`
}

type PolicyPhase

type PolicyPhase string
const (
	PhaseIdle     PolicyPhase = "idle"
	PhaseWatching PolicyPhase = "watching"
	PhaseEnded    PolicyPhase = "ended"
	PhaseCanceled PolicyPhase = "canceled"
)

type ReferenceBatch

type ReferenceBatch struct {
	StreamID   string           `json:"stream_id"`
	References []FrameReference `json:"references"`
}

type Refresh

type Refresh struct {
	Source         string `json:"source"`
	StreamID       string `json:"stream_id"`
	SourceRevision uint64 `json:"source_revision"`
	RequestedNS    uint64 `json:"requested_ns"`
	Reason         string `json:"reason,omitempty"`
}

Refresh arms one forced observation. It does not bypass explicit timing: the next causally later TimingTick performs the observation. The separate VisualRefresh output lets an existing VisualObserver arm its own content gate before that later batch arrives.

type SourceEnd

type SourceEnd struct {
	Source         string `json:"source"`
	StreamID       string `json:"stream_id"`
	SourceRevision uint64 `json:"source_revision"`
	EndedNS        uint64 `json:"ended_ns"`
	Reason         string `json:"reason,omitempty"`
}

type SourceKind

type SourceKind string
const (
	SourceCamera SourceKind = "camera"
	SourceScreen SourceKind = "screen"
	SourceVideo  SourceKind = "video"
)

type SourceStart

type SourceStart struct {
	Source               string     `json:"source"`
	StreamID             string     `json:"stream_id"`
	Kind                 SourceKind `json:"kind"`
	SourceRevision       uint64     `json:"source_revision"`
	OpenedNS             uint64     `json:"opened_ns"`
	NonBackpressurable   bool       `json:"non_backpressurable,omitempty"`
	ExpectedMIMEType     string     `json:"expected_mime_type,omitempty"`
	ExternalReferenceURI string     `json:"external_reference_uri,omitempty"`
}

SourceStart establishes the exact source generation accepted by one policy instance. A later generation must increase SourceRevision. OpenedNS is source-monotonic time and is the initial cadence anchor.

type TimingTick

type TimingTick struct {
	Source         string `json:"source"`
	StreamID       string `json:"stream_id"`
	SourceRevision uint64 `json:"source_revision"`
	NowNS          uint64 `json:"now_ns"`
}

TimingTick is the only input that advances fixed/adaptive cadence. The element creates no timer and never consults wall time for policy decisions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL