Documentation
¶
Index ¶
- Variables
- func AllocDeviceBytes(size int) (unsafe.Pointer, error)
- func AllocRGBBuffer(outW, outH int) (unsafe.Pointer, error)
- func BlendFTB(ctx *Context, dst, src *GPUFrame, position float64) error
- func BlendFTBP210(ctx *Context, dst, src *GPUFrame, position float64) error
- func BlendMix(ctx *Context, dst, a, b *GPUFrame, position float64) error
- func BlendMixP210(ctx *Context, dst, a, b *GPUFrame, position float64) error
- func BlendStinger(ctx *Context, dst, base, overlay, alpha *GPUFrame) error
- func BlendStingerP210(ctx *Context, dst, base, overlay, alpha *GPUFrame) error
- func BlendWipe(ctx *Context, dst, a, b, maskBuf *GPUFrame, position float64, ...) error
- func BlendWipeMap(ctx *Context, dst, srcA, srcB, gradMap *GPUFrame, cfg WipeMapBlendConfig) error
- func BlendWipeMapP210(ctx *Context, dst, srcA, srcB, gradMap *GPUFrame, cfg WipeMapBlendConfig) error
- func BlendWipeP210(ctx *Context, dst, a, b, maskBuf *GPUFrame, position float64, ...) error
- func BuildLumaKeyLUT(lowClip, highClip, softness float32) [256]byte
- func ChromaKey(ctx *Context, frame *GPUFrame, maskBuf *GPUFrame, cfg ChromaKeyConfig) error
- func ChromaKeyP210(ctx *Context, frame *GPUFrame, maskBuf *GPUFrame, cfg ChromaKeyConfig) error
- func CloseWorkQueue(q *GPUWorkQueue)
- func ColorGradeLUT3D(ctx *Context, frame *GPUFrame, lutDevPtr uintptr, lutSize int, ...) error
- func ColorGradeLUT3DP210(ctx *Context, frame *GPUFrame, lutDevPtr uintptr, lutSize int, ...) error
- func ConvertNV12ToP210(ctx *Context, dst, src *GPUFrame) error
- func ConvertP210ToP010MSB(ctx *Context, dst, src *GPUFrame) error
- func CopyGPUFrame(dst, src *GPUFrame) error
- func CopyGPUFrameOn(dst, src *GPUFrame, q *GPUWorkQueue) error
- func CopyHostToDevice(devPtr, hostPtr unsafe.Pointer, size int) error
- func CopyNV12FromDevice(_ *GPUFrame, _, _ uintptr, _, _, _ int) error
- func CopyP016ToNV12FromDevice(_ *GPUFrame, _, _ uintptr, _, _, _ int) error
- func DSKCompositeFullFrame(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, alphaScale float64) error
- func DSKCompositeFullFrameOcc(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, alphaScale float64, ...) error
- func DSKCompositeFullFrameP210(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, alphaScale float64) error
- func DSKCompositeRect(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, rect Rect, ...) error
- func DSKCompositeRectOcc(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, rect Rect, ...) error
- func DSKCompositeRectP210(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, rect Rect, ...) error
- func DSKOverlayP210(ctx *Context, frame *GPUFrame, rgba []byte, ...) error
- func DVE3DComposite(ctx *Context, dst, src *GPUFrame, t3d *dve.Transform3D, invMVP dve.Matrix4x4, ...) error
- func DVE3DCompositeP210(ctx *Context, dst, src *GPUFrame, t3d *dve.Transform3D, invMVP dve.Matrix4x4, ...) error
- func DVEComposite(ctx *Context, dst, src *GPUFrame, transform dve.Transform, ...) error
- func DVECompositeP210(ctx *Context, dst, src *GPUFrame, transform dve.Transform, ...) error
- func DVEDefocusBlur(ctx *Context, frame *GPUFrame, defocusRadius float64) error
- func Download(ctx *Context, yuv []byte, frame *GPUFrame, width, height int) error
- func Download10(ctx *Context, frame *GPUFrame, dst []byte, width, height int) error
- func DownloadMaskU8(dst []byte, devPtr unsafe.Pointer, size int) error
- func DownloadP210ToV210(ctx *Context, v210 []byte, src *GPUFrame, width, height int) error
- func DownloadRGBBuffer(dst []float32, devPtr unsafe.Pointer, outW, outH int) error
- func DownloadV210(ctx *Context, v210 []byte, src *GPUFrame, width, height int) error
- func DrawBorder(ctx *Context, frame *GPUFrame, rect Rect, color YUVColor, thickness int) error
- func DrawBorderP210(ctx *Context, frame *GPUFrame, rect Rect, colorY, colorCb, colorCr uint16, ...) error
- func FRUCAvailable() bool
- func FillBlack(ctx *Context, frame *GPUFrame) error
- func FillBlackP210(ctx *Context, frame *GPUFrame) error
- func FillColor(ctx *Context, frame *GPUFrame, color YUVColor) error
- func FillColorP210(ctx *Context, frame *GPUFrame, y, cb, cr uint16) error
- func FillRect(ctx *Context, frame *GPUFrame, rect Rect, color YUVColor) error
- func FillRectP210(ctx *Context, frame *GPUFrame, rect Rect, colorY, colorCb, colorCr uint16) error
- func FreeDeviceBytes(ptr unsafe.Pointer)
- func FreeLUT3D(devPtr uintptr)
- func FreeOverlay(overlay *GPUOverlay)
- func FreeRGBBuffer(buf unsafe.Pointer)
- func FuseOcclusion(ctx *Context, output, depth, samMask uintptr, ...) error
- func GPUBlendFTBDispatch(ctx *Context, dst, src *GPUFrame, position float64) error
- func GPUBlendMixDispatch(ctx *Context, dst, a, b *GPUFrame, position float64) error
- func GPUBlendStingerDispatch(ctx *Context, dst, base, overlay, alpha *GPUFrame) error
- func GPUBlendWipeDispatch(ctx *Context, dst, a, b, maskBuf *GPUFrame, position float64, ...) error
- func GPUBlendWipeMapDispatch(ctx *Context, dst, srcA, srcB, gradMap *GPUFrame, cfg WipeMapBlendConfig) error
- func GPUChromaKeyDispatch(ctx *Context, frame, maskBuf *GPUFrame, cfg ChromaKeyConfig) error
- func GPUDVE3DCompositeDispatch(ctx *Context, dst, src *GPUFrame, t3d *dve.Transform3D, invMVP dve.Matrix4x4, ...) error
- func GPUDVECompositeDispatch(ctx *Context, dst, src *GPUFrame, transform dve.Transform, ...) error
- func GPUDownloadDispatch(ctx *Context, frame *GPUFrame, data []byte, width, height int) error
- func GPUDrawBorderDispatch(ctx *Context, frame *GPUFrame, rect Rect, color YUVColor, thickness int) error
- func GPUFillBlackDispatch(ctx *Context, frame *GPUFrame) error
- func GPUFillColorDispatch(ctx *Context, frame *GPUFrame, color YUVColor) error
- func GPUFillRectDispatch(ctx *Context, frame *GPUFrame, rect Rect, color YUVColor) error
- func GPUGaussianBlurDispatch(ctx *Context, dst, src *GPUFrame, radius int) error
- func GPULumaKeyDispatch(ctx *Context, frame, maskBuf *GPUFrame, lut [256]byte) error
- func GPUPIPCompositeDispatch(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64) error
- func GPUPIPCompositeWithCropDispatch(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64, ...) error
- func GPUSTMapWarpDispatch(ctx *Context, dst, src *GPUFrame, stmap *GPUSTMap) error
- func GPUScaleDispatch(ctx *Context, dst, src *GPUFrame) error
- func GPUScaleLanczos3Dispatch(ctx *Context, dst, src *GPUFrame) error
- func GPUUploadDispatch(ctx *Context, frame *GPUFrame, data []byte, width, height int) error
- func GaussianBlur(ctx *Context, dst, src *GPUFrame, radius int) error
- func GaussianBlurP210(ctx *Context, dst, src *GPUFrame, radius int) error
- func LumaKey(ctx *Context, frame *GPUFrame, maskBuf *GPUFrame, lut [256]byte) error
- func LumaKeyP210(ctx *Context, frame *GPUFrame, maskBuf *GPUFrame, lut [256]byte) error
- func MaskEMA(output, prev, curr unsafe.Pointer, alpha float32, size int, stream uintptr) error
- func MaskErode3x3(dst, src unsafe.Pointer, width, height int, stream uintptr) error
- func MaskFloatToU8Upscale(dstPtr unsafe.Pointer, dstW, dstH int, srcPtr unsafe.Pointer, srcW, srcH int, ...) error
- func MemoryStatsExtended(ctx *Context) map[string]any
- func NV12ToV210(ctx *Context, v210DevPtr uintptr, v210Stride int, src *GPUFrame, ...) error
- func PIPComposite(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64) error
- func PIPCompositeP210(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64) error
- func PIPCompositeP210WithCrop(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64, ...) error
- func PIPCompositeWithCrop(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64, ...) error
- func PreprocessNV12ToRGB(ctx *Context, rgbOut unsafe.Pointer, src *GPUFrame, outW, outH int) error
- func PreprocessNV12ToRGBNHWC(ctx *Context, rgbOut unsafe.Pointer, src *GPUFrame, outW, outH int) error
- func ProbeGPUFrame(ctx *Context, frame *GPUFrame, dst []byte) error
- func STMapWarp(ctx *Context, dst, src *GPUFrame, stmap *GPUSTMap) error
- func STMapWarpGlobalMem(ctx *Context, dst, src *GPUFrame, stmap *GPUSTMap) error
- func STMapWarpP210(ctx *Context, dst, src *GPUFrame, stmapS, stmapT []float32, width, height int) error
- func STMapWarpP210Map(ctx *Context, dst, src *GPUFrame, stmap *GPUSTMap) error
- func Scale(ctx *Context, dst, src *GPUFrame, quality ScaleQuality) error
- func ScaleBilinear(ctx *Context, dst, src *GPUFrame) error
- func ScaleBilinearOn(ctx *Context, dst, src *GPUFrame, q *GPUWorkQueue) error
- func ScaleBilinearP210(ctx *Context, dst, src *GPUFrame) error
- func ScaleLanczos3(ctx *Context, dst, src *GPUFrame) error
- func ScaleLanczos3P210(ctx *Context, dst, src *GPUFrame) error
- func ScaleNV12ToP210(ctx *Context, dst, src *GPUFrame) error
- func ScaleP210ToNV12On(ctx *Context, dst, src *GPUFrame, q *GPUWorkQueue) error
- func SharpenLuma(ctx *Context, frame *GPUFrame, amount float32) error
- func SyncDefaultStream() error
- func SyncWorkQueue(q *GPUWorkQueue) error
- func TRTDTypeSize(dtype int) int
- func TensorBufferSize(info TensorInfo) int
- func Upload(ctx *Context, frame *GPUFrame, yuv []byte, width, height int) error
- func Upload10(ctx *Context, frame *GPUFrame, yuv422p10 []byte, width, height int) error
- func UploadBytes(devPtr unsafe.Pointer, data []byte) error
- func UploadLUT3D(data []float32) (uintptr, error)
- func UploadV210(ctx *Context, dst *GPUFrame, v210 []byte, width, height int) error
- func UploadV210ToP210(ctx *Context, dst *GPUFrame, v210 []byte, width, height int) error
- func UploadYUV420PToP210(ctx *Context, frame *GPUFrame, yuv []byte, width, height int) error
- func V210LineStride(width int) int
- func V210ToNV12(ctx *Context, dst *GPUFrame, v210DevPtr uintptr, v210Stride, width, height int) error
- type AISegmentConfig
- type BorderSnapshot
- type CUDATexture
- type ChromaKeyConfig
- type ColorGradeState
- type CompositorState
- type Context
- func (c *Context) Backend() string
- func (c *Context) CUDAContext() unsafe.Pointer
- func (c *Context) Close() error
- func (c *Context) DeviceName() string
- func (c *Context) DeviceProperties() DeviceProperties
- func (c *Context) EncStream() uintptr
- func (c *Context) MemoryStats() MemoryStats
- func (c *Context) Pool() *FramePool
- func (c *Context) SetPool(pool *FramePool)
- func (c *Context) Stream() uintptr
- func (c *Context) Sync() error
- type DeviceProperties
- type EnabledKeySnapshot
- type FRUC
- type FramePool
- type GPUAnimatedSTMap
- type GPUDecoder
- type GPUEncoder
- func (e *GPUEncoder) Close()
- func (e *GPUEncoder) EncodeCPU(yuv []byte, pts int64, forceIDR bool) ([]byte, bool, error)
- func (e *GPUEncoder) EncodeGPU(frame *GPUFrame, forceIDR bool) ([]byte, bool, error)
- func (e *GPUEncoder) EncodeGPUOn(frame *GPUFrame, forceIDR bool, q *GPUWorkQueue) ([]byte, bool, error)
- func (e *GPUEncoder) IsHEVC() bool
- func (e *GPUEncoder) IsHWFrames() bool
- func (e *GPUEncoder) IsNativeVT() bool
- type GPUFrame
- type GPUFrameFormat
- type GPUOverlay
- type GPUPipeline
- func (p *GPUPipeline) Build(width, height, pitch int, nodes []GPUPipelineNode) error
- func (p *GPUPipeline) BypassState() map[string]bool
- func (p *GPUPipeline) Close() error
- func (p *GPUPipeline) Pool() *FramePool
- func (p *GPUPipeline) Run(frame *GPUFrame) error
- func (p *GPUPipeline) RunWithUpload(yuv []byte, width, height int, pts int64) (*GPUFrame, error)
- func (p *GPUPipeline) SetBypass(nodeName string, bypass bool) error
- func (p *GPUPipeline) SetThumbnailStore(store ThumbnailStore)
- func (p *GPUPipeline) Snapshot() map[string]any
- func (p *GPUPipeline) Wait()
- type GPUPipelineNode
- func NewGPUAISegmentNode(ctx *Context, pool *FramePool, state SegmentationState) GPUPipelineNode
- func NewGPUColorGradeNode(ctx *Context, state ColorGradeState) GPUPipelineNode
- func NewGPUCompositorNode(ctx *Context, compositor CompositorState) GPUPipelineNode
- func NewGPUEncodeNode(ctx *Context, encoder *GPUEncoder, forceIDR *atomic.Bool, ...) GPUPipelineNode
- func NewGPUKeyNode(ctx *Context, pool *FramePool, bridge KeyBridge) GPUPipelineNode
- func NewGPULayoutNode(ctx *Context, pool *FramePool, layout LayoutState) GPUPipelineNode
- func NewGPUNeuralKeyNode(ctx *Context, pool *FramePool, state NeuralKeyState, enginePath string) GPUPipelineNode
- func NewGPUPassthroughNode(name string, active bool) GPUPipelineNode
- func NewGPUPreviewEncodeNode(ctx *Context, previewW, previewH, bitrate, fpsNum, fpsDen int, ...) GPUPipelineNode
- func NewGPURawSinkNode(ctx *Context, sink *atomic.Pointer[RawSinkFunc]) GPUPipelineNode
- func NewGPUSTMapNode(ctx *Context, pool *FramePool, registry STMapState) GPUPipelineNode
- func NewGPUSharpnessNode(ctx *Context, state SharpnessState) GPUPipelineNode
- type GPUSTMap
- type GPUSourceManager
- func (m *GPUSourceManager) AcquireNV12Tmp(sourceKey string, w, h int) (*GPUFrame, error)
- func (m *GPUSourceManager) AliasSource(dstKey, srcKey string) bool
- func (m *GPUSourceManager) Close()
- func (m *GPUSourceManager) CurrentFrame(sourceKey string) *GPUFrame
- func (m *GPUSourceManager) GetFrame(sourceKey string) *GPUFrame
- func (m *GPUSourceManager) IngestGPUFrame(sourceKey string, frame *GPUFrame, pts int64)
- func (m *GPUSourceManager) IngestYUV(sourceKey string, yuv []byte, w, h int, pts int64)
- func (m *GPUSourceManager) Pool() *FramePool
- func (m *GPUSourceManager) ReadCachedFrame(sourceKey string) (yuv []byte, w, h int, pts int64)
- func (m *GPUSourceManager) RegisterSource(sourceKey string, w, h int, preview *PreviewConfig)
- func (m *GPUSourceManager) RemoveSource(sourceKey string)
- func (m *GPUSourceManager) SetSegmenter(seg Segmenter)
- func (m *GPUSourceManager) SetSourceColorGrade(provider SourceColorGradeProvider)
- func (m *GPUSourceManager) Snapshot() map[string]any
- type GPUWorkQueue
- type KeyBridge
- type LayoutState
- type MemoryStats
- type NeuralKeyEngine
- func (nke *NeuralKeyEngine) Close()
- func (nke *NeuralKeyEngine) Infer(frame *GPUFrame, keyCb, keyCr uint8, similarity, smoothness float32) error
- func (nke *NeuralKeyEngine) InferAndComposite(programFrame, fillFrame *GPUFrame, keyCb, keyCr uint8, ...) error
- func (nke *NeuralKeyEngine) WarmupDone() bool
- type NeuralKeySnapshot
- type NeuralKeyState
- type OcclusionFuseParams
- type OptixContext
- func (c *OptixContext) BuildIAS(instances []OptixInstance, stream unsafe.Pointer) (*OptixIAS, error)
- func (c *OptixContext) BuildTriangleGAS(vertices []float32, indices []uint32, stream unsafe.Pointer) (*OptixGAS, error)
- func (c *OptixContext) Close()
- func (c *OptixContext) CreateModule(ptxSource []byte) (*OptixModule, error)
- func (c *OptixContext) CreatePipeline(config OptixPipelineConfig) (*OptixPipeline, error)
- type OptixDenoiser
- type OptixGAS
- type OptixIAS
- type OptixInstance
- type OptixLaunchParams
- type OptixModule
- type OptixPipeline
- type OptixPipelineConfig
- type PipelineMetrics
- type PreviewConfig
- type PreviewEncodeForceIDR
- type PreviewEncoder
- type RawSinkFunc
- type Rect
- type STMapState
- type ScaleQuality
- type SegmentationEngine
- func (se *SegmentationEngine) ClearPendingConfig(key string)
- func (se *SegmentationEngine) Close()
- func (se *SegmentationEngine) DisableSource(key string)
- func (se *SegmentationEngine) EnableSource(key string, w, h int, smoothing float32) error
- func (se *SegmentationEngine) HasPendingConfig(key string) bool
- func (se *SegmentationEngine) IsEnabled(key string) bool
- func (se *SegmentationEngine) MaskDevPtrForSource(key string) uintptr
- func (se *SegmentationEngine) MaskForSource(key string) *GPUFrame
- func (se *SegmentationEngine) PendingSmoothing(key string) float32
- func (se *SegmentationEngine) Segment(key string, frame *GPUFrame)
- func (se *SegmentationEngine) SetPendingConfig(key string, smoothing float32)
- type SegmentationProxy
- func (p *SegmentationProxy) ClearPendingConfig(key string)
- func (p *SegmentationProxy) Close()
- func (p *SegmentationProxy) DisableSource(key string)
- func (p *SegmentationProxy) EnableSource(key string, w, h int, smoothing float32) error
- func (p *SegmentationProxy) HandleMessage(msg *sidecar.Message)
- func (p *SegmentationProxy) HasPendingConfig(key string) bool
- func (p *SegmentationProxy) IsEnabled(key string) bool
- func (p *SegmentationProxy) MaskDevPtrForSource(key string) uintptr
- func (p *SegmentationProxy) MaskForSource(key string) *GPUFrame
- func (p *SegmentationProxy) PendingSmoothing(key string) float32
- func (p *SegmentationProxy) RecoverStaleSlots()
- func (p *SegmentationProxy) ReenableSources()
- func (p *SegmentationProxy) Segment(key string, frame *GPUFrame)
- func (p *SegmentationProxy) SetPendingConfig(key string, smoothing float32)
- type SegmentationState
- type Segmenter
- type SharpnessState
- type SlotSnapshot
- type SourceColorGradeProvider
- type SourceSTMapProvider
- type TRTBinding
- type TRTContext
- type TRTEngine
- func (e *TRTEngine) Close()
- func (e *TRTEngine) Handle() unsafe.Pointer
- func (e *TRTEngine) InputSize() int
- func (e *TRTEngine) NewContext() (*TRTContext, error)
- func (e *TRTEngine) NumIOTensors() int
- func (e *TRTEngine) OutputSize() int
- func (e *TRTEngine) TensorInfoAt(index int) (TensorInfo, error)
- type TRTEngineOpts
- type TRTEngineOptsV2
- type TensorInfo
- type ThumbnailStore
- type Timer
- type VisibleLayerSnapshot
- type WipeDirection
- type WipeMapBlendConfig
- type YUVColor
Constants ¶
This section is empty.
Variables ¶
var ColorBlack = YUVColor{16, 128, 128}
ColorBlack is BT.709 limited-range black.
var ErrGPUNotAvailable = errors.New("gpu: not available")
ErrGPUNotAvailable indicates the GPU backend is not available on this system.
var ErrOptiXNotAvailable = errors.New("gpu: OptiX not available (build without optix tag)")
ErrOptiXNotAvailable indicates OptiX is not available in the current build.
var ErrTensorRTNotAvailable = errors.New("gpu: TensorRT not available")
ErrTensorRTNotAvailable indicates TensorRT is not available.
Functions ¶
func AllocDeviceBytes ¶
AllocDeviceBytes returns ErrGPUNotAvailable on non-GPU builds.
func AllocRGBBuffer ¶
AllocRGBBuffer returns ErrGPUNotAvailable on non-GPU builds.
func BlendFTBP210 ¶
BlendFTBP210 returns ErrGPUNotAvailable on non-GPU builds.
func BlendMixP210 ¶
BlendMixP210 returns ErrGPUNotAvailable on non-GPU builds.
func BlendStinger ¶
BlendStinger returns ErrGPUNotAvailable on non-GPU builds.
func BlendStingerP210 ¶
BlendStingerP210 returns ErrGPUNotAvailable on non-GPU builds.
func BlendWipe ¶
func BlendWipe(ctx *Context, dst, a, b, maskBuf *GPUFrame, position float64, dir WipeDirection, softEdge int) error
BlendWipe returns ErrGPUNotAvailable on non-GPU builds.
func BlendWipeMap ¶
func BlendWipeMap(ctx *Context, dst, srcA, srcB, gradMap *GPUFrame, cfg WipeMapBlendConfig) error
BlendWipeMap returns ErrGPUNotAvailable on non-GPU builds.
func BlendWipeMapP210 ¶
func BlendWipeMapP210(ctx *Context, dst, srcA, srcB, gradMap *GPUFrame, cfg WipeMapBlendConfig) error
BlendWipeMapP210 returns ErrGPUNotAvailable on non-GPU builds.
func BlendWipeP210 ¶
func BlendWipeP210(ctx *Context, dst, a, b, maskBuf *GPUFrame, position float64, dir WipeDirection, softEdge int) error
BlendWipeP210 returns ErrGPUNotAvailable on non-GPU builds.
func BuildLumaKeyLUT ¶
BuildLumaKeyLUT creates a 256-byte lookup table for luma keying.
func ChromaKey ¶
func ChromaKey(ctx *Context, frame *GPUFrame, maskBuf *GPUFrame, cfg ChromaKeyConfig) error
ChromaKey returns ErrGPUNotAvailable on non-GPU builds.
func ChromaKeyP210 ¶
func ChromaKeyP210(ctx *Context, frame *GPUFrame, maskBuf *GPUFrame, cfg ChromaKeyConfig) error
ChromaKeyP210 returns ErrGPUNotAvailable on non-GPU builds.
func CloseWorkQueue ¶
func CloseWorkQueue(q *GPUWorkQueue)
CloseWorkQueue is a no-op on non-GPU builds.
func ColorGradeLUT3D ¶
func ColorGradeLUT3D(ctx *Context, frame *GPUFrame, lutDevPtr uintptr, lutSize int, intensity float32) error
ColorGradeLUT3D returns ErrGPUNotAvailable on non-GPU builds.
func ColorGradeLUT3DP210 ¶
func ColorGradeLUT3DP210(ctx *Context, frame *GPUFrame, lutDevPtr uintptr, lutSize int, intensity float32) error
ColorGradeLUT3DP210 returns ErrGPUNotAvailable on non-GPU builds.
func ConvertNV12ToP210 ¶
ConvertNV12ToP210 returns ErrGPUNotAvailable on non-GPU builds.
func ConvertP210ToP010MSB ¶
ConvertP210ToP010MSB returns ErrGPUNotAvailable on non-GPU builds.
func CopyGPUFrame ¶
CopyGPUFrame returns nil on non-GPU builds (no frames to copy).
func CopyGPUFrameOn ¶
func CopyGPUFrameOn(dst, src *GPUFrame, q *GPUWorkQueue) error
CopyGPUFrameOn returns ErrGPUNotAvailable on non-GPU builds.
func CopyHostToDevice ¶
CopyHostToDevice returns ErrGPUNotAvailable on non-GPU builds.
func CopyNV12FromDevice ¶
CopyNV12FromDevice is a no-op on non-GPU builds (NVDEC not available).
func CopyP016ToNV12FromDevice ¶
CopyP016ToNV12FromDevice is a no-op on non-GPU builds (NVDEC not available).
func DSKCompositeFullFrame ¶
func DSKCompositeFullFrame(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, alphaScale float64) error
DSKCompositeFullFrame returns ErrGPUNotAvailable on non-GPU builds.
func DSKCompositeFullFrameOcc ¶
func DSKCompositeFullFrameOcc(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, alphaScale float64, occPtr uintptr, occW, occH int) error
DSKCompositeFullFrameOcc returns ErrGPUNotAvailable on non-GPU builds.
func DSKCompositeFullFrameP210 ¶
func DSKCompositeFullFrameP210(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, alphaScale float64) error
DSKCompositeFullFrameP210 returns ErrGPUNotAvailable on non-GPU builds.
func DSKCompositeRect ¶
func DSKCompositeRect(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, rect Rect, alphaScale float64) error
DSKCompositeRect returns ErrGPUNotAvailable on non-GPU builds.
func DSKCompositeRectOcc ¶
func DSKCompositeRectOcc(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, rect Rect, alphaScale float64, occPtr uintptr, occW, occH int) error
DSKCompositeRectOcc returns ErrGPUNotAvailable on non-GPU builds.
func DSKCompositeRectP210 ¶
func DSKCompositeRectP210(ctx *Context, frame *GPUFrame, overlay *GPUOverlay, rect Rect, alphaScale float64) error
DSKCompositeRectP210 returns ErrGPUNotAvailable on non-GPU builds.
func DSKOverlayP210 ¶
func DSKOverlayP210(ctx *Context, frame *GPUFrame, rgba []byte, width, height, rgbaPitch, alphaScale256 int) error
DSKOverlayP210 returns ErrGPUNotAvailable on non-GPU builds.
func DVE3DComposite ¶
func DVE3DComposite(ctx *Context, dst, src *GPUFrame, t3d *dve.Transform3D, invMVP dve.Matrix4x4, srcW, srcH int, slotRect image.Rectangle, alpha256 int) error
DVE3DComposite returns ErrGPUNotAvailable on non-GPU builds.
func DVE3DCompositeP210 ¶
func DVE3DCompositeP210(ctx *Context, dst, src *GPUFrame, t3d *dve.Transform3D, invMVP dve.Matrix4x4, srcW, srcH int, slotRect image.Rectangle, alpha256 int) error
DVE3DCompositeP210 returns ErrGPUNotAvailable on non-GPU builds.
func DVEComposite ¶
func DVEComposite(ctx *Context, dst, src *GPUFrame, transform dve.Transform, invMatrix dve.Matrix3x3, srcW, srcH int, aabb image.Rectangle) error
DVEComposite returns ErrGPUNotAvailable on non-GPU builds.
func DVECompositeP210 ¶
func DVECompositeP210(ctx *Context, dst, src *GPUFrame, transform dve.Transform, invMatrix dve.Matrix3x3, srcW, srcH int, aabb image.Rectangle) error
DVECompositeP210 returns ErrGPUNotAvailable on non-GPU builds.
func DVEDefocusBlur ¶
DVEDefocusBlur returns ErrGPUNotAvailable on non-GPU builds.
func Download10 ¶
Download10 returns ErrGPUNotAvailable on non-GPU builds.
func DownloadMaskU8 ¶
DownloadMaskU8 returns ErrGPUNotAvailable on non-GPU builds.
func DownloadP210ToV210 ¶
DownloadP210ToV210 returns ErrGPUNotAvailable on non-GPU builds.
func DownloadRGBBuffer ¶
DownloadRGBBuffer returns ErrGPUNotAvailable on non-GPU builds.
func DownloadV210 ¶
DownloadV210 returns ErrGPUNotAvailable on non-GPU builds.
func DrawBorder ¶
DrawBorder returns ErrGPUNotAvailable on non-GPU builds.
func DrawBorderP210 ¶
func DrawBorderP210(ctx *Context, frame *GPUFrame, rect Rect, colorY, colorCb, colorCr uint16, thickness int) error
DrawBorderP210 returns ErrGPUNotAvailable on non-GPU builds.
func FillBlackP210 ¶
FillBlackP210 returns ErrGPUNotAvailable on non-GPU builds.
func FillColorP210 ¶
FillColorP210 returns ErrGPUNotAvailable on non-GPU builds.
func FillRectP210 ¶
FillRectP210 returns ErrGPUNotAvailable on non-GPU builds.
func FreeDeviceBytes ¶
FreeDeviceBytes is a no-op on non-GPU builds.
func FreeRGBBuffer ¶
FreeRGBBuffer is a no-op on non-GPU builds.
func FuseOcclusion ¶
func FuseOcclusion(ctx *Context, output, depth, samMask uintptr, width, height, depthW, depthH int, params OcclusionFuseParams) error
FuseOcclusion returns ErrGPUNotAvailable on non-GPU builds.
func GPUBlendFTBDispatch ¶
GPUBlendFTBDispatch performs a fade-to-black, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUBlendMixDispatch ¶
GPUBlendMixDispatch performs a uniform mix blend, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUBlendStingerDispatch ¶
GPUBlendStingerDispatch composites a stinger overlay, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUBlendWipeDispatch ¶
func GPUBlendWipeDispatch(ctx *Context, dst, a, b, maskBuf *GPUFrame, position float64, dir WipeDirection, softEdge int) error
GPUBlendWipeDispatch performs a wipe transition, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUBlendWipeMapDispatch ¶
func GPUBlendWipeMapDispatch(ctx *Context, dst, srcA, srcB, gradMap *GPUFrame, cfg WipeMapBlendConfig) error
GPUBlendWipeMapDispatch performs a gradient-map-driven wipe transition, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUChromaKeyDispatch ¶
func GPUChromaKeyDispatch(ctx *Context, frame, maskBuf *GPUFrame, cfg ChromaKeyConfig) error
GPUChromaKeyDispatch generates an alpha mask, picking the chroma key kernel by frame format. P210 program frames go through the 10-bit kernel; everything else through the legacy NV12 kernel.
func GPUDVE3DCompositeDispatch ¶
func GPUDVE3DCompositeDispatch(ctx *Context, dst, src *GPUFrame, t3d *dve.Transform3D, invMVP dve.Matrix4x4, srcW, srcH int, slotRect image.Rectangle, alpha256 int) error
GPUDVE3DCompositeDispatch composites a 3D DVE slot onto the destination frame, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUDVECompositeDispatch ¶
func GPUDVECompositeDispatch(ctx *Context, dst, src *GPUFrame, transform dve.Transform, invMatrix dve.Matrix3x3, srcW, srcH int, aabb image.Rectangle) error
GPUDVECompositeDispatch composites a DVE slot onto the destination frame, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUDownloadDispatch ¶
GPUDownloadDispatch downloads a GPU frame to a CPU planar buffer, selecting the correct kernel based on the frame's format.
- NV12: writes YUV420p, calls Download.
- P210: writes YUV422P10LE, calls Download10.
func GPUDrawBorderDispatch ¶
func GPUDrawBorderDispatch(ctx *Context, frame *GPUFrame, rect Rect, color YUVColor, thickness int) error
GPUDrawBorderDispatch draws a colored border outside the given rectangle, dispatching to the P210 or NV12 variant based on the frame's format. For P210, the 8-bit YUVColor is promoted to 10-bit (<<2).
func GPUFillBlackDispatch ¶
GPUFillBlackDispatch fills a frame with black, routing to the correct format.
func GPUFillColorDispatch ¶
GPUFillColorDispatch fills a frame with a constant YUV color, routing to the correct format. For P210, promotes 8-bit YUVColor values to 10-bit (<<2).
func GPUFillRectDispatch ¶
GPUFillRectDispatch fills a rectangular region with a constant color, dispatching to the P210 or NV12 variant based on the frame's format. For P210, the 8-bit YUVColor is promoted to 10-bit (<<2).
func GPUGaussianBlurDispatch ¶
GPUGaussianBlurDispatch returns ErrGPUNotAvailable on non-GPU builds.
func GPULumaKeyDispatch ¶
GPULumaKeyDispatch generates an alpha mask, picking the luma key kernel by frame format.
func GPUPIPCompositeDispatch ¶
GPUPIPCompositeDispatch composites a source into a destination rectangle, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUPIPCompositeWithCropDispatch ¶
func GPUPIPCompositeWithCropDispatch(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64, cropX, cropY, cropW, cropH int) error
GPUPIPCompositeWithCropDispatch composites a source sub-region into a destination rectangle, dispatching based on the destination frame's format.
func GPUSTMapWarpDispatch ¶
GPUSTMapWarpDispatch applies an ST map warp, dispatching to the P210 or NV12 variant based on the source frame's format.
func GPUScaleDispatch ¶
GPUScaleDispatch scales a GPU frame using bilinear interpolation, dispatching to the P210 or NV12 variant based on the source frame's format.
func GPUScaleLanczos3Dispatch ¶
GPUScaleLanczos3Dispatch scales a GPU frame using Lanczos-3 interpolation, dispatching to the P210 or NV12 variant based on the destination frame's format.
func GPUUploadDispatch ¶
GPUUploadDispatch uploads a CPU planar buffer to a GPU frame, selecting the correct kernel based on the frame's format.
- NV12: expects YUV420p (w*h*3/2 bytes), calls Upload.
- P210: expects YUV422P10LE (w*h*4 bytes), calls Upload10.
func GaussianBlur ¶
GaussianBlur returns ErrGPUNotAvailable on non-GPU builds.
func GaussianBlurP210 ¶
GaussianBlurP210 returns ErrGPUNotAvailable on non-GPU builds.
func LumaKeyP210 ¶
LumaKeyP210 returns ErrGPUNotAvailable on non-GPU builds.
func MaskErode3x3 ¶
MaskErode3x3 returns ErrGPUNotAvailable on non-GPU builds.
func MaskFloatToU8Upscale ¶
func MaskFloatToU8Upscale(dstPtr unsafe.Pointer, dstW, dstH int, srcPtr unsafe.Pointer, srcW, srcH int, stream uintptr) error
MaskFloatToU8Upscale returns ErrGPUNotAvailable on non-GPU builds.
func MemoryStatsExtended ¶
MemoryStatsExtended returns unavailable status on non-GPU builds.
func NV12ToV210 ¶
func NV12ToV210(ctx *Context, v210DevPtr uintptr, v210Stride int, src *GPUFrame, width, height int) error
NV12ToV210 returns ErrGPUNotAvailable on non-GPU builds.
func PIPComposite ¶
PIPComposite returns ErrGPUNotAvailable on non-GPU builds.
func PIPCompositeP210 ¶
PIPCompositeP210 returns ErrGPUNotAvailable on non-GPU builds.
func PIPCompositeP210WithCrop ¶
func PIPCompositeP210WithCrop(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64, cropX, cropY, cropW, cropH int) error
PIPCompositeP210WithCrop returns ErrGPUNotAvailable on non-GPU builds.
func PIPCompositeWithCrop ¶
func PIPCompositeWithCrop(ctx *Context, dst, src *GPUFrame, rect Rect, alpha float64, cropX, cropY, cropW, cropH int) error
PIPCompositeWithCrop returns ErrGPUNotAvailable on non-GPU builds.
func PreprocessNV12ToRGB ¶
PreprocessNV12ToRGB returns ErrGPUNotAvailable on non-GPU builds.
func PreprocessNV12ToRGBNHWC ¶
func PreprocessNV12ToRGBNHWC(ctx *Context, rgbOut unsafe.Pointer, src *GPUFrame, outW, outH int) error
PreprocessNV12ToRGBNHWC returns ErrGPUNotAvailable on non-GPU builds.
func ProbeGPUFrame ¶
ProbeGPUFrame is a no-op on non-GPU builds.
func STMapWarpGlobalMem ¶
STMapWarpGlobalMem returns ErrGPUNotAvailable on non-GPU builds.
func STMapWarpP210 ¶
func STMapWarpP210(ctx *Context, dst, src *GPUFrame, stmapS, stmapT []float32, width, height int) error
STMapWarpP210 returns ErrGPUNotAvailable on non-GPU builds.
func STMapWarpP210Map ¶
STMapWarpP210Map returns ErrGPUNotAvailable on non-GPU builds.
func Scale ¶
func Scale(ctx *Context, dst, src *GPUFrame, quality ScaleQuality) error
Scale returns ErrGPUNotAvailable on non-GPU builds.
func ScaleBilinear ¶
ScaleBilinear returns ErrGPUNotAvailable on non-GPU builds.
func ScaleBilinearOn ¶
func ScaleBilinearOn(ctx *Context, dst, src *GPUFrame, q *GPUWorkQueue) error
ScaleBilinearOn returns ErrGPUNotAvailable on non-GPU builds.
func ScaleBilinearP210 ¶
ScaleBilinearP210 returns ErrGPUNotAvailable on non-GPU builds.
func ScaleLanczos3 ¶
ScaleLanczos3 returns ErrGPUNotAvailable on non-GPU builds.
func ScaleLanczos3P210 ¶
ScaleLanczos3P210 returns ErrGPUNotAvailable on non-GPU builds.
func ScaleNV12ToP210 ¶
ScaleNV12ToP210 returns ErrGPUNotAvailable on non-GPU builds.
func ScaleP210ToNV12On ¶
func ScaleP210ToNV12On(ctx *Context, dst, src *GPUFrame, q *GPUWorkQueue) error
ScaleP210ToNV12On returns ErrGPUNotAvailable on non-GPU builds.
func SharpenLuma ¶
SharpenLuma returns ErrGPUNotAvailable on non-GPU builds.
func SyncDefaultStream ¶
func SyncDefaultStream() error
SyncDefaultStream returns ErrGPUNotAvailable on non-GPU builds.
func SyncWorkQueue ¶
func SyncWorkQueue(q *GPUWorkQueue) error
SyncWorkQueue is a no-op on non-GPU builds.
func TensorBufferSize ¶
func TensorBufferSize(info TensorInfo) int
TensorBufferSize returns 0 on non-TensorRT builds.
func UploadBytes ¶
UploadBytes returns ErrGPUNotAvailable on non-GPU builds.
func UploadLUT3D ¶
UploadLUT3D returns ErrGPUNotAvailable on non-GPU builds.
func UploadV210 ¶
UploadV210 returns ErrGPUNotAvailable on non-GPU builds.
func UploadV210ToP210 ¶
UploadV210ToP210 returns ErrGPUNotAvailable on non-GPU builds.
func UploadYUV420PToP210 ¶
UploadYUV420PToP210 returns ErrGPUNotAvailable on non-GPU builds.
func V210LineStride ¶
V210LineStride returns the byte stride for one line of V210 data.
Types ¶
type AISegmentConfig ¶
type AISegmentConfig struct {
Background string // "transparent"|"blur:N"|"color:RRGGBB"
Sensitivity float32 // 0.0-1.0 (maps to segmentation threshold)
EdgeSmooth float32 // 0.0-1.0 (maps to EMA temporal smoothing alpha)
}
AISegmentConfig holds the background replacement configuration for a source.
type BorderSnapshot ¶
BorderSnapshot holds border configuration for a layout slot.
type CUDATexture ¶
type CUDATexture struct{}
CUDATexture is a stub for non-OptiX builds.
func CreateCUDATexture ¶
func CreateCUDATexture(rgba []byte, width, height int) (*CUDATexture, error)
CreateCUDATexture returns ErrOptiXNotAvailable on non-OptiX builds.
func (*CUDATexture) Handle ¶
func (t *CUDATexture) Handle() uint64
Handle returns 0 on non-OptiX builds.
type ChromaKeyConfig ¶
type ChromaKeyConfig struct {
KeyCb, KeyCr uint8
Similarity float32
Smoothness float32
SpillSuppress float32
SpillReplaceCb uint8
SpillReplaceCr uint8
}
ChromaKeyConfig holds chroma key parameters.
type ColorGradeState ¶
type ColorGradeState interface {
HasGradingEnabled() bool
GradingLUTData() []float32 // 33^3 * 3 float32s (pre-parsed)
GradingLUTSize() int // cube dimension (e.g., 33)
GradingLUTGen() uint64 // generation counter for cache invalidation
GradingIntensity() float32 // 0.0-1.0
}
ColorGradeState provides color grading state to the GPU color grade node. Implemented by an adapter wrapping the colorGradeController.
type CompositorState ¶
type CompositorState interface {
HasActiveLayers() bool
SnapshotVisibleLayers() []VisibleLayerSnapshot
}
CompositorState provides graphics compositor state to the GPU DSK node. Implemented by an adapter wrapping graphics.Compositor.
type Context ¶
type Context struct{}
Context is a stub for non-GPU builds.
func NewContext ¶
NewContext returns ErrGPUNotAvailable on non-GPU builds.
func (*Context) CUDAContext ¶
CUDAContext returns nil on non-GPU builds.
func (*Context) DeviceName ¶
DeviceName returns "" on non-GPU builds.
func (*Context) DeviceProperties ¶
func (c *Context) DeviceProperties() DeviceProperties
DeviceProperties returns a zero-value DeviceProperties.
func (*Context) MemoryStats ¶
func (c *Context) MemoryStats() MemoryStats
MemoryStats returns zero stats on non-GPU builds.
type DeviceProperties ¶
type DeviceProperties struct {
Name string
ComputeCapability [2]int
TotalMemory int64
MultiprocessorCount int
MaxThreadsPerBlock int
}
DeviceProperties holds GPU device information.
type EnabledKeySnapshot ¶
type EnabledKeySnapshot struct {
SourceKey string
Type string // "chroma" or "luma"
KeyCb, KeyCr uint8
Similarity float32
Smoothness float32
SpillSuppress float32
SpillReplaceCb uint8
SpillReplaceCr uint8
LowClip float32
HighClip float32
Softness float32
FillYUV []byte // YUV420p fill frame (deep copy)
FillW, FillH int
}
EnabledKeySnapshot is a deep-copied snapshot of one enabled key's state.
type FRUC ¶
type FRUC struct{}
FRUC is a stub for non-GPU builds.
func (*FRUC) ComputeFlow ¶
ComputeFlow returns false on non-GPU builds.
func (*FRUC) Interpolate ¶
Interpolate returns ErrGPUNotAvailable on non-GPU builds.
type FramePool ¶
type FramePool struct{}
FramePool is a stub for non-GPU builds.
func NewFramePool ¶
NewFramePool returns ErrGPUNotAvailable on non-GPU builds.
func NewP210FramePool ¶
NewP210FramePool returns ErrGPUNotAvailable on non-GPU builds.
func (*FramePool) AllDevPtrs ¶
AllDevPtrs returns nil on non-GPU builds.
func (*FramePool) Format ¶
func (p *FramePool) Format() GPUFrameFormat
NewGPUFrameFromDevPtr creates a GPUFrame wrapping an external device pointer. On non-GPU builds this returns a frame with the given dimensions but no usable device pointer. Format returns the pixel format of frames in this pool.
type GPUAnimatedSTMap ¶
type GPUAnimatedSTMap struct{ Width, Height, FPS int }
GPUAnimatedSTMap is a stub for non-GPU builds.
func NewGPUAnimatedSTMap ¶
func NewGPUAnimatedSTMap(ctx *Context, sMaps, tMaps [][]float32, width, height, fps int) (*GPUAnimatedSTMap, error)
NewGPUAnimatedSTMap returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUAnimatedSTMap) CurrentFrame ¶
func (a *GPUAnimatedSTMap) CurrentFrame() *GPUSTMap
CurrentFrame returns nil on non-GPU builds.
func (*GPUAnimatedSTMap) FrameCount ¶
func (a *GPUAnimatedSTMap) FrameCount() int
FrameCount returns 0 on non-GPU builds.
func (*GPUAnimatedSTMap) Free ¶
func (a *GPUAnimatedSTMap) Free()
Free is a no-op on non-GPU builds.
type GPUDecoder ¶
type GPUDecoder struct{}
GPUDecoder is a stub for non-GPU builds.
func NewGPUDecoder ¶
func NewGPUDecoder(ctx *Context, threadCount int) (*GPUDecoder, error)
NewGPUDecoder returns ErrGPUNotAvailable on non-GPU builds.
type GPUEncoder ¶
type GPUEncoder struct{}
GPUEncoder is a stub for non-GPU builds.
func NewGPUEncoder ¶
func NewGPUEncoder(ctx *Context, width, height, fpsNum, fpsDen, bitrate int) (*GPUEncoder, error)
NewGPUEncoder returns ErrGPUNotAvailable on non-GPU builds.
func NewGPUEncoderForCodec ¶
func NewGPUEncoderForCodec(ctx *Context, width, height, fpsNum, fpsDen, bitrate int, pipelineCodec switcher.PipelineCodec, colorFormat switcher.PipelineColorFormat) (*GPUEncoder, error)
NewGPUEncoderForCodec returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUEncoder) EncodeGPUOn ¶
func (e *GPUEncoder) EncodeGPUOn(frame *GPUFrame, forceIDR bool, q *GPUWorkQueue) ([]byte, bool, error)
EncodeGPUOn returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUEncoder) IsHEVC ¶
func (e *GPUEncoder) IsHEVC() bool
IsHEVC returns false on non-GPU builds.
func (*GPUEncoder) IsHWFrames ¶
func (e *GPUEncoder) IsHWFrames() bool
IsHWFrames returns false on non-GPU builds.
func (*GPUEncoder) IsNativeVT ¶
func (e *GPUEncoder) IsNativeVT() bool
IsNativeVT returns false on non-GPU builds.
type GPUFrame ¶
type GPUFrame struct {
Width int
Height int
Pitch int
PTS int64
Format GPUFrameFormat
}
GPUFrame is a stub for non-GPU builds.
func NewGPUFrameFromDevPtr ¶
func NewGPUFrameFromDevPtr(_ uintptr, width, height, pitch int, pts int64, format GPUFrameFormat) *GPUFrame
func (*GPUFrame) FrameSize ¶
FrameSize returns the total byte size of the frame based on its format.
func (*GPUFrame) NV12Size ¶
NV12Size returns the total byte size assuming NV12 layout. Deprecated: Use FrameSize() which is format-aware.
func (*GPUFrame) UVPlaneHeight ¶
UVPlaneHeight returns the height of the UV/chroma plane.
func (*GPUFrame) UVPlaneOffset ¶
UVPlaneOffset returns the byte offset of the UV plane.
func (*GPUFrame) YPlaneOffset ¶
YPlaneOffset returns the byte offset of the Y plane (always 0).
type GPUFrameFormat ¶
type GPUFrameFormat int
GPUFrameFormat identifies the pixel format of a GPUFrame.
const ( // GPUFormatNV12 is 8-bit 4:2:0 semi-planar (Y uint8 + UV uint8 interleaved). // Y plane: pitch * height bytes. UV plane: pitch * height/2 bytes. // Total: pitch * height * 3/2. GPUFormatNV12 GPUFrameFormat = iota // GPUFormatP210 is 10-bit 4:2:2 semi-planar (Y uint16 + UV uint16 interleaved). // Y plane: pitch * height bytes (pitch = width*2 rounded to alignment). // UV plane: pitch * height bytes (full height for 4:2:2). // Total: pitch * height * 2. GPUFormatP210 )
func (GPUFrameFormat) String ¶
func (f GPUFrameFormat) String() string
String returns a human-readable name for the format.
type GPUOverlay ¶
type GPUOverlay struct {
Width, Height int
}
GPUOverlay is a stub for non-GPU builds.
func UploadOverlay ¶
func UploadOverlay(ctx *Context, rgba []byte, width, height int) (*GPUOverlay, error)
UploadOverlay returns ErrGPUNotAvailable on non-GPU builds.
type GPUPipeline ¶
type GPUPipeline struct{}
GPUPipeline is a stub for non-GPU builds.
func NewGPUPipeline ¶
func NewGPUPipeline(ctx *Context, pool *FramePool) *GPUPipeline
NewGPUPipeline returns a stub on non-GPU builds.
func (*GPUPipeline) Build ¶
func (p *GPUPipeline) Build(width, height, pitch int, nodes []GPUPipelineNode) error
Build returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUPipeline) BypassState ¶
func (p *GPUPipeline) BypassState() map[string]bool
BypassState returns empty state on non-GPU builds.
func (*GPUPipeline) Pool ¶
func (p *GPUPipeline) Pool() *FramePool
Pool returns nil on non-GPU builds.
func (*GPUPipeline) Run ¶
func (p *GPUPipeline) Run(frame *GPUFrame) error
Run returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUPipeline) RunWithUpload ¶
RunWithUpload returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUPipeline) SetBypass ¶
func (p *GPUPipeline) SetBypass(nodeName string, bypass bool) error
SetBypass returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUPipeline) SetThumbnailStore ¶
func (p *GPUPipeline) SetThumbnailStore(store ThumbnailStore)
SetThumbnailStore is a no-op on non-GPU builds.
func (*GPUPipeline) Snapshot ¶
func (p *GPUPipeline) Snapshot() map[string]any
Snapshot returns empty stats on non-GPU builds.
type GPUPipelineNode ¶
type GPUPipelineNode interface {
Name() string
Configure(width, height, pitch int) error
Active() bool
ProcessGPU(frame *GPUFrame) error
Err() error
Latency() time.Duration
Close() error
}
GPUPipelineNode is the interface for GPU pipeline processing nodes.
func NewGPUAISegmentNode ¶
func NewGPUAISegmentNode(ctx *Context, pool *FramePool, state SegmentationState) GPUPipelineNode
NewGPUAISegmentNode returns nil on non-TensorRT builds. The pipeline filters nil nodes, so this is safely excluded from the chain.
func NewGPUColorGradeNode ¶
func NewGPUColorGradeNode(ctx *Context, state ColorGradeState) GPUPipelineNode
NewGPUColorGradeNode returns nil on non-GPU builds.
func NewGPUCompositorNode ¶
func NewGPUCompositorNode(ctx *Context, compositor CompositorState) GPUPipelineNode
NewGPUCompositorNode returns nil on non-GPU builds.
func NewGPUEncodeNode ¶
func NewGPUEncodeNode(ctx *Context, encoder *GPUEncoder, forceIDR *atomic.Bool, onEncoded func([]byte, bool, int64)) GPUPipelineNode
NewGPUEncodeNode returns nil on non-GPU builds.
func NewGPUKeyNode ¶
func NewGPUKeyNode(ctx *Context, pool *FramePool, bridge KeyBridge) GPUPipelineNode
NewGPUKeyNode returns nil on non-GPU builds.
func NewGPULayoutNode ¶
func NewGPULayoutNode(ctx *Context, pool *FramePool, layout LayoutState) GPUPipelineNode
NewGPULayoutNode returns nil on non-GPU builds. The stub constructors are compiled but never called at runtime because initGPU returns nil, so wireGPUPipeline (which creates nodes) is skipped.
func NewGPUNeuralKeyNode ¶
func NewGPUNeuralKeyNode(ctx *Context, pool *FramePool, state NeuralKeyState, enginePath string) GPUPipelineNode
NewGPUNeuralKeyNode returns nil on non-TensorRT builds. The pipeline filters nil nodes, so this is safely excluded from the chain.
func NewGPUPassthroughNode ¶
func NewGPUPassthroughNode(name string, active bool) GPUPipelineNode
NewGPUPassthroughNode returns nil on non-GPU builds.
func NewGPUPreviewEncodeNode ¶
func NewGPUPreviewEncodeNode(ctx *Context, previewW, previewH, bitrate, fpsNum, fpsDen int, onEncoded func(data []byte, isIDR bool, pts int64)) GPUPipelineNode
NewGPUPreviewEncodeNode returns nil on non-GPU builds.
func NewGPURawSinkNode ¶
func NewGPURawSinkNode(ctx *Context, sink *atomic.Pointer[RawSinkFunc]) GPUPipelineNode
NewGPURawSinkNode returns nil on non-GPU builds.
func NewGPUSTMapNode ¶
func NewGPUSTMapNode(ctx *Context, pool *FramePool, registry STMapState) GPUPipelineNode
NewGPUSTMapNode returns nil on non-GPU builds. The stub constructors are compiled but never called at runtime because initGPU returns nil, so wireGPUPipeline (which creates nodes) is skipped.
func NewGPUSharpnessNode ¶
func NewGPUSharpnessNode(ctx *Context, state SharpnessState) GPUPipelineNode
NewGPUSharpnessNode returns nil on non-GPU builds.
type GPUSTMap ¶
type GPUSTMap struct{ Width, Height int }
GPUSTMap is a stub for non-GPU builds.
func UploadSTMap ¶
UploadSTMap returns ErrGPUNotAvailable on non-GPU builds.
type GPUSourceManager ¶
type GPUSourceManager struct{}
GPUSourceManager is a stub for non-GPU builds.
func NewGPUSourceManager ¶
func NewGPUSourceManager(ctx *Context, pool *FramePool, stmaps SourceSTMapProvider) *GPUSourceManager
NewGPUSourceManager returns nil on non-GPU builds.
func (*GPUSourceManager) AcquireNV12Tmp ¶
func (m *GPUSourceManager) AcquireNV12Tmp(sourceKey string, w, h int) (*GPUFrame, error)
AcquireNV12Tmp returns an error on non-GPU builds.
func (*GPUSourceManager) AliasSource ¶
func (m *GPUSourceManager) AliasSource(dstKey, srcKey string) bool
AliasSource is a no-op on non-GPU builds.
func (*GPUSourceManager) Close ¶
func (m *GPUSourceManager) Close()
Close is a no-op on non-GPU builds.
func (*GPUSourceManager) CurrentFrame ¶
func (m *GPUSourceManager) CurrentFrame(sourceKey string) *GPUFrame
CurrentFrame returns nil on non-GPU builds.
func (*GPUSourceManager) GetFrame ¶
func (m *GPUSourceManager) GetFrame(sourceKey string) *GPUFrame
GetFrame returns nil on non-GPU builds.
func (*GPUSourceManager) IngestGPUFrame ¶
func (m *GPUSourceManager) IngestGPUFrame(sourceKey string, frame *GPUFrame, pts int64)
IngestGPUFrame is a no-op on non-GPU builds.
func (*GPUSourceManager) IngestYUV ¶
func (m *GPUSourceManager) IngestYUV(sourceKey string, yuv []byte, w, h int, pts int64)
IngestYUV is a no-op on non-GPU builds.
func (*GPUSourceManager) Pool ¶
func (m *GPUSourceManager) Pool() *FramePool
Pool returns nil on non-GPU builds.
func (*GPUSourceManager) ReadCachedFrame ¶
func (m *GPUSourceManager) ReadCachedFrame(sourceKey string) (yuv []byte, w, h int, pts int64)
ReadCachedFrame returns nil on non-GPU builds.
func (*GPUSourceManager) RegisterSource ¶
func (m *GPUSourceManager) RegisterSource(sourceKey string, w, h int, preview *PreviewConfig)
RegisterSource is a no-op on non-GPU builds.
func (*GPUSourceManager) RemoveSource ¶
func (m *GPUSourceManager) RemoveSource(sourceKey string)
RemoveSource is a no-op on non-GPU builds.
func (*GPUSourceManager) SetSegmenter ¶
func (m *GPUSourceManager) SetSegmenter(seg Segmenter)
SetSegmenter is a no-op on non-GPU builds.
func (*GPUSourceManager) SetSourceColorGrade ¶
func (m *GPUSourceManager) SetSourceColorGrade(provider SourceColorGradeProvider)
SetSourceColorGrade is a no-op on non-GPU builds.
func (*GPUSourceManager) Snapshot ¶
func (m *GPUSourceManager) Snapshot() map[string]any
Snapshot returns empty stats on non-GPU builds.
type GPUWorkQueue ¶
type GPUWorkQueue struct {
// contains filtered or unexported fields
}
GPUWorkQueue represents an isolated GPU execution context. On Metal: wraps an MTLCommandQueue (serial command buffer submission). On CUDA: wraps a cudaStream_t (serial kernel/memcpy execution). On stub: nil handle (no GPU operations).
func NewWorkQueue ¶
func NewWorkQueue(ctx *Context) (*GPUWorkQueue, error)
NewWorkQueue returns ErrGPUNotAvailable on non-GPU builds.
func (*GPUWorkQueue) IsValid ¶
func (q *GPUWorkQueue) IsValid() bool
IsValid returns true if the work queue holds a non-nil GPU handle.
type KeyBridge ¶
type KeyBridge interface {
HasEnabledKeysWithFills() bool
HasEnabledKeys() bool // checks if any keys are configured+enabled, regardless of CPU fills
SnapshotEnabledKeys() []EnabledKeySnapshot
GPUFill(sourceKey string) *GPUFrame // returns ref'd frame from GPU cache, or nil
}
KeyBridge provides key processor state to the GPU key node. Implemented by an adapter wrapping graphics.KeyProcessorBridge.
type LayoutState ¶
type LayoutState interface {
Active() bool
SnapshotSlots() []SlotSnapshot
GPUFill(sourceKey string) *GPUFrame // returns ref'd frame from GPU cache, or nil
}
LayoutState provides layout compositor state to the GPU layout node. Implemented by an adapter wrapping dve.Compositor.
type MemoryStats ¶
MemoryStats holds GPU memory usage information.
type NeuralKeyEngine ¶
type NeuralKeyEngine struct{}
NeuralKeyEngine is a stub for non-TensorRT builds.
func NewNeuralKeyEngine ¶
func NewNeuralKeyEngine(ctx *Context, modelPath string, progW, progH int) (*NeuralKeyEngine, error)
NewNeuralKeyEngine returns ErrTensorRTNotAvailable on non-TensorRT builds.
func (*NeuralKeyEngine) Close ¶
func (nke *NeuralKeyEngine) Close()
Close is a no-op on non-TensorRT builds.
func (*NeuralKeyEngine) Infer ¶
func (nke *NeuralKeyEngine) Infer(frame *GPUFrame, keyCb, keyCr uint8, similarity, smoothness float32) error
Infer is a no-op on non-TensorRT builds.
func (*NeuralKeyEngine) InferAndComposite ¶
func (nke *NeuralKeyEngine) InferAndComposite(programFrame, fillFrame *GPUFrame, keyCb, keyCr uint8, similarity, smoothness float32) error
InferAndComposite is a no-op on non-TensorRT builds.
func (*NeuralKeyEngine) WarmupDone ¶
func (nke *NeuralKeyEngine) WarmupDone() bool
WarmupDone returns false on non-TensorRT builds.
type NeuralKeySnapshot ¶
type NeuralKeySnapshot struct {
SourceKey string
KeyColorY uint8
KeyColorCb uint8
KeyColorCr uint8
Similarity float32
Smoothness float32
// FillFrame is the source's GPU-cached NV12 frame (from GPU source manager).
// The neural key node runs inference on this frame and composites the result
// onto the program frame. Nil if the source has no cached frame yet.
FillFrame *GPUFrame
}
NeuralKeySnapshot holds a deep copy of neural key parameters for one source.
type NeuralKeyState ¶
type NeuralKeyState interface {
// HasNeuralKeys returns true when any source has type:"neural" key enabled.
HasNeuralKeys() bool
// SnapshotNeuralKeys returns a deep copy of all neural key configs,
// each with a reference to the source's GPU cached fill frame.
SnapshotNeuralKeys() []NeuralKeySnapshot
}
NeuralKeyState provides neural key configuration to the GPU pipeline node. Unlike the original design which only checked the program source, this interface returns ALL sources with neural keys enabled — matching the upstream key pattern where keyed sources are composited onto program.
Implementations must be safe for concurrent reads from the pipeline goroutine.
type OcclusionFuseParams ¶
type OcclusionFuseParams struct {
DepthNear float32 // depth threshold for foreground (default 0.3)
Softness float32 // transition softness (default 0.1, range 0.01-0.5)
}
OcclusionFuseParams controls the depth-to-occlusion mapping.
func DefaultOcclusionFuseParams ¶
func DefaultOcclusionFuseParams() OcclusionFuseParams
DefaultOcclusionFuseParams returns sensible defaults for occlusion fusion.
type OptixContext ¶
type OptixContext struct{}
OptixContext is a stub for non-OptiX builds.
func NewOptixContext ¶
func NewOptixContext(cudaCtx unsafe.Pointer) (*OptixContext, error)
NewOptixContext returns ErrOptiXNotAvailable on non-OptiX builds.
func (*OptixContext) BuildIAS ¶
func (c *OptixContext) BuildIAS(instances []OptixInstance, stream unsafe.Pointer) (*OptixIAS, error)
BuildIAS returns ErrOptiXNotAvailable on non-OptiX builds.
func (*OptixContext) BuildTriangleGAS ¶
func (c *OptixContext) BuildTriangleGAS(vertices []float32, indices []uint32, stream unsafe.Pointer) (*OptixGAS, error)
BuildTriangleGAS returns ErrOptiXNotAvailable on non-OptiX builds.
func (*OptixContext) CreateModule ¶
func (c *OptixContext) CreateModule(ptxSource []byte) (*OptixModule, error)
CreateModule returns ErrOptiXNotAvailable on non-OptiX builds.
func (*OptixContext) CreatePipeline ¶
func (c *OptixContext) CreatePipeline(config OptixPipelineConfig) (*OptixPipeline, error)
CreatePipeline returns ErrOptiXNotAvailable on non-OptiX builds.
type OptixDenoiser ¶
type OptixDenoiser struct{}
OptixDenoiser is a stub for non-OptiX builds.
func NewOptixDenoiser ¶
func NewOptixDenoiser(ctx *OptixContext, width, height int, temporal bool) (*OptixDenoiser, error)
NewOptixDenoiser returns ErrOptiXNotAvailable on non-OptiX builds.
func (*OptixDenoiser) Denoise ¶
func (d *OptixDenoiser) Denoise(noisyInput, cleanOutput, flowBuffer unsafe.Pointer, width, height int, stream unsafe.Pointer) error
Denoise returns ErrOptiXNotAvailable on non-OptiX builds.
func (*OptixDenoiser) Height ¶
func (d *OptixDenoiser) Height() int
Height returns 0 on non-OptiX builds.
func (*OptixDenoiser) Temporal ¶
func (d *OptixDenoiser) Temporal() bool
Temporal returns false on non-OptiX builds.
func (*OptixDenoiser) Width ¶
func (d *OptixDenoiser) Width() int
Width returns 0 on non-OptiX builds.
type OptixGAS ¶
type OptixGAS struct{}
OptixGAS is a stub for non-OptiX builds.
func (*OptixGAS) DeviceIndices ¶
DeviceIndices returns (0, 0) on non-OptiX builds.
func (*OptixGAS) DeviceVertices ¶
DeviceVertices returns (0, 0) on non-OptiX builds.
type OptixIAS ¶
type OptixIAS struct{}
OptixIAS is a stub for non-OptiX builds.
func (*OptixIAS) TraversableHandle ¶
TraversableHandle returns 0 on non-OptiX builds.
type OptixInstance ¶
type OptixInstance struct {
GAS *OptixGAS
Transform [12]float32
SBTOffset uint32
VisibilityMask uint32
}
OptixInstance describes a GAS instance in the scene with its transform.
type OptixLaunchParams ¶
type OptixLaunchParams struct {
OutputBuffer unsafe.Pointer
Width int
Height int
IASHandle unsafe.Pointer
CameraPos [3]float32
CameraU [3]float32
CameraV [3]float32
CameraW [3]float32
SamplesPerPixel int
FrameNumber int
Lights unsafe.Pointer
NumLights int
}
OptixLaunchParams specifies parameters for a ray tracing launch.
type OptixPipeline ¶
type OptixPipeline struct{}
OptixPipeline is a stub for non-OptiX builds.
func (*OptixPipeline) Launch ¶
func (p *OptixPipeline) Launch(params OptixLaunchParams, stream unsafe.Pointer) error
Launch returns ErrOptiXNotAvailable on non-OptiX builds.
func (*OptixPipeline) SetHitGroupData ¶
func (p *OptixPipeline) SetHitGroupData(index int, vertices, normals, texcoords, indices unsafe.Pointer, mat [3]float32, metallic, roughness float32, emission [3]float32, baseColorTex uint64, stream unsafe.Pointer) error
SetHitGroupData returns ErrOptiXNotAvailable on non-OptiX builds.
type OptixPipelineConfig ¶
type OptixPipelineConfig struct {
Module *OptixModule
RaygenEntry string
MissEntry string
ShadowMissEntry string
ClosestHitEntry string
AnyHitEntry string
MaxTraceDepth int
}
OptixPipelineConfig specifies shader entry points for pipeline creation.
type PipelineMetrics ¶
type PipelineMetrics struct{}
PipelineMetrics tracks GPU pipeline performance counters.
func (*PipelineMetrics) Snapshot ¶
func (m *PipelineMetrics) Snapshot() map[string]any
Snapshot returns empty stats on non-GPU builds.
type PreviewConfig ¶
type PreviewConfig struct {
Width, Height int
Bitrate int
FPSNum, FPSDen int
OnPreview func(data []byte, isIDR bool, pts int64)
}
PreviewConfig configures per-source GPU preview encoding.
type PreviewEncodeForceIDR ¶
type PreviewEncodeForceIDR interface {
ForceIDR()
}
PreviewEncodeForceIDR is the subset of gpuPreviewEncodeNode needed by the app layer to force IDR keyframes on program source cuts.
type PreviewEncoder ¶
type PreviewEncoder struct{}
PreviewEncoder is a stub for non-GPU builds.
func NewPreviewEncoder ¶
func NewPreviewEncoder(ctx *Context, srcW, srcH, dstW, dstH, bitrate, fpsNum, fpsDen int) (*PreviewEncoder, error)
NewPreviewEncoder returns ErrGPUNotAvailable on non-GPU builds.
type RawSinkFunc ¶
RawSinkFunc is a callback for raw YUV420p frames.
type STMapState ¶
type STMapState interface {
HasProgramMap() bool
ProgramMapName() string
ProgramSTArrays() (s, t []float32)
IsAnimated() bool
AdvanceAnimatedIndex() int
AnimatedSTArraysAt(idx int) (s, t []float32)
// ProgramGPUSnapshot returns an atomic snapshot of the program map state.
// All returned values are consistent (read under a single lock hold).
// The caller MUST call release() when done reading the S/T slices —
// Delete() is blocked from munmapping backing memory until release().
ProgramGPUSnapshot() (mapName string, animated bool, animIdx int, s, t []float32, release func())
}
STMapState provides ST map state to the GPU stmap node. Implemented by stmap.Registry directly (no circular dependency).
type ScaleQuality ¶
type ScaleQuality int
ScaleQuality selects the scaling algorithm.
const ( ScaleQualityBilinear ScaleQuality = iota ScaleQualityLanczos )
type SegmentationEngine ¶
type SegmentationEngine struct{}
SegmentationEngine is a stub for non-TensorRT builds.
func NewSegmentationEngine ¶
func NewSegmentationEngine(ctx *Context, modelPath string) (*SegmentationEngine, error)
NewSegmentationEngine returns nil and ErrTensorRTNotAvailable on non-TensorRT builds.
func (*SegmentationEngine) ClearPendingConfig ¶
func (se *SegmentationEngine) ClearPendingConfig(key string)
ClearPendingConfig is a no-op on non-TensorRT builds.
func (*SegmentationEngine) Close ¶
func (se *SegmentationEngine) Close()
Close is a no-op on non-TensorRT builds.
func (*SegmentationEngine) DisableSource ¶
func (se *SegmentationEngine) DisableSource(key string)
DisableSource is a no-op on non-TensorRT builds.
func (*SegmentationEngine) EnableSource ¶
func (se *SegmentationEngine) EnableSource(key string, w, h int, smoothing float32) error
EnableSource returns ErrTensorRTNotAvailable on non-TensorRT builds.
func (*SegmentationEngine) HasPendingConfig ¶
func (se *SegmentationEngine) HasPendingConfig(key string) bool
HasPendingConfig returns false on non-TensorRT builds.
func (*SegmentationEngine) IsEnabled ¶
func (se *SegmentationEngine) IsEnabled(key string) bool
IsEnabled returns false on non-TensorRT builds.
func (*SegmentationEngine) MaskDevPtrForSource ¶
func (se *SegmentationEngine) MaskDevPtrForSource(key string) uintptr
MaskDevPtrForSource returns 0 on non-TensorRT builds.
func (*SegmentationEngine) MaskForSource ¶
func (se *SegmentationEngine) MaskForSource(key string) *GPUFrame
MaskForSource returns nil on non-TensorRT builds.
func (*SegmentationEngine) PendingSmoothing ¶
func (se *SegmentationEngine) PendingSmoothing(key string) float32
PendingSmoothing returns 0 on non-TensorRT builds.
func (*SegmentationEngine) Segment ¶
func (se *SegmentationEngine) Segment(key string, frame *GPUFrame)
Segment is a no-op on non-TensorRT builds.
func (*SegmentationEngine) SetPendingConfig ¶
func (se *SegmentationEngine) SetPendingConfig(key string, smoothing float32)
SetPendingConfig is a no-op on non-TensorRT builds.
type SegmentationProxy ¶
type SegmentationProxy struct{}
SegmentationProxy is a stub for non-CUDA builds.
func NewSegmentationProxy ¶
func NewSegmentationProxy(host *sidecar.Host, pool *sidecar.CUDAGPUPool) *SegmentationProxy
NewSegmentationProxy returns nil on non-CUDA builds.
func (*SegmentationProxy) ClearPendingConfig ¶
func (p *SegmentationProxy) ClearPendingConfig(key string)
ClearPendingConfig is a no-op on non-CUDA builds.
func (*SegmentationProxy) Close ¶
func (p *SegmentationProxy) Close()
Close is a no-op on non-CUDA builds.
func (*SegmentationProxy) DisableSource ¶
func (p *SegmentationProxy) DisableSource(key string)
DisableSource is a no-op on non-CUDA builds.
func (*SegmentationProxy) EnableSource ¶
func (p *SegmentationProxy) EnableSource(key string, w, h int, smoothing float32) error
EnableSource returns an error on non-CUDA builds.
func (*SegmentationProxy) HandleMessage ¶
func (p *SegmentationProxy) HandleMessage(msg *sidecar.Message)
HandleMessage is a no-op on non-CUDA builds.
func (*SegmentationProxy) HasPendingConfig ¶
func (p *SegmentationProxy) HasPendingConfig(key string) bool
HasPendingConfig returns false on non-CUDA builds.
func (*SegmentationProxy) IsEnabled ¶
func (p *SegmentationProxy) IsEnabled(key string) bool
IsEnabled returns false on non-CUDA builds.
func (*SegmentationProxy) MaskDevPtrForSource ¶
func (p *SegmentationProxy) MaskDevPtrForSource(key string) uintptr
MaskDevPtrForSource returns 0 on non-CUDA builds.
func (*SegmentationProxy) MaskForSource ¶
func (p *SegmentationProxy) MaskForSource(key string) *GPUFrame
MaskForSource returns nil on non-CUDA builds.
func (*SegmentationProxy) PendingSmoothing ¶
func (p *SegmentationProxy) PendingSmoothing(key string) float32
PendingSmoothing returns 0 on non-CUDA builds.
func (*SegmentationProxy) RecoverStaleSlots ¶
func (p *SegmentationProxy) RecoverStaleSlots()
RecoverStaleSlots is a no-op on non-CUDA builds.
func (*SegmentationProxy) ReenableSources ¶
func (p *SegmentationProxy) ReenableSources()
ReenableSources is a no-op on non-CUDA builds.
func (*SegmentationProxy) Segment ¶
func (p *SegmentationProxy) Segment(key string, frame *GPUFrame)
Segment is a no-op on non-CUDA builds.
func (*SegmentationProxy) SetPendingConfig ¶
func (p *SegmentationProxy) SetPendingConfig(key string, smoothing float32)
SetPendingConfig is a no-op on non-CUDA builds.
type SegmentationState ¶
type SegmentationState interface {
// HasEnabledSources returns true if any source has AI segmentation active.
HasEnabledSources() bool
// ProgramSourceKey returns the current program source key.
ProgramSourceKey() string
// MaskForSource returns the latest GPU-resident segmentation mask for
// the source, with a reference taken; callers MUST Release() it when
// done. Returns nil if no mask is available. The returned GPUFrame is
// a uint8 single-plane mask (255 = foreground, 0 = background).
MaskForSource(key string) *GPUFrame
// ConfigForSource returns the AI segmentation config for a source.
// Returns nil if the source has no AI segmentation config.
ConfigForSource(key string) *AISegmentConfig
}
SegmentationState provides AI segmentation state for the GPU pipeline node. Implemented by an adapter bridging SegmentationEngine + Switcher.
type Segmenter ¶
type Segmenter interface {
// EnableSource creates a segmentation session for a source with the
// given frame dimensions. The smoothing parameter is accepted for API
// compatibility (RVM uses recurrent states instead of explicit smoothing).
EnableSource(key string, w, h int, smoothing float32) error
// DisableSource destroys the segmentation session for a source.
DisableSource(key string)
// SetPendingConfig stores a deferred segmentation config for a source.
// Called by the REST API when the source resolution is not yet known.
SetPendingConfig(key string, smoothing float32)
// HasPendingConfig returns true if a deferred config exists for the
// source but no active session has been created yet.
HasPendingConfig(key string) bool
// PendingSmoothing returns the smoothing value for a pending config.
PendingSmoothing(key string) float32
// ClearPendingConfig removes the deferred config for a source.
ClearPendingConfig(key string)
// IsEnabled returns true if segmentation is active for the source.
IsEnabled(key string) bool
// Segment submits a frame for segmentation processing. The frame must
// be GPU-resident (DevPtr in shared VRAM). Implementations may process
// synchronously (SegmentationEngine) or asynchronously (SegmentationProxy).
Segment(key string, frame *GPUFrame)
// MaskForSource returns the latest GPU-resident segmentation mask with
// a reference taken; callers MUST Release() the returned frame when
// done so DisableSource cannot free the mask's device memory while a
// pipeline kernel is still reading it. Returns nil if no mask is
// available. The returned GPUFrame is a uint8 single-plane mask
// (255 = foreground, 0 = background).
MaskForSource(key string) *GPUFrame
// MaskDevPtrForSource returns the raw device pointer of the mask buffer
// for a source. Returns 0 if no active session exists. Used by the sidecar
// to export the mask buffer as a CUDA IPC handle for zero-copy sharing.
MaskDevPtrForSource(key string) uintptr
// Close releases all resources.
Close()
}
Segmenter is the interface for AI person segmentation engines. Implemented by SegmentationEngine (in-process TensorRT) and SegmentationProxy (sidecar delegation via CUDA IPC).
The source manager calls Segment() on every ingested frame for enabled sources. The pipeline node reads masks via MaskForSource(), which returns the latest GPU-resident segmentation mask with a reference taken.
type SharpnessState ¶
type SharpnessState interface {
SharpnessAmount() float32
}
SharpnessState provides sharpness amount to the GPU sharpness node.
type SlotSnapshot ¶
type SlotSnapshot struct {
Index int
Enabled bool
SourceKey string
Rect Rect
FillYUV []byte // YUV420p source frame (deep copy, nil if no signal)
FillW, FillH int
FillPTS int64
Border BorderSnapshot
Alpha float32
ScaleMode string // "stretch" (default) or "fill"
CropAnchor [2]float64 // [x,y] 0.0-1.0, anchor point for crop (0.5,0.5 = center)
// DVE transform fields (populated when DVE layout is active).
DVETransform *dve.Transform // full DVE transform (nil if simple PIP)
DVEInvMatrix dve.Matrix3x3 // pre-computed inverse transform matrix
DVEIsIdentity bool // true if no DVE effects needed (fast path)
}
SlotSnapshot is a deep-copied snapshot of one layout slot's state.
type SourceColorGradeProvider ¶
type SourceColorGradeProvider interface {
// SourceLUTData returns the LUT float32 data for a source, or nil if no correction.
SourceLUTData(sourceKey string) []float32
// SourceLUTSize returns the cube dimension (e.g., 33).
SourceLUTSize(sourceKey string) int
// SourceLUTGen returns a generation counter for cache invalidation.
SourceLUTGen(sourceKey string) uint64
}
SourceColorGradeProvider supplies per-source 3D LUT data for color correction. Implemented by the corrector state manager (or any adapter that maps source keys to LUT data). The source manager checks each frame and uploads/caches the LUT on GPU memory, using the generation counter to avoid redundant uploads.
type SourceSTMapProvider ¶
type SourceSTMapProvider interface {
// SourceMapName returns the map name assigned to a source, or "" if none.
SourceMapName(sourceKey string) string
// SourceSTArrays returns the S and T float32 arrays for the source's
// assigned map, or (nil, nil) if no map is assigned.
SourceSTArrays(sourceKey string) (s, t []float32)
}
SourceSTMapProvider provides per-source ST map state to the GPU source manager. Implemented by stmap.Registry via SourceMapName and SourceSTArrays methods.
type TRTBinding ¶
TRTBinding describes a single named tensor binding for multi-input inference.
type TRTContext ¶
type TRTContext struct{}
TRTContext is a stub for non-TensorRT builds.
func (*TRTContext) Infer ¶
func (c *TRTContext) Infer(input, output unsafe.Pointer, batchSize int, stream unsafe.Pointer) error
Infer returns ErrTensorRTNotAvailable on non-TensorRT builds.
func (*TRTContext) InferMulti ¶
func (c *TRTContext) InferMulti(bindings []TRTBinding, stream unsafe.Pointer) error
InferMulti returns ErrTensorRTNotAvailable on non-TensorRT builds.
type TRTEngine ¶
type TRTEngine struct{}
TRTEngine is a stub for non-TensorRT builds.
func LoadTRTPlan ¶
LoadTRTPlan returns ErrTensorRTNotAvailable on non-TensorRT builds.
func LoadTRTPlanFromMemory ¶
LoadTRTPlanFromMemory returns ErrTensorRTNotAvailable on non-TensorRT builds.
func NewTRTEngine ¶
func NewTRTEngine(onnxPath string, opts TRTEngineOpts) (*TRTEngine, error)
NewTRTEngine returns ErrTensorRTNotAvailable on non-TensorRT builds.
func NewTRTEngineV2 ¶
func NewTRTEngineV2(onnxPath string, opts TRTEngineOptsV2) (*TRTEngine, error)
NewTRTEngineV2 returns ErrTensorRTNotAvailable on non-TensorRT builds.
func (*TRTEngine) NewContext ¶
func (e *TRTEngine) NewContext() (*TRTContext, error)
NewContext returns ErrTensorRTNotAvailable on non-TensorRT builds.
func (*TRTEngine) NumIOTensors ¶
NumIOTensors returns 0 on non-TensorRT builds.
func (*TRTEngine) OutputSize ¶
OutputSize returns 0 on non-TensorRT builds.
func (*TRTEngine) TensorInfoAt ¶
func (e *TRTEngine) TensorInfoAt(index int) (TensorInfo, error)
TensorInfoAt returns ErrTensorRTNotAvailable on non-TensorRT builds.
type TRTEngineOpts ¶
TRTEngineOpts configures engine building.
type TRTEngineOptsV2 ¶
type TRTEngineOptsV2 struct {
MaxBatchSize int
MaxSeqLen int
MaxEncSeqLen int
UseFP16 bool
UseINT8 bool
PlanCachePath string
}
TRTEngineOptsV2 extends TRTEngineOpts with sequence length for decoder models.
type TensorInfo ¶
TensorInfo describes an I/O tensor in a TensorRT engine.
type ThumbnailStore ¶
type ThumbnailStore interface {
ShouldCapture() bool
Store(nodeID string, jpeg []byte, width, height int)
}
ThumbnailStore is the callback interface for storing per-node JPEG thumbnails. Stub definition for non-GPU builds.
type Timer ¶
type Timer struct{}
Timer is a stub for non-GPU builds.
type VisibleLayerSnapshot ¶
type VisibleLayerSnapshot struct {
ID int
Rect Rect
Alpha float32 // 0.0-1.0 (fade position)
Overlay []byte // RGBA pixel data (deep copy)
OverlayW, OverlayH int
Gen uint64 // generation counter for cache invalidation
}
VisibleLayerSnapshot is a deep-copied snapshot of one visible layer's state.
Source Files
¶
- colorgrade_stub.go
- colorgrade_validate.go
- dispatch.go
- errors.go
- frame_format.go
- gpu_interfaces.go
- neural_key_engine_stub.go
- neural_key_types.go
- node_ai_segment_stub.go
- node_colorgrade_stub.go
- node_compositor_stub.go
- node_key_stub.go
- node_layout_stub.go
- node_neural_key_stub.go
- node_preview_encode_stub.go
- node_sharpness_stub.go
- node_stmap_stub.go
- occlusion_stub.go
- optix_stub.go
- preprocess_stub.go
- segmentation_engine_stub.go
- segmentation_proxy_stub.go
- segmenter.go
- sharpness_stub.go
- source_manager_stub.go
- stub_context.go
- stub_encode.go
- stub_misc.go
- stub_ops.go
- stub_pipeline.go
- stub_pool.go
- tensorrt_stub.go
- workqueue.go
- workqueue_stub.go