streams

package
v0.0.0-...-c3ad350 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 15 Imported by: 0

README

Testing notes

streams:
  test1-basic: ffmpeg:virtual?video#video=h264
  test2-reconnect: ffmpeg:virtual?video&duration=10#video=h264
  test3-execkill: exec:./examples/rtsp_client/rtsp_client/rtsp_client {output}

Documentation

Index

Constants

View Source
const SourceTemplate = "{input}"

Variables

This section is empty.

Functions

func AppendDOT

func AppendDOT(dot []byte, stream *Stream) []byte

func Delete

func Delete(id string)

func GetAll

func GetAll() (names []string)

func GetConsumer

func GetConsumer(url string) (core.Consumer, func(), error)

func GetProducer

func GetProducer(url string) (core.Producer, error)

func HandleConsumerFunc

func HandleConsumerFunc(scheme string, handler ConsumerHandler)

func HandleFunc

func HandleFunc(scheme string, handler Handler)

func HasProducer

func HasProducer(url string) bool

func Init

func Init()

func Location

func Location(url string) (string, error)

func ParseQuery

func ParseQuery(s string) url.Values

func Publish

func Publish(stream *Stream, destination any)

func RedirectFunc

func RedirectFunc(scheme string, redirect Redirect)

func Streams

func Streams() map[string]*Stream

func Validate

func Validate(source string) error

Validate - not allow creating dynamic streams with spaces in the source

Types

type ConsumerHandler

type ConsumerHandler func(url string) (core.Consumer, func(), error)

type Handler

type Handler func(source string) (core.Producer, error)

type Producer

type Producer struct {
	core.Listener
	// contains filtered or unexported fields
}

func NewProducer

func NewProducer(source string) *Producer

func (*Producer) AddTrack

func (p *Producer) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error

func (*Producer) Dial

func (p *Producer) Dial() error

func (*Producer) GetMedias

func (p *Producer) GetMedias() []*core.Media

func (*Producer) GetTrack

func (p *Producer) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error)

func (*Producer) MarshalJSON

func (p *Producer) MarshalJSON() ([]byte, error)

func (*Producer) SetSource

func (p *Producer) SetSource(s string)

type Redirect

type Redirect func(url string) (string, error)

Redirect can return: location URL or error or empty URL and error

type Stream

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

func Get

func Get(name string) *Stream

func GetOrPatch

func GetOrPatch(query url.Values) *Stream

func New

func New(name string, source string) *Stream

func NewStream

func NewStream(source any) *Stream

func Patch

func Patch(name string, source string) *Stream

func (*Stream) AddConsumer

func (s *Stream) AddConsumer(cons core.Consumer) (err error)

func (*Stream) AddInternalConsumer

func (s *Stream) AddInternalConsumer(conn core.Consumer)

func (*Stream) AddInternalProducer

func (s *Stream) AddInternalProducer(conn core.Producer)

func (*Stream) AddProducer

func (s *Stream) AddProducer(prod core.Producer)

func (*Stream) MarshalJSON

func (s *Stream) MarshalJSON() ([]byte, error)

func (*Stream) Play

func (s *Stream) Play(source string) error

func (*Stream) Publish

func (s *Stream) Publish(url string) error

func (*Stream) RemoveConsumer

func (s *Stream) RemoveConsumer(cons core.Consumer)

func (*Stream) RemoveInternalConsumer

func (s *Stream) RemoveInternalConsumer(conn core.Consumer)

func (*Stream) RemoveProducer

func (s *Stream) RemoveProducer(prod core.Producer)

func (*Stream) SetSource

func (s *Stream) SetSource(source string)

func (*Stream) Sources

func (s *Stream) Sources() (sources []string)

Jump to

Keyboard shortcuts

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