worker

package
v0.0.0-...-759d9de Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ThumbWidth      = 160 // Width in pixels, height is inferred by thumbgen
	LargeThumbWidth = 720
	Compression     = 90 // Compression in percent
)

Variables

View Source
var (
	S          *Status
	VersionTag string
)

Functions

func GetClient

func GetClient() (pb.FromWorkerClient, *grpc.ClientConn, error)

func GetStreamInfoForUploadReq

func GetStreamInfoForUploadReq(uploadKey string) (*pb.GetStreamInfoForUploadResponse, error)

func GetWaveform

func GetWaveform(request *pb.WaveformRequest) ([]byte, error)

GetWaveform returns the waveform of a given video as byte slice

func HandlePremiere

func HandlePremiere(request *pb.PremiereRequest)

func HandleSelfStreamRecordEnd

func HandleSelfStreamRecordEnd(ctx *StreamContext)

func HandleStreamEnd

func HandleStreamEnd(ctx *StreamContext, cancelTranscoding bool)

HandleStreamEnd stops the ffmpeg instance by sending a SIGINT to it and prevents the loop to restart it by marking the stream context as stopped.

func HandleStreamEndRequest

func HandleStreamEndRequest(request *pb.EndStreamRequest)

HandleStreamEndRequest ends all streams for a given streamID contained in request

func HandleStreamRequest

func HandleStreamRequest(request *pb.StreamRequest)

func HandleThumbnailRequest

func HandleThumbnailRequest(request *pb.GenerateThumbnailRequest)

HandleThumbnailRequest creates a thumbnail on demand.

func HandleUploadRestReq

func HandleUploadRestReq(streamInfo *pb.GetStreamInfoForUploadResponse, localFile string)

func NotifyStreamDone

func NotifyStreamDone(streamCtx *StreamContext)

func NotifyTranscodingFailure

func NotifyTranscodingFailure(streamContext StreamContext, transcodingError error)

func Setup

func Setup()

Setup starts all recurring jobs of the worker

Types

type Deletable

type Deletable struct {
	File string    // File is the path of the file to delete
	Time time.Time // Time is the time the file was marked for deletion
}

type Persistable

type Persistable struct {
	Deletable []Deletable // Deletable are all files that can safely be deleted
	// contains filtered or unexported fields
}

func NewPersistable

func NewPersistable() (*Persistable, error)

NewPersistable reads in the persistable object from disk and returns it

func (*Persistable) AddDeletable

func (p *Persistable) AddDeletable(file string) error

AddDeletable adds a file to the list of deletable files

func (*Persistable) SetDeletables

func (p *Persistable) SetDeletables(d []Deletable) error

SetDeletables sets the list of deletable files

type SilenceDetect

type SilenceDetect struct {
	Input    string
	Silences *[]silence
}

func NewSilenceDetector

func NewSilenceDetector(input string) *SilenceDetect

func (*SilenceDetect) ParseSilence

func (s *SilenceDetect) ParseSilence() error

type Status

type Status struct {
	Jobs      []string
	StartTime time.Time

	// VM Metrics are updated regularly
	Stat *vmstat.VmStat
	// contains filtered or unexported fields
}

func (*Status) SendHeartbeat

func (s *Status) SendHeartbeat()

type StreamContext

type StreamContext struct {
	TranscodingSuccessful bool // TranscodingSuccessful is true if the transcoding was successful
	// contains filtered or unexported fields
}

StreamContext contains all important information on a stream

func HandleSelfStream

func HandleSelfStream(request *pb.SelfStreamResponse, slug string) *StreamContext

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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