Documentation ¶
Index ¶
- type Cursor
- type MSN
- type PartMSN
- type Segment
- func (s *Segment) Append(frag fragment.Fragment) error
- func (s *Segment) Cursor() Cursor
- func (s *Segment) Discontinuous() bool
- func (s *Segment) Duration() time.Duration
- func (s *Segment) Final() bool
- func (s *Segment) Finalize(nextSegment time.Duration)
- func (s *Segment) Format(b *bytes.Buffer, includeParts bool)
- func (s *Segment) Parts() int
- func (s *Segment) Release()
- func (s *Segment) Size() int64
- func (s *Segment) Start() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor facilitiates concurrent access to a Segment
type MSN ¶
type MSN int
MSN is a Media Sequence Number, it starts at 0 for the first segment and increments for every subsequent segment.
type PartMSN ¶
type PartMSN struct { MSN MSN // index of the last complete segment Part int // in-progress subpart of the next segment }
PartMSN identifies a segment by MSN and a part thereof
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
Segment holds a single HLS segment which can be written to in parts
Methods of Segment are not safe for concurrent use. Use Cursor() to get a concurrent accessor.
func New ¶
func New(name, workDir, ctype string, start time.Duration, dcn bool, programTime time.Time) (*Segment, error)
New creates a new HLS segment
func (*Segment) Append ¶
Append a complete fragment to the segment. The buffer must not be modified afterwards.
func (*Segment) Discontinuous ¶
Discontinuous returns whether the segment immediately follows a change in stream parameters
func (*Segment) Release ¶
func (s *Segment) Release()
Release the backing storage associated with the segment