Documentation
¶
Index ¶
- func FormatRange(start, end uint64) string
- func ParseRange(input string) (uint64, uint64, error)
- type AdaptationSet
- type ContentProtection
- type Initialization
- type Mpd
- type Period
- type Representation
- func (r *Representation) GetCodecs() string
- func (r *Representation) GetContentProtection() []*ContentProtection
- func (r *Representation) GetHeight() int
- func (r *Representation) GetLabel() string
- func (r *Representation) GetLang() string
- func (r *Representation) GetMimeType() string
- func (r *Representation) GetPeriodId() string
- func (r *Representation) GetRole() string
- func (r *Representation) GetSegmentTemplate() *SegmentTemplate
- func (r *Representation) GetWidth() int
- func (r *Representation) ResolveBaseUrl() (*url.URL, error)
- func (r *Representation) String() string
- type Role
- type S
- type SegmentBase
- type SegmentList
- type SegmentTemplate
- func (st *SegmentTemplate) GetDurationBasedNumbers() ([]uint, error)
- func (st *SegmentTemplate) GetNumberRange() []uint
- func (st *SegmentTemplate) GetSegmentUrls(rep *Representation) ([]*url.URL, error)
- func (st *SegmentTemplate) GetStartNumber() uint
- func (st *SegmentTemplate) GetTimelineNumbers() []uint
- func (st *SegmentTemplate) GetTimelineTimes() []uint
- func (st *SegmentTemplate) GetTimescale() uint
- func (st *SegmentTemplate) ResolveInitialization(rep *Representation) (*url.URL, error)
- func (st *SegmentTemplate) ResolveMedia(rep *Representation, number int) (*url.URL, error)
- func (st *SegmentTemplate) ResolveMediaTime(rep *Representation, timeVal int) (*url.URL, error)
- type SegmentTimeline
- type SegmentUrl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatRange ¶ added in v1.31.6
Types ¶
type AdaptationSet ¶
type AdaptationSet struct {
Codecs string `xml:"codecs,attr"`
ContentProtection []*ContentProtection `xml:"ContentProtection"`
Height int `xml:"height,attr"`
Label string `xml:"Label"`
Lang string `xml:"lang,attr"`
MimeType string `xml:"mimeType,attr"`
Representations []*Representation `xml:"Representation"`
Role *Role `xml:"Role"`
SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate"`
Width int `xml:"width,attr"`
// Navigation
Parent *Period `xml:"-"`
}
AdaptationSet groups Representations.
type ContentProtection ¶
type ContentProtection struct {
SchemeIdUri string `xml:"schemeIdUri,attr"`
// DefaultKid maps to cenc:default_KID (urn:mpeg:cenc:2013)
DefaultKid string `xml:"urn:mpeg:cenc:2013 default_KID,attr"`
// Pssh maps to the cenc:pssh element (urn:mpeg:cenc:2013)
Pssh string `xml:"urn:mpeg:cenc:2013 pssh"`
}
ContentProtection specifies DRM schemes.
func (*ContentProtection) GetDefaultKid ¶ added in v1.31.0
func (cp *ContentProtection) GetDefaultKid() ([]byte, error)
GetDefaultKid returns the DefaultKid as a byte slice.
func (*ContentProtection) GetPssh ¶ added in v1.31.0
func (cp *ContentProtection) GetPssh() ([]byte, error)
GetPssh returns the PSSH data as a byte slice.
type Initialization ¶ added in v1.25.4
type Initialization struct {
// Used in SegmentBase
Range string `xml:"range,attr"`
// Used in SegmentList
SourceUrl string `xml:"sourceURL,attr"`
// Navigation
Parent *SegmentList `xml:"-"`
}
Initialization contains URL and byte range information for initialization segments.
func (*Initialization) ResolveSourceUrl ¶ added in v1.31.0
func (i *Initialization) ResolveSourceUrl() (*url.URL, error)
ResolveSourceUrl resolves the @sourceURL attribute against the parent SegmentList's context.
type Mpd ¶
type Mpd struct {
MediaPresentationDuration string `xml:"mediaPresentationDuration,attr"`
BaseUrl string `xml:"BaseURL"`
Periods []*Period `xml:"Period"`
MpdUrl *url.URL `xml:"-"`
}
Mpd represents the root element of the DASH MPD file.
func Parse ¶ added in v1.28.4
Parse takes a byte slice of an MPD file, unmarshals it, links navigation parents, and normalizes Representation IDs.
func (*Mpd) GetRepresentations ¶ added in v1.31.0
func (m *Mpd) GetRepresentations() map[string][]*Representation
GetRepresentations returns a map of all Representations keyed by their Id.
type Period ¶
type Period struct {
Duration string `xml:"duration,attr"`
Id string `xml:"id,attr"`
BaseUrl string `xml:"BaseURL"`
AdaptationSets []*AdaptationSet `xml:"AdaptationSet"`
// Navigation
Parent *Mpd `xml:"-"`
}
Period represents a temporal part of the media content.
func (*Period) GetDuration ¶ added in v1.28.4
GetDuration parses the ISO 8601 Duration attribute.
type Representation ¶
type Representation struct {
Bandwidth int `xml:"bandwidth,attr"`
Codecs string `xml:"codecs,attr"`
Height int `xml:"height,attr"`
Id string `xml:"id,attr"`
MimeType string `xml:"mimeType,attr"`
Width int `xml:"width,attr"`
BaseUrl string `xml:"BaseURL"`
SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate"`
ContentProtection []*ContentProtection `xml:"ContentProtection"`
SegmentBase *SegmentBase `xml:"SegmentBase"`
SegmentList *SegmentList `xml:"SegmentList"`
Parent *AdaptationSet `xml:"-"`
}
Representation describes a version of the media content.
func (*Representation) GetCodecs ¶ added in v1.28.4
func (r *Representation) GetCodecs() string
func (*Representation) GetContentProtection ¶ added in v1.28.8
func (r *Representation) GetContentProtection() []*ContentProtection
func (*Representation) GetHeight ¶ added in v1.28.4
func (r *Representation) GetHeight() int
func (*Representation) GetLabel ¶ added in v1.31.7
func (r *Representation) GetLabel() string
func (*Representation) GetLang ¶ added in v1.31.7
func (r *Representation) GetLang() string
func (*Representation) GetMimeType ¶ added in v1.25.2
func (r *Representation) GetMimeType() string
func (*Representation) GetPeriodId ¶ added in v1.31.7
func (r *Representation) GetPeriodId() string
func (*Representation) GetRole ¶ added in v1.31.7
func (r *Representation) GetRole() string
func (*Representation) GetSegmentTemplate ¶ added in v1.28.4
func (r *Representation) GetSegmentTemplate() *SegmentTemplate
func (*Representation) GetWidth ¶ added in v1.28.4
func (r *Representation) GetWidth() int
func (*Representation) ResolveBaseUrl ¶ added in v1.31.0
func (r *Representation) ResolveBaseUrl() (*url.URL, error)
ResolveBaseUrl resolves the Representation's BaseURL against the parent hierarchy.
func (*Representation) String ¶
func (r *Representation) String() string
String returns a multi-line summary of the Representation.
type Role ¶ added in v1.28.4
type Role struct {
Value string `xml:"value,attr"`
}
Role defines the role of the media content.
type SegmentBase ¶
type SegmentBase struct {
IndexRange string `xml:"indexRange,attr"`
Initialization *Initialization `xml:"Initialization"`
}
SegmentBase defines base information for segments.
type SegmentList ¶ added in v1.26.1
type SegmentList struct {
Duration uint `xml:"duration,attr"`
Timescale *uint `xml:"timescale,attr"`
Initialization *Initialization `xml:"Initialization"`
SegmentUrls []*SegmentUrl `xml:"SegmentURL"`
// Navigation
Parent *Representation `xml:"-"`
}
SegmentList contains a list of SegmentUrls.
func (*SegmentList) GetTimescale ¶ added in v1.29.7
func (sl *SegmentList) GetTimescale() uint
type SegmentTemplate ¶
type SegmentTemplate struct {
Duration uint `xml:"duration,attr"`
EndNumber uint `xml:"endNumber,attr"`
Initialization string `xml:"initialization,attr"`
Media string `xml:"media,attr"`
PresentationTimeOffset uint `xml:"presentationTimeOffset,attr"`
StartNumber *uint `xml:"startNumber,attr"`
Timescale *uint `xml:"timescale,attr"`
SegmentTimeline *SegmentTimeline `xml:"SegmentTimeline"`
// Navigation
ParentAdaptationSet *AdaptationSet `xml:"-"`
ParentRepresentation *Representation `xml:"-"`
}
SegmentTemplate defines specific rules for generating segment URLs.
func (*SegmentTemplate) GetDurationBasedNumbers ¶ added in v1.28.4
func (st *SegmentTemplate) GetDurationBasedNumbers() ([]uint, error)
func (*SegmentTemplate) GetNumberRange ¶ added in v1.28.4
func (st *SegmentTemplate) GetNumberRange() []uint
func (*SegmentTemplate) GetSegmentUrls ¶ added in v1.31.0
func (st *SegmentTemplate) GetSegmentUrls(rep *Representation) ([]*url.URL, error)
func (*SegmentTemplate) GetStartNumber ¶ added in v1.28.4
func (st *SegmentTemplate) GetStartNumber() uint
func (*SegmentTemplate) GetTimelineNumbers ¶ added in v1.28.4
func (st *SegmentTemplate) GetTimelineNumbers() []uint
func (*SegmentTemplate) GetTimelineTimes ¶ added in v1.28.4
func (st *SegmentTemplate) GetTimelineTimes() []uint
func (*SegmentTemplate) GetTimescale ¶ added in v1.28.4
func (st *SegmentTemplate) GetTimescale() uint
func (*SegmentTemplate) ResolveInitialization ¶ added in v1.28.4
func (st *SegmentTemplate) ResolveInitialization(rep *Representation) (*url.URL, error)
func (*SegmentTemplate) ResolveMedia ¶ added in v1.28.4
func (st *SegmentTemplate) ResolveMedia(rep *Representation, number int) (*url.URL, error)
func (*SegmentTemplate) ResolveMediaTime ¶ added in v1.28.4
func (st *SegmentTemplate) ResolveMediaTime(rep *Representation, timeVal int) (*url.URL, error)
type SegmentTimeline ¶ added in v1.28.4
type SegmentTimeline struct {
S []*S `xml:"S"`
}
SegmentTimeline defines specific timing for segments.
type SegmentUrl ¶ added in v1.31.0
type SegmentUrl struct {
Media string `xml:"media,attr"`
// Navigation
Parent *SegmentList `xml:"-"`
}
SegmentUrl defines a specific media segment source.
func (*SegmentUrl) ResolveMedia ¶ added in v1.31.0
func (su *SegmentUrl) ResolveMedia() (*url.URL, error)
ResolveMedia resolves the @media attribute against the parent SegmentList's context.