streamsuite

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BufferSize is the size of the content buffer we will use.
	BufferSize = 1024 * 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FFMPEG

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

FFMPEG is a transport that uses FFMPEG to process the video stream.

func (FFMPEG) Headers

func (f FFMPEG) Headers() http.Header

Headers returns HTTP headers to add to the outbound request, if any.

func (FFMPEG) MarshalJSON

func (f FFMPEG) MarshalJSON() ([]byte, error)

MarshalJSON returns the string type of transport.

func (FFMPEG) Start

func (f FFMPEG) Start(ctx context.Context, streamURL string) (io.ReadCloser, error)

Start will begin the stream.

func (FFMPEG) Stop

func (f FFMPEG) Stop() error

Stop kills the stream

func (FFMPEG) Type

func (f FFMPEG) Type() string

Type describes the type of transport.

type HTTP

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

HTTP is a transport that simply "restreams" the video from the source with a small buffer.

func (HTTP) Headers

func (h HTTP) Headers() http.Header

Headers returns HTTP headers to add to the outbound request, if any.

func (HTTP) MarshalJSON

func (h HTTP) MarshalJSON() ([]byte, error)

MarshalJSON returns the string type of transport.

func (*HTTP) Start

func (h *HTTP) Start(ctx context.Context, streamURL string) (io.ReadCloser, error)

Start will begin the stream.

func (HTTP) Stop

func (h HTTP) Stop() error

Stop kills the stream

func (HTTP) Type

func (h HTTP) Type() string

Type describes the type of transport.

type Stream

type Stream struct {
	UUID      string
	Channel   *models.LineupChannel
	StreamURL string

	Transport   StreamTransport
	StartTime   *time.Time
	PromLabels  []string
	StopNow     chan bool `json:"-"`
	LastWroteAt *time.Time
	// contains filtered or unexported fields
}

Stream describes a single active video stream in telly.

func (*Stream) Start

func (s *Stream) Start(c *gin.Context)

Start will mark the stream as playing and begin playback.

func (*Stream) Stop

func (s *Stream) Stop()

Stop will tear down the stream.

type StreamTransport

type StreamTransport interface {
	Type() string
	Headers() http.Header
	Start(ctx context.Context, streamURL string) (io.ReadCloser, error)
	Stop() error
}

StreamTransport is a method to acquire a video source.

Jump to

Keyboard shortcuts

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