mpd

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Code generated by XSLT from DASH-MPD.xml. DO NOT EDIT. Package mpd is an autogenerated implementation of the DASH-schema.

Index

Constants

View Source
const (
	Day         = 24 * time.Hour
	Hour        = time.Hour
	Minute      = time.Minute
	Second      = time.Second
	Millisecond = time.Millisecond
	Microsecond = time.Microsecond
	Nanosecond  = time.Nanosecond
)

A copy of various time.Duration constants.

Variables

View Source
var FrameRate_Validate = regexp.MustCompile(`[0-9]*[0-9](/[0-9]*[0-9])?`)
View Source
var Presentation_Valid = map[string]bool{
	"static":  true,
	"dynamic": true,
}
View Source
var Ratio_Validate = regexp.MustCompile(`[0-9]*:[0-9]*`)
View Source
var StringNoWhitespace_Validate = regexp.MustCompile(`[^\r\n\t \p{Z}]*`)
View Source
var VideoScan_Valid = map[string]bool{
	"progressive": true,
	"interlaced":  true,
	"unknown":     true,
}

Functions

This section is empty.

Types

type AdaptationSet

type AdaptationSet struct {
	*RepresentationBase

	Accessibility    []*Descriptor       `xml:"Accessibility,omitempty"`
	Role             []*Descriptor       `xml:"Role,omitempty"`
	Rating           []*Descriptor       `xml:"Rating,omitempty"`
	Viewpoint        []*Descriptor       `xml:"Viewpoint,omitempty"`
	ContentComponent []*ContentComponent `xml:"ContentComponent,omitempty"`
	BaseURL          []*BaseURL          `xml:"BaseURL,omitempty"`
	SegmentBase      *SegmentBase        `xml:"SegmentBase,omitempty"`
	SegmentList      *SegmentList        `xml:"SegmentList,omitempty"`
	SegmentTemplate  *SegmentTemplate    `xml:"SegmentTemplate,omitempty"`
	Representation   []*Representation   `xml:"Representation,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                     Ratio           `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            FrameRate       `xml:"minFrameRate,attr,omitempty"`
	MaxFrameRate            FrameRate       `xml:"maxFrameRate,attr,omitempty"`
	SegmentAlignment        ConditionalUint `xml:"segmentAlignment,attr,omitempty"`        // default: false
	SubsegmentAlignment     ConditionalUint `xml:"subsegmentAlignment,attr,omitempty"`     // default: false
	SubsegmentStartsWithSAP SAP             `xml:"subsegmentStartsWithSAP,attr,omitempty"` // default: 0
	BitstreamSwitching      bool            `xml:"bitstreamSwitching,attr,omitempty"`
}

type BaseURL

