Documentation
¶
Index ¶
Constants ¶
const InitSegmentIdx = -1
Variables ¶
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 RegisterRoutes ¶ added in v0.1.1
RegisterRoutes registers streaming routes to an existing router
Types ¶
type Error ¶
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 StatusError ¶
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.