dashreader

package module
v0.0.0-...-56e5b57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2020 License: MIT Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dashreader

go structs for DASH xsd

#Generation XSD schema

#DASH IOP Reference DASH-IF-IOP-v4.3

#Support

DASH live without MPD Update

  • TBD

DASH live with MPD Update

  • Single Period
  • Multi Period
  • $Time$ urls
  • $Number$ urls

DASH ondemand

  • TBD

Documentation

Index

Constants

View Source
const (
	//MatchResultDontCare - don't care
	MatchResultDontCare = -1
	//MatchResultNotFound - Not found
	MatchResultNotFound = 0
	//MatchResultPartial - found partial
	MatchResultPartial = 1
	//MatchResultFound - found
	MatchResultFound = 2
)
View Source
const (
	//LiveProfile - String for Live Profile, Field: MPD@Profiles
	LiveProfile = "urn:mpeg:dash:profile:isoff-live:2011"
	//OnDemandProfile - String for OnDemandProfile Profile, Field: MPD@Profiles
	OnDemandProfile = "urn:mpeg:dash:profile:isoff-ondemand:2011"
	//RepresentationIDToken - Token part of SegmentTemplate@Media or SegmentTemplate@Index
	RepresentationIDToken = "$RepresentationID$"
	//TimeToken - Token part of SegmentTemplate@Media
	TimeToken = "$Time$"
	//NumberToken - Token part of SegmentTemplate@Media
	NumberToken = "$Number$"
)
View Source
const (
	EvtMPDTimelineGapFilled           = "MPD_ERR_TIMELINE_GAP"               //Filled duration gap
	EvtMPDTimelineInFuture            = "MPD_ERR_TIMELINE_FUTURE"            //TimeLine in Future - WC, StartTime
	EvtMPDTimelineNoLivePointEntries  = "MPD_ERR_NO_LIVEPOINT_ENTRIES"       //No Entries found
	EvtMPDPublishTimeOld              = "MPD_PUBLISH_TIME_OLD"               //Publish time is older than previous
	EvtMPDNoActivePeriod              = "MPD_NO_ACTIVE_PERIOD"               //Period active not found
	EvtMPDNoAdaptAfterFilter          = "MPD_NO_ADAPT_AFTER_FILTER"          //No AdaptationSets after filter
	EvtMPDNoRepresentationAfterFilter = "MPD_NO_REPRESENTATION_AFTER_FILTER" //No Representations after filter

)

EVENT NAMES

Variables

This section is empty.

Functions

func AdjustURLPath

func AdjustURLPath(refURL url.URL, adjustURL []BaseURLType, relativePath string) (*url.URL, error)

AdjustURLPath - Adjusts the URL Path to include the pathURL

func GetBoolFromConditionalUintType

func GetBoolFromConditionalUintType(v ConditionalUintType) bool

GetBoolFromConditionalUintType - returns true/false

func GetFrameRate

func GetFrameRate(frameRate string) (float64, error)

GetFrameRate - Evaluate Framerate to float

func IsPresentDuration

func IsPresentDuration(durationStr string) bool

IsPresentDuration - Checks if Time field is Valid (Non-ZERO)

func IsPresentTime

func IsPresentTime(val time.Time) bool

IsPresentTime - Checks if Time field is Valid (Non-ZERO)

func ParseDuration

func ParseDuration(durationStr string) (time.Duration, error)

ParseDuration - Convert to time.Duration

Types

type ActuateType

type ActuateType string

May be one of onLoad, onRequest, other, none

type AdaptationSetType

