streaming

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: GPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const InitSegmentIdx = -1

Variables

View Source
var FfmpegUrlPort = 8080

TODO(Leon Handreke): Figure out a better way than a package-global variable to convey this info from the top-level command flag to ffmpeg. Or maybe a setter is enough? Also this should go in some util package to build URLs

Functions

func Cleanup

func Cleanup()

Cleanup cleans up any streaming artifacts that might be left.

func RegisterRoutes added in v0.1.1

func RegisterRoutes(router *mux.Router)

RegisterRoutes registers streaming routes to an existing router

Types

type Error

type Error interface {
	error
	Status() int
}

Error represents a handler error. It provides methods for a HTTP status code and embeds the built-in error interface.

type PlaybackSession

type PlaybackSession struct {
	PlaybackSessionKey

	TranscodingSession *ffmpeg.TranscodingSession
	// contains filtered or unexported fields
}

func GetPlaybackSession

func GetPlaybackSession(
	playbackSessionKey PlaybackSessionKey,
	segmentIdx int) (*PlaybackSession, error)

GetPlaybackSession gets a playback session with the given key and for the given segment index. If the segment index is too far in the future, it will conclude that the user likely skipped ahead and start a new playback session. If segmentIdx == InitSegmentIdx, any session will be returned for the given (StreamKey, representationID). This is useful to get a session to serve the init segment from because it doesn't matter where ffmpeg seeked to, the init segment will always be the same. The returned PlaybackSession must be released after use by calling ReleasePlaybackSession.

func GetPlaybackSessionByID

func GetPlaybackSessionByID(playbackSessionID string) (*PlaybackSession, error)

GetPlaybackSessionByID gets the playback session by its ID. If one with the given ID does not exist, and error is returned. The returned PlaybackSession must be released after use by calling ReleasePlaybackSession.

func NewPlaybackSession

func NewPlaybackSession(playbackSessionKey PlaybackSessionKey, segmentIdx int) (*PlaybackSession, error)

func (*PlaybackSession) CleanupIfRequired

func (s *PlaybackSession) CleanupIfRequired()

func (*PlaybackSession) Release

func (s *PlaybackSession) Release()

type PlaybackSessionKey

type PlaybackSessionKey struct {
	ffmpeg.StreamKey
	// contains filtered or unexported fields
}

type StatusError

type StatusError struct {
	Code int
	Err  error
}

StatusError represents an error with an associated HTTP status code.

func (StatusError) Error

func (se StatusError) Error() string

Allows StatusError to satisfy the error interface.

func (StatusError) Status

func (se StatusError) Status() int

Returns our HTTP status code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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