streamforward

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveStreamForwarding

type ActiveStreamForwarding struct {
	*StreamForwards
	StreamID             types.StreamID
	DestinationURL       *url.URL
	DestinationStreamKey string
	ReadCount            atomic.Uint64
	WriteCount           atomic.Uint64
	RecoderFactory       recoder.Factory
	PauseFunc            func(ctx context.Context, fwd *ActiveStreamForwarding)
	// contains filtered or unexported fields
}

func (*ActiveStreamForwarding) Close

func (fwd *ActiveStreamForwarding) Close() error

func (*ActiveStreamForwarding) Start

func (fwd *ActiveStreamForwarding) Start(ctx context.Context) (_err error)

func (*ActiveStreamForwarding) Stop

func (fwd *ActiveStreamForwarding) Stop() error

func (*ActiveStreamForwarding) String

func (fwd *ActiveStreamForwarding) String() string

func (*ActiveStreamForwarding) WaitForPublisher

func (fwd *ActiveStreamForwarding) WaitForPublisher(
	ctx context.Context,
) (types.Publisher, error)

type ForwardingKey

type ForwardingKey struct {
	StreamID      types.StreamID
	DestinationID types.DestinationID
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

type Options

type Options []Option

type StreamForward

type StreamForward struct {
	StreamID         types.StreamID
	DestinationID    types.DestinationID
	Enabled          bool
	Quirks           types.ForwardingQuirks
	ActiveForwarding *ActiveStreamForwarding
	NumBytesWrote    uint64
	NumBytesRead     uint64
}

type StreamForwards

type StreamForwards struct {
	StreamServer
	types.PlatformsController
	Mutex                      xsync.Mutex
	DestinationStreamingLocker *lockmap.LockMap
	ActiveStreamForwardings    map[ForwardingKey]*ActiveStreamForwarding
	StreamDestinations         []types.StreamDestination
	RecoderFactory             recoder.Factory
}

func NewStreamForwards

func NewStreamForwards(
	s StreamServer,
	recoderFactory recoder.Factory,
	pc types.PlatformsController,
) *StreamForwards

func (*StreamForwards) AddStreamDestination

func (s *StreamForwards) AddStreamDestination(
	ctx context.Context,
	destinationID types.DestinationID,
	url string,
	streamKey string,
) error

func (*StreamForwards) AddStreamForward

func (s *StreamForwards) AddStreamForward(
	ctx context.Context,
	streamID types.StreamID,
	destinationID types.DestinationID,
	enabled bool,
	quirks types.ForwardingQuirks,
) (*StreamForward, error)

func (*StreamForwards) GetStreamForwardsByDestination

func (s *StreamForwards) GetStreamForwardsByDestination(
	ctx context.Context,
	destID types.DestinationID,
) (_ret []StreamForward, _err error)

func (*StreamForwards) Init

func (s *StreamForwards) Init(
	ctx context.Context,
	opts ...types.InitOption,
) error

func (*StreamForwards) ListStreamDestinations

func (s *StreamForwards) ListStreamDestinations(
	ctx context.Context,
) ([]types.StreamDestination, error)

func (*StreamForwards) ListStreamForwards

func (s *StreamForwards) ListStreamForwards(
	ctx context.Context,
) (_ret []StreamForward, _err error)

func (*StreamForwards) NewActiveStreamForward

func (fwds *StreamForwards) NewActiveStreamForward(
	ctx context.Context,
	streamID types.StreamID,
	urlString string,
	streamKey string,
	pauseFunc func(ctx context.Context, fwd *ActiveStreamForwarding),
	opts ...Option,
) (_ret *ActiveStreamForwarding, _err error)

func (*StreamForwards) RemoveStreamDestination

func (s *StreamForwards) RemoveStreamDestination(
	ctx context.Context,
	destinationID types.DestinationID,
) error

func (*StreamForwards) RemoveStreamForward

func (s *StreamForwards) RemoveStreamForward(
	ctx context.Context,
	streamID types.StreamID,
	dstID types.DestinationID,
) error

func (*StreamForwards) UpdateStreamDestination

func (s *StreamForwards) UpdateStreamDestination(
	ctx context.Context,
	destinationID types.DestinationID,
	url string,
	streamKey string,
) error

func (*StreamForwards) UpdateStreamForward

func (s *StreamForwards) UpdateStreamForward(
	ctx context.Context,
	streamID types.StreamID,
	destinationID types.DestinationID,
	enabled bool,
	quirks types.ForwardingQuirks,
) (*StreamForward, error)

Jump to

Keyboard shortcuts

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