type AdaptationSetType struct {
	Items                     []string               `xml:",any"`
	FramePacking              []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 FramePacking,omitempty"`
	AudioChannelConfiguration []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 AudioChannelConfiguration,omitempty"`
	ContentProtection         []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 ContentProtection,omitempty"`
	EssentialProperty         []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 EssentialProperty,omitempty"`
	SupplementalProperty      []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 SupplementalProperty,omitempty"`
	InbandEventStream         []EventStreamType      `xml:"urn:mpeg:dash:schema:mpd:2011 InbandEventStream,omitempty"`
	Accessibility             []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 Accessibility,omitempty"`
	Role                      []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 Role,omitempty"`
	Rating                    []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 Rating,omitempty"`
	Viewpoint                 []DescriptorType       `xml:"urn:mpeg:dash:schema:mpd:2011 Viewpoint,omitempty"`
	ContentComponent          []ContentComponentType `xml:"urn:mpeg:dash:schema:mpd:2011 ContentComponent,omitempty"`
	BaseURL                   []BaseURLType          `xml:"urn:mpeg:dash:schema:mpd:2011 BaseURL,omitempty"`
	SegmentBase               SegmentBaseType        `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentBase,omitempty"`
	SegmentList               SegmentListType        `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentList,omitempty"`
	SegmentTemplate           SegmentTemplateType    `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentTemplate,omitempty"`
	Representation            []RepresentationType   `xml:"urn:mpeg:dash:schema:mpd:2011 Representation,omitempty"`
	Href                      string                 `xml:"href,attr,omitempty"`
	Actuate                   ActuateType            `xml:"actuate,attr,omitempty"`
	Id                        uint                   `xml:"id,attr,omitempty"`
	Group                     uint                   `xml:"group,attr,omitempty"`
	Lang                      string                 `xml:"lang,attr,omitempty"`
	ContentType               string                 `xml:"contentType,attr,omitempty"`
	Par                       RatioType              `xml:"par,attr,omitempty"`
	MinBandwidth              uint                   `xml:"minBandwidth,attr,omitempty"`
	MaxBandwidth              uint                   `xml:"maxBandwidth,attr,omitempty"`
	MinWidth                  uint                   `xml:"minWidth,attr,omitempty"`
	MaxWidth                  uint                   `xml:"maxWidth,attr,omitempty"`
	MinHeight                 uint                   `xml:"minHeight,attr,omitempty"`
	MaxHeight                 uint                   `xml:"maxHeight,attr,omitempty"`
	MinFrameRate              FrameRateType          `xml:"minFrameRate,attr,omitempty"`
	MaxFrameRate              FrameRateType          `xml:"maxFrameRate,attr,omitempty"`
	SegmentAlignment          ConditionalUintType    `xml:"segmentAlignment,attr,omitempty"`
	SubsegmentAlignment       ConditionalUintType    `xml:"subsegmentAlignment,attr,omitempty"`
	SubsegmentStartsWithSAP   uint                   `xml:"subsegmentStartsWithSAP,attr,omitempty"`
	BitstreamSwitching        bool                   `xml:"bitstreamSwitching,attr,omitempty"`
	Profiles                  string                 `xml:"profiles,attr,omitempty"`
	Width                     uint                   `xml:"width,attr,omitempty"`
	Height                    uint                   `xml:"height,attr,omitempty"`
	Sar                       RatioType              `xml:"sar,attr,omitempty"`
	FrameRate                 FrameRateType          `xml:"frameRate,attr,omitempty"`
	AudioSamplingRate         string                 `xml:"audioSamplingRate,attr,omitempty"`
	MimeType                  string                 `xml:"mimeType,attr,omitempty"`
	SegmentProfiles           string                 `xml:"segmentProfiles,attr,omitempty"`
	Codecs                    string                 `xml:"codecs,attr,omitempty"`
	MaximumSAPPeriod          float64                `xml:"maximumSAPPeriod,attr,omitempty"`
	StartWithSAP              uint                   `xml:"startWithSAP,attr,omitempty"`
	MaxPlayoutRate            float64                `xml:"maxPlayoutRate,attr,omitempty"`
	CodingDependency          bool                   `xml:"codingDependency,attr,omitempty"`
	ScanType                  VideoScanType          `xml:"scanType,attr,omitempty"`
}

func (*AdaptationSetType) UnmarshalXML

