pipeline

package
v0.0.0-...-d87bf7b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugGSTState

func DebugGSTState(ctx context.Context, pipeline *Pipeline, output string)

func GSTLogFunction

func GSTLogFunction(
	level gst.DebugLevel,
	file string,
	function string,
	line int,
	object *glib.Object,
	message string,
)

GSTLogFunction is a custom logger than can be used instead of the gstream, which is now TODO: using this causes the following error

(<unknown>:93142): GStreamer-CRITICAL **: 02:22:17.747: The created element should be floating, this is probably caused by faulty bindings

Types

type CCTVPipeline

type CCTVPipeline struct {
	// contains filtered or unexported fields
}

func NewCCTVPipeline

func NewCCTVPipeline(params CCTVPipelineParams) (_ *CCTVPipeline, err error)

NewCCTVPipeline constructs a new pipeline accordingly that cctv supports

func (*CCTVPipeline) Run

func (cctv *CCTVPipeline) Run() error

Run until an error occurs

func (*CCTVPipeline) Start

func (cctv *CCTVPipeline) Start(ctx context.Context) error

Start pipeline

func (*CCTVPipeline) Stop

func (cctv *CCTVPipeline) Stop() error

Stop all pipelines

func (*CCTVPipeline) Wait

func (cctv *CCTVPipeline) Wait()

Wait for all pipelines to stop running

type CCTVPipelineParams

type CCTVPipelineParams struct {
	// SourceLocation rtsp uri of where to pull a stream
	SourceLocation string
	// DestinationLocation rtsp uri of where to push a stream
	DestinationLocation string
	// CameraID
	CameraID string
	// SegmentBasePath base path of where to store segments
	SegmentBasePath string
	// TargetVideoSegmentationDuration at what duration to make video segments
	TargetVideoSegmentationDuration time.Duration
}

type Element

type Element struct {
	Factory    string
	Name       string
	Properties map[string]interface{}
	// contains filtered or unexported fields
}

Element struct wraps a gst element

func NewDecodeElement

func NewDecodeElement(name string) *Element

func NewFileSrcElement

func NewFileSrcElement(name string, file string) *Element

func (*Element) Build

func (e *Element) Build() error
func (e *Element) Link(other *Element) error

func (*Element) LinkFiltered

func (e *Element) LinkFiltered(other *Element, filter *gst.Caps) error
func (e *Element) Unlink(other *Element) error

type InternalError

type InternalError struct {
	// contains filtered or unexported fields
}

func (InternalError) Error

func (i InternalError) Error() string
type Link struct {
	// contains filtered or unexported fields
}

Link struct holds elements that should be linked left -> right

type LinkWithCaps

type LinkWithCaps struct {
	// contains filtered or unexported fields
}

type PartialPipeline

type PartialPipeline interface {
	// Prepare is called before any elements are built or any gst
	// pipeline has be instantiated
	Prepare(pipeline *Pipeline) error
	// Build is called after all elements have been added to the pipeline
	// gst pipeline has been instantiated
	Build(pipeline *Pipeline) error
	// Connect is called to connect a target element from one segment to
	// another
	Connect(source *Element) error
	// Start is called when the pipeline has started processing
	Start(ctx context.Context, pipeline *Pipeline) error
	// Stop is called when the pipeline has finished processing
	Stop(ctx context.Context, pipeline *Pipeline) error
}

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline wrapper around go-gst

func NewPipeline

func NewPipeline(name string) *Pipeline

NewPipeline returns a new pipeline given a name

func (*Pipeline) AddElements

func (p *Pipeline) AddElements(elements ...*Element)

AddElements to the pipeline

func (*Pipeline) AddPartialPipeline

func (p *Pipeline) AddPartialPipeline(partial PartialPipeline)

AddPartialPipeline to the pipeline

func (*Pipeline) AddWatch

func (p *Pipeline) AddWatch(watch func(element *gst.Message) bool)

AddWatch adds watch function for the event bus

func (*Pipeline) Build

func (p *Pipeline) Build() error

Build the pipeline, once built it will never be built again

func (*Pipeline) Finish

func (p *Pipeline) Finish(ctx context.Context)

func (*Pipeline) Quit

func (p *Pipeline) Quit()

Quit the current pipeline

func (*Pipeline) Start

func (p *Pipeline) Start(ctx context.Context, mainLoop *glib.MainLoop) (rerr error)

Start the pipeline

type SegmentPipelineParams

type SegmentPipelineParams struct {
	// contains filtered or unexported fields
}

type SegmentationPipeline

type SegmentationPipeline struct {
	// elements
	Elements SegmentationPipelineElements
	// segment counter
	SegmentCounter uint32
	// contains filtered or unexported fields
}

SegmentationPipeline will split a given stream into smaller parts

func NewSegmentationPipeline

func NewSegmentationPipeline(params SegmentPipelineParams) (sg *SegmentationPipeline, err error)

NewSegmentationPipeline create a new segmentation pipeline

func (*SegmentationPipeline) Build

func (sg *SegmentationPipeline) Build(pipeline *Pipeline) error

func (*SegmentationPipeline) Connect

func (sg *SegmentationPipeline) Connect(source *Element) error

func (*SegmentationPipeline) HandleFormatLocation

func (sg *SegmentationPipeline) HandleFormatLocation(g *gst.Element, val uint, sample *gst.Sample) string

func (*SegmentationPipeline) HandleNewSegment

