Documentation
¶
Index ¶
- Constants
- func Abs(a int) int
- func Max(a, b int) int
- func Min(a, b int) int
- func PrintMPD(root Node, ident int)
- type AdaptationSet
- type BaseUrl
- type CencPssh
- type Cloneable
- type ContentComponent
- type ContentProtection
- type FakeNode
- type Initialization
- type ManifestInfo
- type Mpd
- type MpdProcessor
- type Node
- func NewAdaptationSet() Node
- func NewBaseUrl() Node
- func NewContentComponent() Node
- func NewInitialization() Node
- func NewMpd() Node
- func NewPeriod() Node
- func NewRepresentation() Node
- func NewRepresentationIndex() Node
- func NewRole() Node
- func NewSegmentBase() Node
- func NewSegmentList() Node
- func NewSegmentTemplate() Node
- func NewSegmentTimePoint() Node
- func NewSegmentTimeline() Node
- func NewSegmentUrl() Node
- type Pair
- type Period
- type PeriodInfo
- type Range
- type Representation
- type RepresentationIndex
- type Role
- type SegmentBase
- type SegmentIndex
- type SegmentList
- type SegmentMetadataInfo
- type SegmentReference
- type SegmentTemplate
- type SegmentTimePoint
- type SegmentTimeline
- type SegmentUrl
- type StreamInfo
- type StreamSetInfo
- type TimeLine
Constants ¶
View Source
const ( /** * Any gap/overlap within a SegmentTimeline that is greater than or equal to * this value (in seconds) will generate a warning message. * @const {number} */ GAP_OVERLAP_WARNING_THRESHOLD = 1 / 32 /** * The maximum span, in seconds, that a SegmentIndex must account for when that * SegmentIndex is being generated via a segment duration. * @const {number} */ MAX_SEGMENT_INDEX_SPAN = 2 * 60 /** * The default value, in seconds, for MPD@minBufferTime if this attribute is * missing. * @const {number} */ DEFAULT_MIN_BUFFER_TIME = 5 )
View Source
const ( DEFAULT_MIN_BUFFER_TIME_ = 5 DEFAULT_SUGGESTED_PRESENTATION_DELAY_ = 1 )
View Source
const ( /** * @expose all TAG_NAME properties so that they do not get stripped during * advanced compilation. */ Mpd_TAG_NAME = "MPD" Period_TAG_NAME = "Period" AdaptationSet_TAG_NAME = "AdaptationSet" Role_TAG_NAME = "Role" ContentComponent_TAG_NAME = "ContentComponent" Representation_TAG_NAME = "Representation" ContentProtection_TAG_NAME = "ContentProtection" CencPssh_TAG_NAME = "cenc:pssh" BaseUrl_TAG_NAME = "BaseURL" SegmentBase_TAG_NAME = "SegmentBase" RepresentationIndex_TAG_NAME = "RepresentationIndex" Initialization_TAG_NAME = "Initialization" SegmentList_TAG_NAME = "SegmentList" SegmentUrl_TAG_NAME = "SegmentURL" SegmentTemplate_TAG_NAME = "SegmentTemplate" SegmentTimeline_TAG_NAME = "SegmentTimeline" SegmentTimePoint_TAG_NAME = "S" )
MPD tag names --------------------------------------------------------------
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdaptationSet ¶
type AdaptationSet struct {
/** @type {?string} */
Id string
/**
* The language.
* @type {?string}
* @see IETF RFC 5646
* @see ISO 639
*/
Lang string
/**
* Should be 'video' or 'audio', not a MIME type.
* If not specified, will be inferred from the MIME type.
* @type {?string}
*/
ContentType mapset.Set
/** @type {?number} */
Width int
/** @type {?number} */
Height int
/**
* If not specified, will be inferred from the first representation.
* @type {?string}
*/
MimeType string
/** @type {?string} */
Codecs string
/** @type {!bool}*/
Main bool
/** @type {*BaseUrl} */
BaseUrl *BaseUrl
/** @type {SegmentBase} */
SegmentBase *SegmentBase
/** @type {SegmentList} */
SegmentList *SegmentList
/** @type {SegmentTemplate} */
SegmentTemplate *SegmentTemplate
/** @type {!Array.<!Representation>} */
Representations []*Representation
}
type ContentComponent ¶
type ContentProtection ¶
type Initialization ¶
func (*Initialization) Clone ¶
func (initialization *Initialization) Clone() Node
*
- Creates a deep copy of this Initialization.
- @return {!Initialization}
type ManifestInfo ¶
type ManifestInfo struct {
Live bool
MinBufferTime int
PeriodInfos []PeriodInfo
}
func NewManifestInfo ¶
func NewManifestInfo() ManifestInfo
type Mpd ¶
type Mpd struct {
/** @type {?string} */
Id string
/** @type {string} */
Type string
/** @type {*BaseUrl} */
BaseUrl *BaseUrl
/**
* The entire stream's duration, in seconds.
* @type {?number}
*/
MediaPresentationDuration int
/**
* The quantity of media, in terms of seconds, that should be buffered before
* playback begins, to ensure uninterrupted playback.
* @type {?number}
*/
MinBufferTime int
/**
* The interval, in seconds, to poll the media server for an updated
* MPD, or null if updates are not required.
* @type {?number}
*/
MinUpdatePeriod int
/**
* The wall-clock time, in seconds, that the media content specified within
* the MPD started/will start to stream.
* @type {?number}
*/
AvailabilityStartTime int64
/**
* The duration, in seconds, that the media server retains live media
* content, excluding the current segment and the previous segment, which are
* always available. For example, if this value is 60 then only media content
* up to 60 seconds from the beginning of the previous segment may be
* requested from the media server.
* @type {?number}
*/
TimeShiftBufferDepth int
//DEFAULT_SUGGESTED_PRESENTATION_DELAY_;
SuggestedPresentationDelay int
/** @type {!Array.<!Period>} */
Periods []*Period
}
type MpdProcessor ¶
type MpdProcessor struct {
ManifestInfo ManifestInfo
}
func NewMpdProcessor ¶
func NewMpdProcessor() MpdProcessor
func (*MpdProcessor) Process ¶
func (mpdProcessor *MpdProcessor) Process(mpd *Mpd)
*
- Processes the given MPD. Sets |this.periodInfos|. *
- @param {Mpd} mpd
type Node ¶
func NewAdaptationSet ¶
func NewAdaptationSet() Node
func NewBaseUrl ¶
func NewBaseUrl() Node
func NewContentComponent ¶
func NewContentComponent() Node
func NewInitialization ¶
func NewInitialization() Node
func NewRepresentation ¶
func NewRepresentation() Node
func NewRepresentationIndex ¶
func NewRepresentationIndex() Node
func NewSegmentBase ¶
func NewSegmentBase() Node
func NewSegmentList ¶
func NewSegmentList() Node
func NewSegmentTemplate ¶
func NewSegmentTemplate() Node
func NewSegmentTimePoint ¶
func NewSegmentTimePoint() Node
func NewSegmentTimeline ¶
func NewSegmentTimeline() Node
func NewSegmentUrl ¶
func NewSegmentUrl() Node
type Period ¶
type Period struct {
/** @type {?string} */
Id string
/**
* The start time of the Period, in seconds, with respect to the media
* presentation timeline. Note that the Period becomes/became available at
* Mpd.availabilityStartTime + Period.start.
* @type {?number}
*/
Start int
/**
* The duration in seconds.
* @type {?number}
*/
Duration int
/** @type {*BaseUrl} */
BaseUrl *BaseUrl
/** @type {SegmentBase} */
SegmentBase *SegmentBase
/** @type {SegmentList} */
SegmentList *SegmentList
/** @type {SegmentTemplate} */
SegmentTemplate *SegmentTemplate
/** @type {!Array.<!AdaptationSet>} */
AdaptationSets []*AdaptationSet
}
type PeriodInfo ¶
type PeriodInfo struct {
Id string
Start int
/**
* The period's duration, in seconds.
*/
Duration int
StreamSetInfos []StreamSetInfo
}
func NewPeriodInfo ¶
func NewPeriodInfo() PeriodInfo
type Range ¶
*
- A Range.
- @param {number} begin The beginning of the range.
- @param {number} end The end of the range.
type Representation ¶
type Representation struct {
/** @type {?string} */
Id string
/**
* Never seen on the Representation itself, but inherited from AdapationSet
* for convenience.
* @see AdaptationSet.lang
* @type {?string}
*/
Lang string
/**
* Bandwidth required, in bits per second, to assure uninterrupted playback,
* assuming that |minBufferTime| seconds of video are in buffer before
* playback begins.
* @type {?number}
*/
Bandwidth uint32
/** @type {?number} */
Width int
/** @type {?number} */
Height int
/** @type {?string} */
MimeType string
/** @type {?string} */
Codecs string
/** @type {*BaseUrl} */
BaseUrl *BaseUrl
/** @type {SegmentBase} */
SegmentBase *SegmentBase
/** @type {SegmentList} */
SegmentList *SegmentList
/** @type {SegmentTemplate} */
SegmentTemplate *SegmentTemplate
/** @type {!Array.<ContentProtection>} */
ContentProtections []*ContentProtection
/** @type {boolean} */
Main bool
}
type RepresentationIndex ¶
type RepresentationIndex struct {
/** @type {string} */
Url string
/**
* Inherits the value of SegmentBase.indexRange if not specified.
* @type {Range}
*/
Range *Range
}
func (*RepresentationIndex) Clone ¶
func (representationIndex *RepresentationIndex) Clone() Node
*
- Creates a deep copy of this RepresentationIndex.
- @return {!RepresentationIndex}
type SegmentBase ¶
type SegmentBase struct {
/**
* This not an actual XML attribute of SegmentBase. It is inherited from the
* SegmentBase's parent Representation.
* @type {*BaseUrl}
*/
BaseUrl *BaseUrl
/** @type {?number} */
Timescale int
/** @type {?number} */
PresentationTimeOffset int
/** @type {Range} */
IndexRange *Range
/** @type {RepresentationIndex} */
RepresentationIndex *RepresentationIndex
/** @type {Initialization} */
Initialization *Initialization
}
func (SegmentBase) Clone ¶
func (segmentBase SegmentBase) Clone() Node
*
- Creates a deep copy of this SegmentBase.
- @return {!SegmentBase}
type SegmentIndex ¶
type SegmentIndex struct {
References []*SegmentReference
TimestampCorrection int
}
func NewSegmentIndex ¶
func NewSegmentIndex(references []*SegmentReference) SegmentIndex
*
- Creates a SegmentIndex. *
- @param {!Array.<!SegmentReference>} references Sorted by time in
- ascending order with no gaps.
func (SegmentIndex) Last ¶
func (segmentIndex SegmentIndex) Last() *SegmentReference
*
- Gets the last SegmentReference. *
- @return {!SegmentReference} The last SegmentReference.
- @throws {RangeError} when there are no SegmentReferences.
func (SegmentIndex) Length ¶
func (segmentIndex SegmentIndex) Length() int
*
- Gets the number of SegmentReferences. *
- @return {number}
type SegmentList ¶
type SegmentList struct {
/**
* This not an actual XML attribute of SegmentList. It is inherited from the
* SegmentList's parent Representation.
* @type {BaseUrl}
*/
BaseUrl *BaseUrl
/** @type {?number} */
Timescale uint32 // xs:unsignedInt
/** @type {?number} */
PresentationTimeOffset uint64 // xs:unsignedLong
/**
* Each segment's duration. This value is never zero.
* @type {?number}
*/
SegmentDuration int // xs:duration
/**
* The segment number origin. This value is never zero.
* @type {?number}
*/
StartNumber uint32 // xs:unsignedInt
/** @type {Initialization} */
Initialization *Initialization
/** @type {!Array.<SegmentUrl>} */
SegmentUrls []*SegmentUrl
}
func (SegmentList) Clone ¶
func (segmentList SegmentList) Clone() Node
*
- Creates a deep copy of this SegmentList.
- @return {!SegmentList}
type SegmentMetadataInfo ¶
func NewSegmentMetadataInfo ¶
func NewSegmentMetadataInfo() SegmentMetadataInfo
type SegmentReference ¶
type SegmentReference struct {
/**
* The segment's ID.
* @const {number}
*/
Id uint64
/**
* The time, in seconds, that the segment begins.
* @const {number}
*/
StartTime uint64
/**
* The time, in seconds, that the segment ends. The segment ends immediately
* before this time. A null value indicates that the segment continues to the
* end of the stream.
* @const {?number}
*/
EndTime uint64
/**
* The position of the segment's first byte.
* @const {number}
*/
StartByte int
/**
* The position of the segment's last byte, inclusive. A null value indicates
* that the segment continues to the end of the file located at |url|.
* @const {?number}
*/
EndByte int
/**
* The segment's location.
* @const {!string}
*/
Url string
}
func NewSegmentReference ¶
func NewSegmentReference(id, startTime, endTime uint64, startByte, endByte int, url string) SegmentReference
type SegmentTemplate ¶
type SegmentTemplate struct {
/** @type {?number} */
Timescale uint32 // xs:unsignedInt
/** @type {?number} */
PresentationTimeOffset int // xs:unsignedLong
/**
* Each segment's duration. This value is never zero.
* @type {?number}
*/
SegmentDuration int // xs:duration
/**
* The segment number origin. This value is never zero.
* @type {?number}
*/
StartNumber int // xs:unsignedInt
/** @type {?string} */
MediaUrlTemplate string
/** @type {?string} */
IndexUrlTemplate string
/** @type {?string} */
InitializationUrlTemplate string
/** @type {SegmentTimeline} */
Timeline *SegmentTimeline
}
func (SegmentTemplate) Clone ¶
func (segmentTemplate SegmentTemplate) Clone() Node
type SegmentTimePoint ¶
type SegmentTimePoint struct {
/**
* The start time of the media segment, in seconds, relative to the beginning
* of the Period.
* @type {?number}
*/
StartTime uint64
/** @type {?number} */
Duration uint64
/** @type {?number} */
Repeat int
}
func (*SegmentTimePoint) Clone ¶
func (segmentTimePoint *SegmentTimePoint) Clone() Node
*
- Creates a deep copy of this SegmentTimePoint.
- @return {!SegmentTimePoint}
type SegmentTimeline ¶
type SegmentTimeline struct {
/** @type {!Array.<!SegmentTimePoint>} */
TimePoints []*SegmentTimePoint
}
func (*SegmentTimeline) Clone ¶
func (segmentTimeline *SegmentTimeline) Clone() Node
*
- Creates a deep copy of this SegmentTimeline.
- @return {!SegmentTimeline}
type SegmentUrl ¶
type SegmentUrl struct {
/** @type {string} */
MediaUrl string
/** @type {Range} */
MediaRange *Range
}
func (*SegmentUrl) Clone ¶
func (segmentUrl *SegmentUrl) Clone() Node
*
- Creates a deep copy of this SegmentUrl.
- @return {!SegmentUrl}
type StreamInfo ¶
type StreamInfo struct {
UniqueId int
Id string
/**
* An offset, in seconds, to apply to each timestamp within each media
* segment that's put in buffer.
*/
TimestampOffset int
/**
* Indicates the stream's current segment's start time, i.e., its live-edge.
* This value is non-null if the stream is both live and available;
* otherwise, this value is null.
*/
CurrentSegmentStartTime uint64
/**
* Bandwidth required, in bits per second, to assure uninterrupted playback,
* assuming that |minBufferTime| seconds of video are in buffer before
* playback begins.
*/
Bandwidth uint32
Width int
Height int
MimeType string
Codecs string
MediaUrl string
Enabled bool
/**
* The stream's SegmentIndex metadata.
* @see {StreamInfo.isAvailable}
*/
SegmentIndexInfo *SegmentMetadataInfo
/**
* The stream's segment initialization metadata.
* @type {SegmentMetadataInfo}
*/
SegmentInitializationInfo *SegmentMetadataInfo
/**
* The stream's SegmentIndex.
* @see {StreamInfo.isAvailable}
* @type {SegmentIndex}
*/
SegmentIndex *SegmentIndex
/** @type {ArrayBuffer} */
SegmentInitializationData []byte
/** @private {ArrayBuffer} */
SegmentIndexData []byte
}
func NewStreamInfo ¶
func NewStreamInfo() StreamInfo
type StreamSetInfo ¶
type StreamSetInfo struct {
/** @type {number} */
UniqueId int
/** @type {?string} */
Id string
/** @type {string} */
ContentType mapset.Set
/** @type {!Array.<!StreamInfo>} */
StreamInfos []*StreamInfo
/** @type {string} */
Lang string
/** @type {boolean} */
Main bool
}
func NewStreamSetInfo ¶
func NewStreamSetInfo() StreamSetInfo
Source Files
¶
- Segment_Index.go
- adaptation_set.go
- assert.go
- base-url.go
- cenc_pssh.go
- content_component.go
- content_protection.go
- fake_node.go
- initialization.go
- manifest_info.go
- mpd.go
- mpd_processor.go
- pair.go
- parser.go
- period.go
- period_info.go
- representation.go
- representation_index.go
- role.go
- segment_base.go
- segment_list.go
- segment_metadata_info.go
- segment_reference.go
- segment_template.go
- segment_time_point.go
- segment_timeline.go
- segment_url.go
- stream_info.go
- stream_set_info.go
- timeline.go
- util.go
Click to show internal directories.
Click to hide internal directories.