type BaseURL struct {
	CDATA 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 ConditionalUint

type ConditionalUint string // union {

type ContentComponent

type ContentComponent struct {
	Accessibility []*Descriptor `xml:"Accessibility,omitempty"`
	Role          []*Descriptor `xml:"Role,omitempty"`
	Rating        []*Descriptor `xml:"Rating,omitempty"`
	Viewpoint     []*Descriptor `xml:"Viewpoint,omitempty"`

	Id          uint   `xml:"id,attr,omitempty"`
	Lang        string `xml:"lang,attr,omitempty"`
	ContentType string `xml:"contentType,attr,omitempty"`
	Par         Ratio  `xml:"par,attr,omitempty"`
}

type Descriptor

type Descriptor struct {
	SchemeIdUri string `xml:"schemeIdUri,attr"`
	Value       string `xml:"value,attr,omitempty"`
	Id          string `xml:"id,attr,omitempty"`
}

type Duration

type Duration struct {
	// contains filtered or unexported fields
}

Duration naively implements the xsd:duration format defined by https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#duration N.B.: It is not intended to serve as a general xsd:duration as it does not implement the month side of xsd:duration.

func NewDuration

func NewDuration(months int, d time.Duration) (Duration, error)

NewDuration returns an mpd.Duration corresponding to the length in months and time.Duration.

It returns an error if the sign of two arguments are different.

func (Duration) Add

func (d Duration) Add(dur time.Duration) Duration

Add returns the mpd.Duration plus the given time.Duration.

func (Duration) AddToTime

func (d Duration) AddToTime(t time.Time) time.Time

AddToTime returns the given time.Time plus the given mpd.Duration value..

func (Duration) Duration

func (d Duration) Duration() (time.Duration, error)

Duration returns the mpd.Duration value as a time.Duration.

If Duration contains a non-zero value for the month side of the xsd:duration, then this function will return an error noting that the value is out of range..

func (Duration) MarshalXMLAttr

func (d Duration) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr implements xml.MarshalerAttr.

func (Duration) Scale

func (d Duration) Scale(dur time.Duration) Duration

Scale returns the mpd.Duration scaled by the given time.Duration.

func (*Duration) UnmarshalXMLAttr

func (d *Duration) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr implements xml.UnmarshalerAttr.

func (Duration) XMLString

func (d Duration) XMLString() string

XMLString returns the XML representation of the Duration as a string.

type Event

type Event struct {
	PresentationTime uint64 `xml:"presentationTime,attr,omitempty"` // default: 0
	Duration         uint64 `xml:"duration,attr,omitempty"`
	Id               uint   `xml:"id,attr,omitempty"`
	MessageData      string `xml:"messageData,attr,omitempty"`
}

type EventStream

type EventStream struct {
	Event []*Event `xml:"Event,omitempty"`

	SchemeIdUri string `xml:"schemeIdUri,attr"`
	Value       string `xml:"value,attr,omitempty"`
	Timescale   uint   `xml:"timescale,attr,omitempty"`
}

type FrameRate

type FrameRate string

type MPD

type MPD struct {
	ProgramInformation   []*ProgramInformation `xml:"ProgramInformation,omitempty"`
	BaseURL              []*BaseURL            `xml:"BaseURL,omitempty"`
	Location             []string              `xml:"Location,omitempty"`
	Period               []*Period             `xml:"Period"`
	Metrics              []*Metrics            `xml:"Metrics,omitempty"`
	EssentialProperty    []*Descriptor         `xml:"EssentialProperty,omitempty"`
	SupplementalProperty []*Descriptor         `xml:"SupplementalProperty,omitempty"`
	UTCTiming            []*Descriptor         `xml:"UTCTiming,omitempty"`

	Id                         string       `xml:"id,attr,omitempty"`
	Profiles                   string       `xml:"profiles,attr"`
	Type                       Presentation `xml:"type,attr,omitempty"` // default: static
	AvailabilityStartTime      time.Time    `xml:"availabilityStartTime,attr,omitempty"`
	AvailabilityEndTime        time.Time    `xml:"availabilityEndTime,attr,omitempty"`
	PublishTime                time.Time    `xml:"publishTime,attr,omitempty"`
	MediaPresentationDuration  Duration     `xml:"mediaPresentationDuration,attr,omitempty"`
	MinimumUpdatePeriod        Duration     `xml:"minimumUpdatePeriod,attr,omitempty"`
	MinBufferTime              Duration     `xml:"minBufferTime,attr"`
	TimeShiftBufferDepth       Duration     `xml:"timeShiftBufferDepth,attr,omitempty"`
	SuggestedPresentationDelay Duration     `xml:"suggestedPresentationDelay,attr,omitempty"`
	MaxSegmentDuration         Duration     `xml:"maxSegmentDuration,attr,omitempty"`
	MaxSubsegmentDuration      Duration     `xml:"maxSubsegmentDuration,attr,omitempty"`
}

type Metrics

type Metrics struct {
	Reporting []*Descriptor `xml:"Reporting"`
	Range     []*Range      `xml:"Range,omitempty"`

	Metrics string `xml:"metrics,attr"`
}

type MultipleSegmentBase

type MultipleSegmentBase struct {
	*SegmentBase

	SegmentTimeline    *SegmentTimeline `xml:"SegmentTimeline,omitempty"`
	BitstreamSwitching *URL             `xml:"BitstreamSwitching,omitempty"`

	Duration    uint `xml:"duration,attr,omitempty"`
	StartNumber uint `xml:"startNumber,attr,omitempty"`
}

type Period

type Period struct {
	BaseURL              []*BaseURL       `xml:"BaseURL,omitempty"`
	SegmentBase          *SegmentBase     `xml:"SegmentBase,omitempty"`
	SegmentList          *SegmentList     `xml:"SegmentList,omitempty"`
	SegmentTemplate      *SegmentTemplate `xml:"SegmentTemplate,omitempty"`
	AssetIdentifier      *Descriptor      `xml:"AssetIdentifier,omitempty"`
	EventStream          []*EventStream   `xml:"EventStream,omitempty"`
	AdaptationSet        []*AdaptationSet `xml:"AdaptationSet,omitempty"`
	Subset               []*Subset        `xml:"Subset,omitempty"`
	SupplementalProperty []*Descriptor    `xml:"SupplementalProperty,omitempty"`

	Id                 string   `xml:"id,attr,omitempty"`
	Start              Duration `xml:"start,attr,omitempty"`
	Duration           Duration `xml:"duration,attr,omitempty"`
	BitstreamSwitching bool     `xml:"bitstreamSwitching,attr,omitempty"` // default: false
}

type Presentation

type Presentation string

type ProgramInformation

type ProgramInformation struct {
	Title     string `xml:"Title,omitempty"`
	Source    string `xml:"Source,omitempty"`
	Copyright string `xml:"Copyright,omitempty"`

	Lang               string `xml:"lang,attr,omitempty"`
	MoreInformationURL string `xml:"moreInformationURL,attr,omitempty"`
}

type Range

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

type Ratio

type Ratio string

type Representation

type Representation struct {
	*RepresentationBase

	BaseURL           []*BaseURL           `xml:"BaseURL,omitempty"`
	SubRepresentation []*SubRepresentation `xml:"SubRepresentation,omitempty"`
	SegmentBase       *SegmentBase         `xml:"SegmentBase,omitempty"`
	SegmentList       *SegmentList         `xml:"SegmentList,omitempty"`
	SegmentTemplate   *SegmentTemplate     `xml:"SegmentTemplate,omitempty"`

	Id                     StringNoWhitespace `xml:"id,attr"`
	Bandwidth              uint               `xml:"bandwidth,attr"`
	QualityRanking         uint               `xml:"qualityRanking,attr,omitempty"`
	DependencyId           StringVector       `xml:"dependencyId,attr,omitempty"`
	MediaStreamStructureId StringVector       `xml:"mediaStreamStructureId,attr,omitempty"`
}

type RepresentationBase

type RepresentationBase struct {
	FramePacking              []*Descriptor  `xml:"FramePacking,omitempty"`
	AudioChannelConfiguration []*Descriptor  `xml:"AudioChannelConfiguration,omitempty"`
	ContentProtection         []*Descriptor  `xml:"ContentProtection,omitempty"`
	EssentialProperty         []*Descriptor  `xml:"EssentialProperty,omitempty"`
	SupplementalProperty      []*Descriptor  `xml:"SupplementalProperty,omitempty"`
	InbandEventStream         []*EventStream `xml:"InbandEventStream,omitempty"`

	Profiles          string    `xml:"profiles,attr,omitempty"`
	Width             uint      `xml:"width,attr,omitempty"`
	Height            uint      `xml:"height,attr,omitempty"`
	Sar               Ratio     `xml:"sar,attr,omitempty"`
	FrameRate         FrameRate `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      SAP       `xml:"startWithSAP,attr,omitempty"`
	MaxPlayoutRate    float64   `xml:"maxPlayoutRate,attr,omitempty"`
	CodingDependency  bool      `xml:"codingDependency,attr,omitempty"`
	ScanType          VideoScan `xml:"scanType,attr,omitempty"`
}

type SAP

type SAP uint
const (
	SAP_MinInclusive SAP = 0
	SAP_MaxInclusive SAP = 6
)

type SegmentBase

type SegmentBase struct {
	Initialization      *URL `xml:"Initialization,omitempty"`
	RepresentationIndex *URL `xml:"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"` // default: false
	AvailabilityTimeOffset   float64 `xml:"availabilityTimeOffset,attr,omitempty"`
	AvailabilityTimeComplete bool    `xml:"availabilityTimeComplete,attr,omitempty"`
}

type SegmentList

type SegmentList struct {
	*MultipleSegmentBase

	SegmentURL []*SegmentURL `xml:"SegmentURL,omitempty"`
}

type SegmentTemplate

type SegmentTemplate struct {
	*MultipleSegmentBase

	Media              string `xml:"media,attr,omitempty"`
	Index              string `xml:"index,attr,omitempty"`
	Initialization     string `xml:"initialization,attr,omitempty"`
	BitstreamSwitching string `xml:"bitstreamSwitching,attr,omitempty"`
}

type SegmentTimeline

type SegmentTimeline struct {
	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"` // default: 0
	}
}

type SegmentURL

type SegmentURL struct {
	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 StringNoWhitespace

type StringNoWhitespace string

type StringVector

type StringVector []string

type SubRepresentation

type SubRepresentation struct {
	*RepresentationBase

	Level            uint         `xml:"level,attr,omitempty"`
	DependencyLevel  UIntVector   `xml:"dependencyLevel,attr,omitempty"`
	Bandwidth        uint         `xml:"bandwidth,attr,omitempty"`
	ContentComponent StringVector `xml:"contentComponent,attr,omitempty"`
}

type Subset

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

type UIntVector

type UIntVector []uint

type URL

type URL struct {
	SourceURL string `xml:"sourceURL,attr,omitempty"`
	Range     string `xml:"range,attr,omitempty"`
}

type VideoScan

type VideoScan string

Jump to

Keyboard shortcuts

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