2020-06-23 04:11:56 +03:00
|
|
|
package models
|
|
|
|
|
2020-11-13 02:14:59 +03:00
|
|
|
// Segment represents a segment of the live stream.
|
2020-06-23 04:11:56 +03:00
|
|
|
type Segment struct {
|
|
|
|
VariantIndex int // The bitrate variant
|
|
|
|
FullDiskPath string // Where it lives on disk
|
|
|
|
RelativeUploadPath string // Path it should have remotely
|
2020-10-15 00:07:38 +03:00
|
|
|
RemoteURL string
|
2020-06-23 04:11:56 +03:00
|
|
|
}
|
|
|
|
|
2020-11-13 02:14:59 +03:00
|
|
|
// Variant represents a single video variant and the segments that make it up.
|
2020-06-23 04:11:56 +03:00
|
|
|
type Variant struct {
|
|
|
|
VariantIndex int
|
|
|
|
Segments map[string]*Segment
|
|
|
|
}
|
|
|
|
|
2020-11-13 02:14:59 +03:00
|
|
|
// GetSegmentForFilename gets the segment for the provided filename.
|
2020-06-23 04:11:56 +03:00
|
|
|
func (v *Variant) GetSegmentForFilename(filename string) *Segment {
|
|
|
|
return v.Segments[filename]
|
|
|
|
}
|