Documentation ¶
Overview ¶
Package videostreams provides a pub-sub system for running video stream processing pipelines on-demand.
Index ¶
- Constants
- Variables
- func AddAnnotationPadding(source image.Image, topLines, bottomLines int) (output draw.Image)
- func AddLabel(im draw.Image, label string, co color.Color, x, y int)
- func AnnotateTop(im draw.Image, annotations string, lines int)
- func CopyRGBA(im image.Image) draw.Image
- func EmptyHandler(c *Context) error
- func NewChannelFactory(b *Broker, sessionID string, logger pubsub.Logger, ...) actioncable.ChannelFactory
- func ResizeToHeight(im image.Image, height int) draw.Image
- type AnnotationMetadata
- type BroadcastReceiver
- type Broker
- func (b *Broker) Hub() *Hub
- func (b *Broker) PUB(topic string, h HandlerFunc, m ...MiddlewareFunc) *Route
- func (b *Broker) SUB(topic string, h HandlerFunc, m ...MiddlewareFunc) *Route
- func (b *Broker) Serve(ctx context.Context) error
- func (b *Broker) Subscribe(ctx context.Context, topic string) <-chan Frame
- func (b *Broker) UNSUB(topic string, h HandlerFunc, m ...MiddlewareFunc) *Route
- func (b *Broker) Use(middleware ...MiddlewareFunc)
- type Channel
- type Context
- type Frame
- type HandlerFunc
- type Hub
- type ImageFrame
- type JPEGFrame
- type Metadata
- type MiddlewareFunc
- type OpChain
- type Operation
- type Route
- type Router
- type Settings
Constants ¶
View Source
const ( MethodPub = pubsub.MethodPub MethodSub = pubsub.MethodSub MethodUnsub = pubsub.MethodUnsub )
View Source
const ChannelName = "Video::StreamsChannel"
ChannelName is the name of the Action Cable channel for Video Streams.
View Source
const Nop = ""
Variables ¶
View Source
var LineHeight = fontFace.Metrics().Height.Round()
Functions ¶
func AddAnnotationPadding ¶ added in v0.2.4
func EmptyHandler ¶
func NewChannelFactory ¶ added in v0.3.0
func NewChannelFactory( b *Broker, sessionID string, logger pubsub.Logger, checkers ...actioncable.IdentifierChecker, ) actioncable.ChannelFactory
NewChannelFactory creates an actioncable.ChannelFactory for Turbo Streams to create channels for different Video Streams streams as needed.
Types ¶
type AnnotationMetadata ¶ added in v0.2.4
type AnnotationMetadata struct { Width int Height int Timestamp time.Time JPEGQuality int FPSCount int64 FPSPeriod float32 }
func (AnnotationMetadata) String ¶ added in v0.2.4
func (m AnnotationMetadata) String() string
func (AnnotationMetadata) WithFrameData ¶ added in v0.2.4
func (m AnnotationMetadata) WithFrameData(f *ImageFrame) AnnotationMetadata
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func (*Broker) PUB ¶
func (b *Broker) PUB(topic string, h HandlerFunc, m ...MiddlewareFunc) *Route
func (*Broker) SUB ¶
func (b *Broker) SUB(topic string, h HandlerFunc, m ...MiddlewareFunc) *Route
func (*Broker) UNSUB ¶
func (b *Broker) UNSUB(topic string, h HandlerFunc, m ...MiddlewareFunc) *Route
func (*Broker) Use ¶
func (b *Broker) Use(middleware ...MiddlewareFunc)
type Channel ¶ added in v0.3.0
type Channel struct {
// contains filtered or unexported fields
}
Channel represents an Action Cable channel for a Video Streams stream.
func NewChannel ¶ added in v0.3.0
func NewChannel( identifier string, h *pubsub.Hub[[]Frame], subscriber subscriber, sessionID string, checkers []actioncable.IdentifierChecker, logger pubsub.Logger, ) (*Channel, error)
NewChannel checks the identifier with the specified checkers and returns a new Channel instance.
func (*Channel) Perform ¶ added in v0.3.0
Perform handles an Action Cable action command from the client.
func (*Channel) Subscribe ¶ added in v0.3.0
func (c *Channel) Subscribe(ctx context.Context, sub *actioncable.Subscription) error
Subscribe handles an Action Cable subscribe command from the client with the provided actioncable.Subscription.
type Frame ¶
type Frame interface { AsImageFrame() (*ImageFrame, error) AsJPEGFrame() (*JPEGFrame, error) Error() error }
func NewErrorFrame ¶
type HandlerFunc ¶
type HandlerFunc = pubsub.HandlerFunc[*Context]
type ImageFrame ¶
func (*ImageFrame) AsImageFrame ¶ added in v0.2.4
func (f *ImageFrame) AsImageFrame() (*ImageFrame, error)
func (*ImageFrame) AsJPEGFrame ¶ added in v0.3.0
func (f *ImageFrame) AsJPEGFrame() (*JPEGFrame, error)
func (*ImageFrame) Error ¶
func (f *ImageFrame) Error() error
func (*ImageFrame) WithAnnotation ¶ added in v0.2.4
func (f *ImageFrame) WithAnnotation(annotations string, lines int) *ImageFrame
func (*ImageFrame) WithResizeToHeight ¶ added in v0.2.4
func (f *ImageFrame) WithResizeToHeight(height int) *ImageFrame
type JPEGFrame ¶ added in v0.3.0
func (*JPEGFrame) AsImageFrame ¶ added in v0.3.0
func (f *JPEGFrame) AsImageFrame() (*ImageFrame, error)
func (*JPEGFrame) AsJPEGFrame ¶ added in v0.3.0
type Metadata ¶
type Metadata struct { FromSource map[string][]string ReceiveTime time.Time Operations *OpChain Settings Settings }
func (*Metadata) WithSettings ¶ added in v0.2.4
type MiddlewareFunc ¶
type MiddlewareFunc = pubsub.MiddlewareFunc[*Context]
type OpChain ¶ added in v0.2.4
type OpChain struct { Op Operation // contains filtered or unexported fields }
func (*OpChain) Linearization ¶ added in v0.2.4
Click to show internal directories.
Click to hide internal directories.