Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
727 B

package core
import (
"fmt"
"reflect"
"strings"
"github.com/aler9/gortsplib"
)
// source is an entity that can provide a stream.
// it can be:
// - a publisher
// - sourceStatic
// - sourceRedirect
type source interface {
apiSourceDescribe() interface{}
}
func sourceTrackNames(tracks gortsplib.Tracks) []string {
ret := make([]string, len(tracks))
for i, t := range tracks {
n := reflect.TypeOf(t).Elem().Name()
n = n[len("Track"):]
ret[i] = n
}
return ret
}
func sourceTrackInfo(tracks gortsplib.Tracks) string {
return fmt.Sprintf("%d %s (%s)",
len(tracks),
func() string {
if len(tracks) == 1 {
return "track"
}
return "tracks"
}(),
strings.Join(sourceTrackNames(tracks), ", "))
}