server

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: MIT Imports: 45 Imported by: 0

Documentation

Overview

Package server is the place we integrate the Livepeer node with the LPMS media server.

Index

Constants

View Source
const AuthType_LPE = "Livepeer-Eth-1"
View Source
const BroadcastRetry = 15 * time.Second
View Source
const GRPCConnectTimeout = 3 * time.Second
View Source
const GRPCTimeout = 8 * time.Second
View Source
const HLSBufferCap = uint(43200) //12 hrs assuming 1s segment
View Source
const HLSBufferWindow = uint(5)
View Source
const HLSUnsubWorkerFreq = time.Second * 5
View Source
const HLSWaitInterval = time.Second
View Source
const HTTPTimeout = 8 * time.Second
View Source
const SegLen = 4 * time.Second

Variables

View Source
var BroadcastPrice = big.NewInt(1)
View Source
var ErrAlreadyExists = errors.New("StreamAlreadyExists")
View Source
var ErrBroadcast = errors.New("ErrBroadcast")
View Source
var ErrHLSPlay = errors.New("ErrHLSPlay")
View Source
var ErrRTMPPlay = errors.New("ErrRTMPPlay")
View Source
var ErrRTMPPublish = errors.New("ErrRTMPPublish")
View Source
var ErrRoundInit = errors.New("ErrRoundInit")
View Source
var HLSWaitTime = time.Second * 45
View Source
var LastHLSStreamID core.StreamID
View Source
var LastManifestID core.ManifestID
View Source
var MinDepositSegmentCount = int64(75) // 5 mins assuming 4s segments
View Source
var MinJobBlocksRemaining = big.NewInt(40) // 10 mins assuming 15s blocks

Functions

func StartBroadcastClient added in v0.3.3

func StartBroadcastClient(bcast Broadcaster, orchestratorServer string) error

func StartTranscodeServer added in v0.3.3

func StartTranscodeServer(orch Orchestrator, bind string, mux *http.ServeMux, workDir string)

XXX do something about the implicit start of the http mux? this smells

func SubmitSegment added in v0.3.3

func SubmitSegment(bcast Broadcaster, seg *stream.HLSSegment, nonce uint64) (*net.TranscodeData, error)

Types

type Broadcaster added in v0.3.3

type Broadcaster interface {
	Sign([]byte) ([]byte, error)
	Job() *lpTypes.Job
	SetHTTPClient(*http.Client)
	GetHTTPClient() *http.Client
	SetTranscoderInfo(*net.TranscoderInfo)
	GetTranscoderInfo() *net.TranscoderInfo
}

type LivepeerServer

type LivepeerServer struct {
	RTMPSegmenter  lpmscore.RTMPSegmenter
	LPMS           *lpmscore.LPMS
	LivepeerNode   *core.LivepeerNode
	VideoNonce     map[string]uint64
	VideoNonceLock *sync.Mutex
	HttpMux        *http.ServeMux
	// contains filtered or unexported fields
}

func NewLivepeerServer

func NewLivepeerServer(rtmpAddr string, httpAddr string, lpNode *core.LivepeerNode) *LivepeerServer

func (*LivepeerServer) StartMediaServer

func (s *LivepeerServer) StartMediaServer(ctx context.Context, maxPricePerSegment *big.Int, transcodingOptions string) error

StartServer starts the LPMS server

func (*LivepeerServer) StartWebserver

func (s *LivepeerServer) StartWebserver(bindAddr string)

type Orchestrator added in v0.3.3

type Orchestrator interface {
	ServiceURI() *url.URL
	Address() ethcommon.Address
	Sign([]byte) ([]byte, error)
	CurrentBlock() *big.Int
	GetJob(int64) (*lpTypes.Job, error)
	TranscodeSeg(*lpTypes.Job, *core.SignedSegment) (*core.TranscodeResult, error)
	StreamIDs(*lpTypes.Job) ([]core.StreamID, error)
}

Jump to

Keyboard shortcuts

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