Documentation ¶
Index ¶
- Variables
- func BuildContentFeatures(mediaType string, seek string, transcode bool) (string, error)
- func ClockTimeToSeconds(strtime string) (int, error)
- func ConvertFilename(s string) string
- func DurationForMedia(f string) (string, error)
- func FormatClockTime(strtime string) (string, error)
- func GetMimeDetailsFromFile(f io.ReadCloser) (string, error)
- func GetMimeDetailsFromStream(s io.ReadCloser) (string, error)
- func HostPortIsAlive(h string) bool
- func RandomString() (string, error)
- func SecondsToClockTime(secs int) (string, error)
- func ServeTranscodedStream(w io.Writer, input interface{}, ff *exec.Cmd) error
- func StreamURL(ctx context.Context, s string) (io.ReadCloser, error)
- func URLtoListenIPandPort(u string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidSeekFlag = errors.New("invalid seek flag") ErrInvalidClockFormat = errors.New("invalid clock format") )
var (
ErrBadStatus = errors.New("streamURL bad status code")
)
var (
ErrInvalidInput = errors.New("invalid ffmpeg input")
)
Functions ¶
func BuildContentFeatures ¶
BuildContentFeatures builds the content features string for the "contentFeatures.dlna.org" header.
func ClockTimeToSeconds ¶
ClockTimeToSeconds converts relative time to seconds.
func ConvertFilename ¶
ConvertFilename is a helper function that percent-encodes a string.
func DurationForMedia ¶
func FormatClockTime ¶
FormatClockTime converts clock time to a more expected format of clock time.
func GetMimeDetailsFromFile ¶
func GetMimeDetailsFromFile(f io.ReadCloser) (string, error)
GetMimeDetailsFromFile returns the media file mime details.
func GetMimeDetailsFromStream ¶
func GetMimeDetailsFromStream(s io.ReadCloser) (string, error)
GetMimeDetailsFromStream returns the media URL mime details.
func HostPortIsAlive ¶
HostPortIsAlive - We use this function to periodically health check the selected device and decide if we want to keep the entry in the list or to remove it.
func RandomString ¶
RandomString generates a random string which we then use as callback path in our webserver.
func SecondsToClockTime ¶
SecondsToClockTime converts seconds to seconds relative time.
func ServeTranscodedStream ¶
ServeTranscodedStream passes an input file or io.Reader to ffmpeg and writes the output directly to our io.Writer.
func URLtoListenIPandPort ¶
URLtoListenIPandPort for a given internal URL, find the correct IP/Interface to listen to.
Types ¶
This section is empty.