mpd

package module
v0.0.0-...-bdac3b5 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 7 Imported by: 0

README

mpd GoDoc Build Status

Go library for parsing and generating MPEG-DASH Media Presentation Description (MPD) files.

Documentation.

Documentation

Overview

Package mpd implements parsing and generating of MPEG-DASH Media Presentation Description (MPD) files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptationSet

type AdaptationSet struct {
	MimeType                string           `xml:"mimeType,attr"`
	SegmentAlignment        ConditionalUint  `xml:"segmentAlignment,attr"`
	StartWithSAP            *uint64          `xml:"startWithSAP,attr"`
	BitstreamSwitching      *bool            `xml:"bitstreamSwitching,attr"`
	SubsegmentAlignment     ConditionalUint  `xml:"subsegmentAlignment,attr"`
	SubsegmentStartsWithSAP *uint64          `xml:"subsegmentStartsWithSAP,attr"`
	Lang                    *string          `xml:"lang,attr"`
	ContentProtections      []DRMDescriptor  `xml:"ContentProtection,omitempty"`
	Representations         []Representation `xml:"Representation,omitempty"`
	Codecs                  *string          `xml:"codecs,attr"`
	BaseURL                 *string          `xml:"BaseURL,omitempty"`
	SegmentTemplate         *SegmentTemplate `xml:"SegmentTemplate,omitempty"`
}

AdaptationSet represents XSD's AdaptationSetType.

type ConditionalUint

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

ConditionalUint (ConditionalUintType) defined in XSD as a union of unsignedInt and boolean.

func (ConditionalUint) MarshalXMLAttr

func (c ConditionalUint) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr encodes ConditionalUint.

func (*ConditionalUint) UnmarshalXMLAttr

func (c *ConditionalUint) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr decodes ConditionalUint.

type DRMDescriptor

type DRMDescriptor struct {
	SchemeIDURI    *string `xml:"schemeIdUri,attr"`
	Value          *string `xml:"value,attr,omitempty"`
	CencDefaultKID *string `xml:"default_KID,attr,omitempty"`
	Cenc           *string `xml:"cenc,attr,omitempty"`
	Pssh           *Pssh   `xml:"pssh"`
}

Descriptor represents XSD's DescriptorType.

type MPD

type MPD struct {
	XMLName                    xml.Name `xml:"MPD"`
	XMLNS                      *string  `xml:"xmlns,attr"`
	Type                       *string  `xml:"type,attr"`
	MinimumUpdatePeriod        *string  `xml:"minimumUpdatePeriod,attr"`
	AvailabilityStartTime      *string  `xml:"availabilityStartTime,attr"`
	MediaPresentationDuration  *string  `xml:"mediaPresentationDuration,attr"`
	MinBufferTime              *string  `xml:"minBufferTime,attr"`
	SuggestedPresentationDelay *string  `xml:"suggestedPresentationDelay,attr"`
	TimeShiftBufferDepth       *string  `xml:"timeShiftBufferDepth,attr"`
	PublishTime                *string  `xml:"publishTime,attr"`
	Profiles                   string   `xml:"profiles,attr"`
	XSI                        *string  `xml:"xsi,attr,omitempty"`
	SCTE35                     *string  `xml:"scte35,attr,omitempty"`
	XSISchemaLocation          *string  `xml:"schemaLocation,attr"`
	ID                         *string  `xml:"id,attr"`
	BaseURL                    *string  `xml:"BaseURL,omitempty"`
	Period                     []Period `xml:"Period,omitempty"`
}

MPD represents root XML element for parse.

func (*MPD) Decode

func (m *MPD) Decode(b []byte) error

Decode parses MPD XML.

func (*MPD) Encode

func (m *MPD) Encode() ([]byte, error)

Encode generates MPD XML.

type Period

type Period struct {
	Start           *string          `xml:"start,attr"`
	ID              *string          `xml:"id,attr"`
	Duration        *string          `xml:"duration,attr"`
	AdaptationSets  []*AdaptationSet `xml:"AdaptationSet,omitempty"`
	BaseURL         *string          `xml:"BaseURL,omitempty"`
	SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"`
}

Period represents XSD's PeriodType.

type Pssh

type Pssh struct {
	Cenc  *string `xml:"cenc,attr"`
	Value *string `xml:",chardata"`
}

Pssh represents XSD's CencPsshType .

type Representation

type Representation struct {
	ID                 *string          `xml:"id,attr"`
	Width              *uint64          `xml:"width,attr"`
	Height             *uint64          `xml:"height,attr"`
	SAR                *string          `xml:"sar,attr"`
	FrameRate          *string          `xml:"frameRate,attr"`
	Bandwidth          *uint64          `xml:"bandwidth,attr"`
	AudioSamplingRate  *string          `xml:"audioSamplingRate,attr"`
	Codecs             *string          `xml:"codecs,attr"`
	BaseURL            *string          `xml:"BaseURL,omitempty"`
	ContentProtections []DRMDescriptor  `xml:"ContentProtection,omitempty"`
	SegmentTemplate    *SegmentTemplate `xml:"SegmentTemplate,omitempty"`
}

Representation represents XSD's RepresentationType.

type SegmentTemplate

type SegmentTemplate struct {
	Timescale              *uint64            `xml:"timescale,attr"`
	Media                  *string            `xml:"media,attr"`
	Initialization         *string            `xml:"initialization,attr"`
	StartNumber            *uint64            `xml:"startNumber,attr"`
	PresentationTimeOffset *uint64            `xml:"presentationTimeOffset,attr"`
	SegmentTimelineS       []SegmentTimelineS `xml:"SegmentTimeline>S,omitempty"`
}

SegmentTemplate represents XSD's SegmentTemplateType.

type SegmentTimelineS

type SegmentTimelineS struct {
	T *uint64 `xml:"t,attr"`
	D uint64  `xml:"d,attr"`
	R *int64  `xml:"r,attr"`
}

SegmentTimelineS represents XSD's SegmentTimelineType's inner S elements.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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