func (sg *SegmentationPipeline) HandleNewSegment(msg *gst.Message) bool

func (*SegmentationPipeline) HandleStreamChange

func (sg *SegmentationPipeline) HandleStreamChange(newState SegmentationPipelineState) (err error)

func (*SegmentationPipeline) Prepare

func (sg *SegmentationPipeline) Prepare(pipeline *Pipeline) error

func (*SegmentationPipeline) Start

func (sg *SegmentationPipeline) Start(ctx context.Context, pipeline *Pipeline) error

func (*SegmentationPipeline) Stop

func (sg *SegmentationPipeline) Stop(ctx context.Context, pipeline *Pipeline) error

type SegmentationPipelineElements

type SegmentationPipelineElements struct {
	// contains filtered or unexported fields
}

type SegmentationPipelineState

type SegmentationPipelineState struct {
	// contains filtered or unexported fields
}

type SourcePipeline

type SourcePipeline struct {
	// elements
	Elements SourcePipelineElements
	// contains filtered or unexported fields
}

SourcePipeline will split a given Source into smaller parts

func NewSourcePipeline

func NewSourcePipeline(params SourcePipelineParams) (sp *SourcePipeline, err error)

SourcePipeline create a new source pipeline

func (*SourcePipeline) Build

func (s *SourcePipeline) Build(pipeline *Pipeline) error

func (*SourcePipeline) Connect

func (s *SourcePipeline) Connect(source *Element) error

func (*SourcePipeline) Prepare

func (s *SourcePipeline) Prepare(pipeline *Pipeline) error

func (*SourcePipeline) Start

func (s *SourcePipeline) Start(ctx context.Context, pipeline *Pipeline) error

func (*SourcePipeline) Stop

func (s *SourcePipeline) Stop(ctx context.Context, pipeline *Pipeline) error

type SourcePipelineElements

type SourcePipelineElements struct {
	// contains filtered or unexported fields
}

type SourcePipelineParams

type SourcePipelineParams struct {
	RtspUri string
}

type StreamPipeline

type StreamPipeline struct {
	// elements
	Elements StreamPipelineElements
	// contains filtered or unexported fields
}

StreamPipeline will split a given stream into smaller parts

func NewStreamPipeline

func NewStreamPipeline(params StreamPipelineParams) (s *StreamPipeline, err error)

func (*StreamPipeline) Build

func (s *StreamPipeline) Build(pipeline *Pipeline) error

func (*StreamPipeline) Connect

func (s *StreamPipeline) Connect(source *Element) error

func (*StreamPipeline) HandleStreamChange

func (s *StreamPipeline) HandleStreamChange(newState StreamPipelineState) (err error)

func (*StreamPipeline) Prepare

func (s *StreamPipeline) Prepare(pipeline *Pipeline) error

func (*StreamPipeline) Start

func (s *StreamPipeline) Start(ctx context.Context, pipeline *Pipeline) error

func (*StreamPipeline) Stop

func (s *StreamPipeline) Stop(ctx context.Context, pipeline *Pipeline) error

type StreamPipelineElements

type StreamPipelineElements struct {
	// contains filtered or unexported fields
}

type StreamPipelineParams

type StreamPipelineParams struct {
	// RtspSink location of where to send stream
	RtspSink string
}

type StreamPipelineState

type StreamPipelineState struct {
	// contains filtered or unexported fields
}

type ThumbnailParams

type ThumbnailParams struct {
	// contains filtered or unexported fields
}

func (ThumbnailParams) Caps

func (tp ThumbnailParams) Caps() *gst.Caps

Caps generates *gst.Caps for the provided image dimension

type ThumbnailPipeline

type ThumbnailPipeline struct {
	// elements
	Elements ThumbnailPipelineElements
	// contains filtered or unexported fields
}

ThumbnailPipeline will split a given stream into smaller parts

func NewThumbnailPipeline

func NewThumbnailPipeline(params ThumbnailParams) (sg *ThumbnailPipeline, err error)

NewThumbnailPipeline create a new thumbnail generation pipeline

func (*ThumbnailPipeline) Build

func (th *ThumbnailPipeline) Build(pipeline *Pipeline) error

func (*ThumbnailPipeline) Connect

func (th *ThumbnailPipeline) Connect(source *Element) error

func (*ThumbnailPipeline) CopySample

func (th *ThumbnailPipeline) CopySample(sample *gst.Sample)

CopySample will push a *gst.Sample to appsrc, pushing a sample has the benefits that the *gst.Caps get set onto the appsrc

func (*ThumbnailPipeline) NewElements

func (th *ThumbnailPipeline) NewElements() error

func (*ThumbnailPipeline) OnBuffer

func (th *ThumbnailPipeline) OnBuffer(buffer *gst.Buffer)

OnBuffer connects pushes a buffer onto the appsrc buffer to be processed it is expected that the appsink's *gst.Caps get updated before calling this method

func (*ThumbnailPipeline) Prepare

func (th *ThumbnailPipeline) Prepare(pipeline *Pipeline) error

func (*ThumbnailPipeline) Start

func (th *ThumbnailPipeline) Start(ctx context.Context, pipeline *Pipeline) error

func (*ThumbnailPipeline) Stop

func (th *ThumbnailPipeline) Stop(ctx context.Context, pipeline *Pipeline) error

type ThumbnailPipelineElements

type ThumbnailPipelineElements struct {
	// contains filtered or unexported fields
}

type ThumbnailPipelineState

type ThumbnailPipelineState struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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