func (t *AdaptationSetType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type BaseURLType

type BaseURLType struct {
	Value                    string  `xml:",chardata"`
	ServiceLocation          string  `xml:"serviceLocation,attr,omitempty"`
	ByteRange                string  `xml:"byteRange,attr,omitempty"`
	AvailabilityTimeOffset   float64 `xml:"availabilityTimeOffset,attr,omitempty"`
	AvailabilityTimeComplete bool    `xml:"availabilityTimeComplete,attr,omitempty"`
}

type ChunkURL

type ChunkURL struct {
	//ChunkURL - Actual URL
	ChunkURL url.URL
	//Range - Range Header
	Range string
	//FetchAt - WallClock Time when URL becomes available
	FetchAt time.Time
	//Duration - Duration of content available in this URL
	Duration time.Duration
}

ChunkURL - URL extracted from MPD for playback

type ChunkURLChannel

type ChunkURLChannel chan ChunkURL

ChunkURLChannel - Channel of Chunk URLs

type ConditionalUintType

type ConditionalUintType string

type ContentComponentType

type ContentComponentType struct {
	Items         []string         `xml:",any"`
	Accessibility []DescriptorType `xml:"urn:mpeg:dash:schema:mpd:2011 Accessibility,omitempty"`
	Role          []DescriptorType `xml:"urn:mpeg:dash:schema:mpd:2011 Role,omitempty"`
	Rating        []DescriptorType `xml:"urn:mpeg:dash:schema:mpd:2011 Rating,omitempty"`
	Viewpoint     []DescriptorType `xml:"urn:mpeg:dash:schema:mpd:2011 Viewpoint,omitempty"`
	Id            uint             `xml:"id,attr,omitempty"`
	Lang          string           `xml:"lang,attr,omitempty"`
	ContentType   string           `xml:"contentType,attr,omitempty"`
	Par           RatioType        `xml:"par,attr,omitempty"`
}

type DescriptorType

type DescriptorType struct {
	Items       []string `xml:",any"`
	SchemeIdUri string   `xml:"schemeIdUri,attr"`
	Value       string   `xml:"value,attr,omitempty"`
	Id          string   `xml:"id,attr,omitempty"`
}

type EventStreamType

type EventStreamType struct {
	Items       []string    `xml:",any"`
	Event       []EventType `xml:"urn:mpeg:dash:schema:mpd:2011 Event,omitempty"`
	Href        string      `xml:"href,attr,omitempty"`
	Actuate     ActuateType `xml:"actuate,attr,omitempty"`
	SchemeIdUri string      `xml:"schemeIdUri,attr"`
	Value       string      `xml:"value,attr,omitempty"`
	Timescale   uint        `xml:"timescale,attr,omitempty"`
}

func (*EventStreamType) UnmarshalXML

func (t *EventStreamType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type EventType

type EventType struct {
	Items            []string `xml:",any"`
	PresentationTime uint64   `xml:"presentationTime,attr,omitempty"`
	Duration         uint64   `xml:"duration,attr,omitempty"`
	Id               uint     `xml:"id,attr,omitempty"`
	MessageData      string   `xml:"messageData,attr,omitempty"`
}

func (*EventType) UnmarshalXML

func (t *EventType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type FrameRateType

type FrameRateType string

Must match the pattern [0-9]*[0-9](/[0-9]*[0-9])?

type MPDtype

type MPDtype struct {
	Items                      []string                 `xml:",any"`
	ProgramInformation         []ProgramInformationType `xml:"urn:mpeg:dash:schema:mpd:2011 ProgramInformation,omitempty"`
	BaseURL                    []BaseURLType            `xml:"urn:mpeg:dash:schema:mpd:2011 BaseURL,omitempty"`
	Location                   []string                 `xml:"urn:mpeg:dash:schema:mpd:2011 Location,omitempty"`
	Period                     []PeriodType             `xml:"urn:mpeg:dash:schema:mpd:2011 Period"`
	Metrics                    []MetricsType            `xml:"urn:mpeg:dash:schema:mpd:2011 Metrics,omitempty"`
	EssentialProperty          []DescriptorType         `xml:"urn:mpeg:dash:schema:mpd:2011 EssentialProperty,omitempty"`
	SupplementalProperty       []DescriptorType         `xml:"urn:mpeg:dash:schema:mpd:2011 SupplementalProperty,omitempty"`
	UTCTiming                  []DescriptorType         `xml:"urn:mpeg:dash:schema:mpd:2011 UTCTiming,omitempty"`
	Id                         string                   `xml:"id,attr,omitempty"`
	Profiles                   string                   `xml:"profiles,attr"`
	Type                       PresentationType         `xml:"type,attr,omitempty"`
	AvailabilityStartTime      time.Time                `xml:"availabilityStartTime,attr,omitempty"`
	AvailabilityEndTime        time.Time                `xml:"availabilityEndTime,attr,omitempty"`
	PublishTime                time.Time                `xml:"publishTime,attr,omitempty"`
	MediaPresentationDuration  string                   `xml:"mediaPresentationDuration,attr,omitempty"`
	MinimumUpdatePeriod        string                   `xml:"minimumUpdatePeriod,attr,omitempty"`
	MinBufferTime              string                   `xml:"minBufferTime,attr"`
	TimeShiftBufferDepth       string                   `xml:"timeShiftBufferDepth,attr,omitempty"`
	SuggestedPresentationDelay string                   `xml:"suggestedPresentationDelay,attr,omitempty"`
	MaxSegmentDuration         string                   `xml:"maxSegmentDuration,attr,omitempty"`
	MaxSubsegmentDuration      string                   `xml:"maxSubsegmentDuration,attr,omitempty"`
}

func ReadMPDFromFile

func ReadMPDFromFile(filename string) (*MPDtype, error)

ReadMPDFromFile - Reads from a File strored into an MPD object returned.

func ReadMPDFromStream

func ReadMPDFromStream(r io.Reader) (*MPDtype, error)

ReadMPDFromStream - Reads from an io.Reader interface into an MPD object returned. r - Must implement the io.Reader interface.

func (*MPDtype) MarshalXML

func (t *MPDtype) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*MPDtype) UnmarshalXML

func (t *MPDtype) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type MaxBWRepresentationSelector

type MaxBWRepresentationSelector struct {
}

MaxBWRepresentationSelector - Selects the minimum of the available BW

func (MaxBWRepresentationSelector) SelectRepresentation

func (s MaxBWRepresentationSelector) SelectRepresentation(reps []*RepresentationType) *RepresentationType

SelectRepresentation - Selects one of the available representationss

type MetricsType

type MetricsType struct {
	Items     []string         `xml:",any"`
	Reporting []DescriptorType `xml:"urn:mpeg:dash:schema:mpd:2011 Reporting"`
	Range     []RangeType      `xml:"urn:mpeg:dash:schema:mpd:2011 Range,omitempty"`
	Metrics   string           `xml:"metrics,attr"`
}

type MinBWRepresentationSelector

type MinBWRepresentationSelector struct {
}

MinBWRepresentationSelector - Selects the minimum of the available BW

func (MinBWRepresentationSelector) SelectRepresentation

func (s MinBWRepresentationSelector) SelectRepresentation(reps []*RepresentationType) *RepresentationType

SelectRepresentation - Selects one of the available representationss

type MultipleSegmentBaseType

type MultipleSegmentBaseType struct {
	Items                    []string            `xml:",any"`
	Initialization           URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 Initialization,omitempty"`
	RepresentationIndex      URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 RepresentationIndex,omitempty"`
	SegmentTimeline          SegmentTimelineType `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentTimeline,omitempty"`
	BitstreamSwitching       URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 BitstreamSwitching,omitempty"`
	Duration                 uint                `xml:"duration,attr,omitempty"`
	StartNumber              uint                `xml:"startNumber,attr,omitempty"`
	Timescale                uint                `xml:"timescale,attr,omitempty"`
	PresentationTimeOffset   uint64              `xml:"presentationTimeOffset,attr,omitempty"`
	IndexRange               string              `xml:"indexRange,attr,omitempty"`
	IndexRangeExact          bool                `xml:"indexRangeExact,attr,omitempty"`
	AvailabilityTimeOffset   float64             `xml:"availabilityTimeOffset,attr,omitempty"`
	AvailabilityTimeComplete bool                `xml:"availabilityTimeComplete,attr,omitempty"`
}

func (*MultipleSegmentBaseType) UnmarshalXML

func (t *MultipleSegmentBaseType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PeriodType

type PeriodType struct {
	Items                []string            `xml:",any"`
	BaseURL              []BaseURLType       `xml:"urn:mpeg:dash:schema:mpd:2011 BaseURL,omitempty"`
	SegmentBase          SegmentBaseType     `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentBase,omitempty"`
	SegmentList          SegmentListType     `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentList,omitempty"`
	SegmentTemplate      SegmentTemplateType `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentTemplate,omitempty"`
	AssetIdentifier      DescriptorType      `xml:"urn:mpeg:dash:schema:mpd:2011 AssetIdentifier,omitempty"`
	EventStream          []EventStreamType   `xml:"urn:mpeg:dash:schema:mpd:2011 EventStream,omitempty"`
	AdaptationSet        []AdaptationSetType `xml:"urn:mpeg:dash:schema:mpd:2011 AdaptationSet,omitempty"`
	Subset               []SubsetType        `xml:"urn:mpeg:dash:schema:mpd:2011 Subset,omitempty"`
	SupplementalProperty []DescriptorType    `xml:"urn:mpeg:dash:schema:mpd:2011 SupplementalProperty,omitempty"`
	Href                 string              `xml:"href,attr,omitempty"`
	Actuate              ActuateType         `xml:"actuate,attr,omitempty"`
	Id                   string              `xml:"id,attr,omitempty"`
	Start                string              `xml:"start,attr,omitempty"`
	Duration             string              `xml:"duration,attr,omitempty"`
	BitstreamSwitching   bool                `xml:"bitstreamSwitching,attr,omitempty"`
}

func (*PeriodType) UnmarshalXML

func (t *PeriodType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PresentationType

type PresentationType string

May be one of static, dynamic

type ProgramInformationType

type ProgramInformationType struct {
	Items              []string `xml:",any"`
	Title              string   `xml:"urn:mpeg:dash:schema:mpd:2011 Title,omitempty"`
	Source             string   `xml:"urn:mpeg:dash:schema:mpd:2011 Source,omitempty"`
	Copyright          string   `xml:"urn:mpeg:dash:schema:mpd:2011 Copyright,omitempty"`
	Lang               string   `xml:"lang,attr,omitempty"`
	MoreInformationURL string   `xml:"moreInformationURL,attr,omitempty"`
}

type RangeType

type RangeType struct {
	Starttime string `xml:"starttime,attr,omitempty"`
	Duration  string `xml:"duration,attr,omitempty"`
}

type RatioType

type RatioType string

Must match the pattern [0-9]*:[0-9]*

type Reader

type Reader interface {
	//Update -
	// Parameters:
	//   MPD read
	// Return:
	//   1: MPD Updated - PublishTime Updated?
	//   2: error
	Update(*MPDtype) (bool, error)

	//MakeDASHReaderContext - Makes Reader Context
	// Parameters:
	//   1: Context received earlier... if first time pass nil
	//   2: StreamSelector for the ContentType to select AdaptationSet
	//   3: RepresentationSelector ... selector for Representation
	// Return:
	//   1: Context for current AdaptationSet,Representation
	//   2: error
	MakeDASHReaderContext(ReaderContext, StreamSelector, RepresentationSelector) (ReaderContext, error)

	//SetStatzAgg - Set StatzAgg for event forwarding
	// Parameters;
	//   StatzAgg
	// Return:
	//   NA
	SetStatzAgg(statzAgg statzagg.StatzAgg)
}

Reader - Read any DASH file and get Playback URLs

type ReaderContext

type ReaderContext interface {
	//NextURL -
	//-- Once end is reached (io.EOF)
	//-- MakeDASHReaderContext has to be called again
	// Parameters;
	//   None
	// Return:
	//   1: Next URL
	//   2: error
	NextURL() (*ChunkURL, error)

	//GetURLs - Get URLs from Current MPD context
	//-- Once end of this list is reached
	//-- MakeDASHReaderContext has to be called again
	// Parameters;
	//   context for cancellation
	// Return:
	//   1: Channel of URLs, can be read till closed
	//   2: error
	NextURLs(context.Context) (<-chan ChunkURL, error)

	//GetFramerate - Framerate of content
	GetFramerate() float64
	//GetContentType - Content Type of content
	GetContentType() string
	//GetLang - Lang of content
	GetLang() string
	//GetCodecs - Codecs of content
	GetCodecs() string
}

ReaderContext - Unique data for each Reader

type ReaderFactory

type ReaderFactory struct {
	//IsLive - Live content?
	IsLive bool
	//AST - Availablity Start Time - WallClock reference
	AST time.Time
	//PT - Publish Time - WallClock when MPD wa updated
	PT time.Time
	//MUP - Minimum Update Period - Polling interval for Manifest update
	MUP time.Duration
	//MBT - Minimum Buffer Period - Client consideratino for cache level
	MBT time.Duration
	//MPD - Media Presentation Duration - Presentation Duration
	MPD time.Duration
	//TSB - Total available duration of content
	TSB time.Duration
	// contains filtered or unexported fields
}

ReaderFactory - ReaderFactory of DASHReaders

func (*ReaderFactory) GetDASHReader

func (f *ReaderFactory) GetDASHReader(ID string, mpdURL string, mpd *MPDtype) (Reader, error)

GetDASHReader - Depending on the MPD contents find the right reader

type RepresentationBaseType

type RepresentationBaseType struct {
	Items                     []string          `xml:",any"`
	FramePacking              []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 FramePacking,omitempty"`
	AudioChannelConfiguration []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 AudioChannelConfiguration,omitempty"`
	ContentProtection         []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 ContentProtection,omitempty"`
	EssentialProperty         []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 EssentialProperty,omitempty"`
	SupplementalProperty      []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 SupplementalProperty,omitempty"`
	InbandEventStream         []EventStreamType `xml:"urn:mpeg:dash:schema:mpd:2011 InbandEventStream,omitempty"`
	Profiles                  string            `xml:"profiles,attr,omitempty"`
	Width                     uint              `xml:"width,attr,omitempty"`
	Height                    uint              `xml:"height,attr,omitempty"`
	Sar                       RatioType         `xml:"sar,attr,omitempty"`
	FrameRate                 FrameRateType     `xml:"frameRate,attr,omitempty"`
	AudioSamplingRate         string            `xml:"audioSamplingRate,attr,omitempty"`
	MimeType                  string            `xml:"mimeType,attr,omitempty"`
	SegmentProfiles           string            `xml:"segmentProfiles,attr,omitempty"`
	Codecs                    string            `xml:"codecs,attr,omitempty"`
	MaximumSAPPeriod          float64           `xml:"maximumSAPPeriod,attr,omitempty"`
	StartWithSAP              uint              `xml:"startWithSAP,attr,omitempty"`
	MaxPlayoutRate            float64           `xml:"maxPlayoutRate,attr,omitempty"`
	CodingDependency          bool              `xml:"codingDependency,attr,omitempty"`
	ScanType                  VideoScanType     `xml:"scanType,attr,omitempty"`
}

type RepresentationSelector

type RepresentationSelector interface {
	SelectRepresentation([]*RepresentationType) *RepresentationType
}

RepresentationSelector - Decides among the list of representations which one to use

type RepresentationType

type RepresentationType struct {
	Items                     []string                `xml:",any"`
	FramePacking              []DescriptorType        `xml:"urn:mpeg:dash:schema:mpd:2011 FramePacking,omitempty"`
	AudioChannelConfiguration []DescriptorType        `xml:"urn:mpeg:dash:schema:mpd:2011 AudioChannelConfiguration,omitempty"`
	ContentProtection         []DescriptorType        `xml:"urn:mpeg:dash:schema:mpd:2011 ContentProtection,omitempty"`
	EssentialProperty         []DescriptorType        `xml:"urn:mpeg:dash:schema:mpd:2011 EssentialProperty,omitempty"`
	SupplementalProperty      []DescriptorType        `xml:"urn:mpeg:dash:schema:mpd:2011 SupplementalProperty,omitempty"`
	InbandEventStream         []EventStreamType       `xml:"urn:mpeg:dash:schema:mpd:2011 InbandEventStream,omitempty"`
	BaseURL                   []BaseURLType           `xml:"urn:mpeg:dash:schema:mpd:2011 BaseURL,omitempty"`
	SubRepresentation         []SubRepresentationType `xml:"urn:mpeg:dash:schema:mpd:2011 SubRepresentation,omitempty"`
	SegmentBase               SegmentBaseType         `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentBase,omitempty"`
	SegmentList               SegmentListType         `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentList,omitempty"`
	SegmentTemplate           SegmentTemplateType     `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentTemplate,omitempty"`
	Id                        StringNoWhitespaceType  `xml:"id,attr"`
	Bandwidth                 uint                    `xml:"bandwidth,attr"`
	QualityRanking            uint                    `xml:"qualityRanking,attr,omitempty"`
	DependencyId              StringVectorType        `xml:"dependencyId,attr,omitempty"`
	MediaStreamStructureId    StringVectorType        `xml:"mediaStreamStructureId,attr,omitempty"`
	Profiles                  string                  `xml:"profiles,attr,omitempty"`
	Width                     uint                    `xml:"width,attr,omitempty"`
	Height                    uint                    `xml:"height,attr,omitempty"`
	Sar                       RatioType               `xml:"sar,attr,omitempty"`
	FrameRate                 FrameRateType           `xml:"frameRate,attr,omitempty"`
	AudioSamplingRate         string                  `xml:"audioSamplingRate,attr,omitempty"`
	MimeType                  string                  `xml:"mimeType,attr,omitempty"`
	SegmentProfiles           string                  `xml:"segmentProfiles,attr,omitempty"`
	Codecs                    string                  `xml:"codecs,attr,omitempty"`
	MaximumSAPPeriod          float64                 `xml:"maximumSAPPeriod,attr,omitempty"`
	StartWithSAP              uint                    `xml:"startWithSAP,attr,omitempty"`
	MaxPlayoutRate            float64                 `xml:"maxPlayoutRate,attr,omitempty"`
	CodingDependency          bool                    `xml:"codingDependency,attr,omitempty"`
	ScanType                  VideoScanType           `xml:"scanType,attr,omitempty"`
}

type S

type S struct {
	T uint64 `xml:"t,attr,omitempty"`
	N uint64 `xml:"n,attr,omitempty"`
	D uint64 `xml:"d,attr"`
	R int    `xml:"r,attr,omitempty"`
}

func (*S) UnmarshalXML

func (t *S) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SegmentBaseType

type SegmentBaseType struct {
	Items                    []string `xml:",any"`
	Initialization           URLType  `xml:"urn:mpeg:dash:schema:mpd:2011 Initialization,omitempty"`
	RepresentationIndex      URLType  `xml:"urn:mpeg:dash:schema:mpd:2011 RepresentationIndex,omitempty"`
	Timescale                uint     `xml:"timescale,attr,omitempty"`
	PresentationTimeOffset   uint64   `xml:"presentationTimeOffset,attr,omitempty"`
	IndexRange               string   `xml:"indexRange,attr,omitempty"`
	IndexRangeExact          bool     `xml:"indexRangeExact,attr,omitempty"`
	AvailabilityTimeOffset   float64  `xml:"availabilityTimeOffset,attr,omitempty"`
	AvailabilityTimeComplete bool     `xml:"availabilityTimeComplete,attr,omitempty"`
}

func (*SegmentBaseType) UnmarshalXML

func (t *SegmentBaseType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SegmentListType

type SegmentListType struct {
	Items                    []string            `xml:",any"`
	Initialization           URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 Initialization,omitempty"`
	RepresentationIndex      URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 RepresentationIndex,omitempty"`
	SegmentTimeline          SegmentTimelineType `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentTimeline,omitempty"`
	BitstreamSwitching       URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 BitstreamSwitching,omitempty"`
	SegmentURL               []SegmentURLType    `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentURL,omitempty"`
	Href                     string              `xml:"href,attr,omitempty"`
	Actuate                  ActuateType         `xml:"actuate,attr,omitempty"`
	Duration                 uint                `xml:"duration,attr,omitempty"`
	StartNumber              uint                `xml:"startNumber,attr,omitempty"`
	Timescale                uint                `xml:"timescale,attr,omitempty"`
	PresentationTimeOffset   uint64              `xml:"presentationTimeOffset,attr,omitempty"`
	IndexRange               string              `xml:"indexRange,attr,omitempty"`
	IndexRangeExact          bool                `xml:"indexRangeExact,attr,omitempty"`
	AvailabilityTimeOffset   float64             `xml:"availabilityTimeOffset,attr,omitempty"`
	AvailabilityTimeComplete bool                `xml:"availabilityTimeComplete,attr,omitempty"`
}

func (*SegmentListType) UnmarshalXML

func (t *SegmentListType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SegmentTemplateType

type SegmentTemplateType struct {
	Items                    []string            `xml:",any"`
	Initialization           URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 Initialization,omitempty"`
	RepresentationIndex      URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 RepresentationIndex,omitempty"`
	SegmentTimeline          SegmentTimelineType `xml:"urn:mpeg:dash:schema:mpd:2011 SegmentTimeline,omitempty"`
	BitstreamSwitching       URLType             `xml:"urn:mpeg:dash:schema:mpd:2011 BitstreamSwitching,omitempty"`
	Media                    string              `xml:"media,attr,omitempty"`
	Index                    string              `xml:"index,attr,omitempty"`
	InitializationAttr       string              `xml:"initialization,attr,omitempty"`
	BitstreamSwitchingAttr   string              `xml:"bitstreamSwitching,attr,omitempty"`
	Duration                 uint                `xml:"duration,attr,omitempty"`
	StartNumber              uint                `xml:"startNumber,attr,omitempty"`
	Timescale                uint                `xml:"timescale,attr,omitempty"`
	PresentationTimeOffset   uint64              `xml:"presentationTimeOffset,attr,omitempty"`
	IndexRange               string              `xml:"indexRange,attr,omitempty"`
	IndexRangeExact          bool                `xml:"indexRangeExact,attr,omitempty"`
	AvailabilityTimeOffset   float64             `xml:"availabilityTimeOffset,attr,omitempty"`
	AvailabilityTimeComplete bool                `xml:"availabilityTimeComplete,attr,omitempty"`
}

func (*SegmentTemplateType) UnmarshalXML

func (t *SegmentTemplateType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SegmentTimelineType

type SegmentTimelineType struct {
	Items []string `xml:",any"`
	S     []S      `xml:"urn:mpeg:dash:schema:mpd:2011 S"`
}

type SegmentURLType

type SegmentURLType struct {
	Items      []string `xml:",any"`
	Media      string   `xml:"media,attr,omitempty"`
	MediaRange string   `xml:"mediaRange,attr,omitempty"`
	Index      string   `xml:"index,attr,omitempty"`
	IndexRange string   `xml:"indexRange,attr,omitempty"`
}

type StreamSelector

type StreamSelector struct {
	ID          string   `json:"id,omitempty"`
	ContentType string   `json:"contentType"`
	BitRates    []string `json:"bitratesexprs,omitempty"`
	Codecs      []string `json:"codecsregexs,omitempty"`
	Langs       []string `json:"langsregexs,omitempty"`
}

StreamSelector - Selection criteria for checking if AdaptationSet is good ContentType - "video","audio", etc... BitRates supported (bps) - 3000000 (for 3mpbs)

if empty anything is accepted
e.g. >3000000, <=3000000, ==3000000

Codecs supported - regex

if empty anything is accepted
e.g. hvc1*, avc1.*

Langs supported - regex of ISO 639-2 lang code

if empty anything is accepted
e.g. eng, spa

func (*StreamSelector) IsMatch

func (s *StreamSelector) IsMatch(adaptSet AdaptationSetType) int

IsMatch - Finds if codecs present and required matches adaptSet : AdaptationSet return -

-1 - Don't Care
 0 - Not Found
 1 - Partial match
 2 - Full match

func (*StreamSelector) IsMatchRepresentation

func (s *StreamSelector) IsMatchRepresentation(representation RepresentationType) int

IsMatchRepresentation - Finds if codecs present and required matches adaptSet : AdaptationSet return -

-1 - Don't Care
 0 - Not Found
 1 - Partial match
 2 - Full match

type StreamSelectorList

type StreamSelectorList []StreamSelector

StreamSelectorList List of streams

func NewStreamSelectorList

func NewStreamSelectorList(filename string) (*StreamSelectorList, error)

NewStreamSelectorList - Loads the StreamSelector configuration from file

func (*StreamSelectorList) GetStream

func (sl *StreamSelectorList) GetStream(contentType string) *StreamSelector

GetStream - Returns the StreamSelector for givne contentType

func (*StreamSelectorList) SelectAdaptationSets

func (sl *StreamSelectorList) SelectAdaptationSets(period PeriodType) ([]*AdaptationSetType, []error)

SelectAdaptationSets - select adaptationSets for the period period : The selected period streams : selection criteria Return: []adaptationSet : selected adaptationSets []error : specific error for each stream

type StringNoWhitespaceType

type StringNoWhitespaceType string

Must match the pattern [^\r\n\t \p{Z}]*

type StringVectorType

type StringVectorType []string

func (*StringVectorType) MarshalText

func (x *StringVectorType) MarshalText() ([]byte, error)

func (*StringVectorType) UnmarshalText

func (x *StringVectorType) UnmarshalText(text []byte) error

type SubRepresentationType

type SubRepresentationType struct {
	Items                     []string          `xml:",any"`
	FramePacking              []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 FramePacking,omitempty"`
	AudioChannelConfiguration []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 AudioChannelConfiguration,omitempty"`
	ContentProtection         []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 ContentProtection,omitempty"`
	EssentialProperty         []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 EssentialProperty,omitempty"`
	SupplementalProperty      []DescriptorType  `xml:"urn:mpeg:dash:schema:mpd:2011 SupplementalProperty,omitempty"`
	InbandEventStream         []EventStreamType `xml:"urn:mpeg:dash:schema:mpd:2011 InbandEventStream,omitempty"`
	Level                     uint              `xml:"level,attr,omitempty"`
	DependencyLevel           UIntVectorType    `xml:"dependencyLevel,attr,omitempty"`
	Bandwidth                 uint              `xml:"bandwidth,attr,omitempty"`
	ContentComponent          StringVectorType  `xml:"contentComponent,attr,omitempty"`
	Profiles                  string            `xml:"profiles,attr,omitempty"`
	Width                     uint              `xml:"width,attr,omitempty"`
	Height                    uint              `xml:"height,attr,omitempty"`
	Sar                       RatioType         `xml:"sar,attr,omitempty"`
	FrameRate                 FrameRateType     `xml:"frameRate,attr,omitempty"`
	AudioSamplingRate         string            `xml:"audioSamplingRate,attr,omitempty"`
	MimeType                  string            `xml:"mimeType,attr,omitempty"`
	SegmentProfiles           string            `xml:"segmentProfiles,attr,omitempty"`
	Codecs                    string            `xml:"codecs,attr,omitempty"`
	MaximumSAPPeriod          float64           `xml:"maximumSAPPeriod,attr,omitempty"`
	StartWithSAP              uint              `xml:"startWithSAP,attr,omitempty"`
	MaxPlayoutRate            float64           `xml:"maxPlayoutRate,attr,omitempty"`
	CodingDependency          bool              `xml:"codingDependency,attr,omitempty"`
	ScanType                  VideoScanType     `xml:"scanType,attr,omitempty"`
}

type SubsetType

type SubsetType struct {
	Contains UIntVectorType `xml:"contains,attr"`
	Id       string         `xml:"id,attr,omitempty"`
}

type UIntVectorType

type UIntVectorType []uint

func (*UIntVectorType) MarshalText

func (x *UIntVectorType) MarshalText() ([]byte, error)

func (*UIntVectorType) UnmarshalText

func (x *UIntVectorType) UnmarshalText(text []byte) error

type URLType

type URLType struct {
	Items     []string `xml:",any"`
	SourceURL string   `xml:"sourceURL,attr,omitempty"`
	Range     string   `xml:"range,attr,omitempty"`
}

type VideoScanType

type VideoScanType string

May be one of progressive, interlaced, unknown

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址