media

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlvAppSource = "flvAppSrc"
)

Variables

This section is empty.

Functions

func Validate

func Validate(ctx context.Context, info *livekit.IngressInfo) error

Types

type HTTPRelaySource

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

func NewHTTPRelaySource

func NewHTTPRelaySource(ctx context.Context, p *Params) (*HTTPRelaySource, error)

func (*HTTPRelaySource) Close

func (s *HTTPRelaySource) Close() error

func (*HTTPRelaySource) GetSource

func (s *HTTPRelaySource) GetSource() *app.Source

func (*HTTPRelaySource) Start

func (s *HTTPRelaySource) Start(ctx context.Context) error

type Input

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

func NewInput

func NewInput(p *Params) (*Input, error)

func (*Input) Close

func (i *Input) Close() error

func (*Input) OnOutputReady

func (i *Input) OnOutputReady(f OutputReadyFunc)

func (*Input) Start

func (i *Input) Start(ctx context.Context) error

type Output

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

Output manages GStreamer elements that converts & encodes video to the specification that's suitable for WebRTC

func NewAudioOutput

func NewAudioOutput(options *livekit.IngressAudioOptions) (*Output, error)

func NewVideoOutput

func NewVideoOutput(mimeType string, layer *livekit.VideoLayer) (*Output, error)

func (*Output) Bin

func (e *Output) Bin() *gst.Bin

func (*Output) ForceKeyFrame

func (e *Output) ForceKeyFrame() error

func (*Output) NextSample

func (e *Output) NextSample() (media.Sample, error)

func (*Output) OnBind

func (e *Output) OnBind() error

func (*Output) OnUnbind

func (e *Output) OnUnbind() error

type OutputReadyFunc

type OutputReadyFunc func(pad *gst.Pad, kind StreamKind)

type OutputStream

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

OutputStream holds one or more encoders for either an audio or video stream

func NewAudioOutputStream

func NewAudioOutputStream(options *livekit.IngressAudioOptions) (*OutputStream, error)

func NewVideoOutputStream

func NewVideoOutputStream(options *livekit.IngressVideoOptions, inputLayer *livekit.VideoLayer) (*OutputStream, error)

type Params

type Params struct {
	*livekit.IngressInfo

	Logger logger.Logger

	// connection info
	WsUrl string
	Token string

	// relay info
	RelayUrl string

	GstReady chan struct{}
}

func GetParams

func GetParams(ctx context.Context, conf *config.Config, info *livekit.IngressInfo, wsUrl string, token string) (*Params, error)

func (*Params) SetRoomId

func (p *Params) SetRoomId(roomId string)

func (*Params) SetStatus

func (p *Params) SetStatus(status livekit.IngressState_Status, errString string)

type Pipeline

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

func New

func New(ctx context.Context, conf *config.Config, params *Params) (*Pipeline, error)

func (*Pipeline) GetInfo

func (p *Pipeline) GetInfo() *livekit.IngressInfo

func (*Pipeline) OnStatusUpdate

func (p *Pipeline) OnStatusUpdate(f func(context.Context, *livekit.IngressInfo))

func (*Pipeline) Run

func (*Pipeline) SendEOS

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

type StreamKind

type StreamKind string
const (
	Audio StreamKind = "audio"
	Video StreamKind = "video"
)

type WebRTCSink

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

func NewWebRTCSink

func NewWebRTCSink(ctx context.Context, p *Params) (*WebRTCSink, error)

func (*WebRTCSink) AddTrack

func (s *WebRTCSink) AddTrack(kind StreamKind) (*gst.Bin, error)

func (*WebRTCSink) Close

func (s *WebRTCSink) Close()

Jump to

Keyboard shortcuts

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