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 {
|
|
|
|
FullDiskPath string // Where it lives on disk
|
|
|
|
RelativeUploadPath string // Path it should have remotely
|
2020-10-15 00:07:38 +03:00
|
|
|
RemoteURL string
|
2023-05-30 20:31:43 +03:00
|
|
|
VariantIndex int // The bitrate variant
|
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 {
|
|
|
|
Segments map[string]*Segment
|
2023-05-30 20:31:43 +03:00
|
|
|
VariantIndex int
|
2020-06-23 04:11:56 +03:00
|
|
|
}
|
|
|
|
|
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]
|
|
|
|
}
|