dash

package
v0.0.0-...-b4d0808 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MpdPREFIX   = "mpd"
	VideoPREFIX = "video"
	AudioPREFIX = "audio"
)

http://addr/DASH/streamName/req

View Source
const (
	ProfileFull        = "urn:mpeg:dash:profile:full:2011"
	ProfileISOOnDemand = "urn:mpeg:dash:profile:isoff-on-demand:2011"
	ProfileISOMain     = "urn:mpeg:dash:profile:isoff-main:2011"
	ProfileISOLive     = "urn:mpeg:dash:profile:isoff-live:2011"
	ProfileTSMain      = "urn:mpeg:dash:profile:mp2t-main:2011"
	ProfileTSSimple    = "urn:mpeg:dash:profile:mp2t-simple:2011"

	MPDXMLNS = "urn:mpeg:dash:schema:mpd:2011"

	SchemeIdUri = "urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
)

const string for media description

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptationSetXML

type AdaptationSetXML struct {
	Lang                      string                        `xml:"lang,attr,omitempty"`
	MimeType                  string                        `xml:"mimeType,attr"`
	Codecs                    string                        `xml:"codecs,attr,omitempty"`
	AudioChannelConfiguration *AudioChannelConfigurationXML `xml:"AudioChannelConfiguration,omitempty"`
	SegmentTemplate           SegmentTemplateXML            `xml:"SegmentTemplate"`
	Representation            []RepresentationXML           `xml:"Representation,omitempty"`
}

type AudioChannelConfigurationXML

type AudioChannelConfigurationXML struct {
	SchemeIdUri string `xml:"schemeIdUri,attr"`
	Value       int    `xml:"value,attr"`
}

AudioChannelConfigurationXML file

type DASHConfig

type DASHConfig struct {
	Port  int    `json:"Port"`
	Route string `json:"Route"`
}

DASHConfig struc

type DASHService

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

DASHService struct

func (*DASHService) Add

func (dashService *DASHService) Add(name string, src *DASHSource) (err error)

func (*DASHService) Del

func (dashService *DASHService) Del(name, id string)

func (*DASHService) GetType

func (dashService *DASHService) GetType() string

func (*DASHService) HandleTask

func (dashService *DASHService) HandleTask(task wssapi.Task) (err error)

func (*DASHService) Init

func (dashService *DASHService) Init(msg *wssapi.Msg) (err error)

func (*DASHService) ProcessMessage

func (dashService *DASHService) ProcessMessage(msg *wssapi.Msg) (err error)

func (*DASHService) ServeHTTP

func (dashService *DASHService) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*DASHService) Start

func (dashService *DASHService) Start(msg *wssapi.Msg) (err error)

Start action

func (*DASHService) Stop

func (dashService *DASHService) Stop(msg *wssapi.Msg) (err error)

type DASHSource

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

DASHSource description

func (*DASHSource) GetType

func (dashSource *DASHSource) GetType() string

func (*DASHSource) HandleTask

func (dashSource *DASHSource) HandleTask(task wssapi.Task) (err error)

func (*DASHSource) Init

func (dashSource *DASHSource) Init(msg *wssapi.Msg) (err error)

func (*DASHSource) ProcessMessage

func (dashSource *DASHSource) ProcessMessage(msg *wssapi.Msg) (err error)

func (*DASHSource) Start

func (dashSource *DASHSource) Start(msg *wssapi.Msg) (err error)

Start action

func (*DASHSource) Stop

func (dashSource *DASHSource) Stop(msg *wssapi.Msg) (err error)

type FMP4Cache

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

FMP4Cache description Struct

func NewFMP4Cache

func NewFMP4Cache(cacheSize int) (cache *FMP4Cache)

NewFMP4Cache to create new Cache

func (*FMP4Cache) AudioHeaderGenerated

func (fmp4Cache *FMP4Cache) AudioHeaderGenerated(audioHeader []byte)

func (*FMP4Cache) AudioSegmentGenerated

func (fmp4Cache *FMP4Cache) AudioSegmentGenerated(audioSegment []byte, timestamp int64, duration int)

func (*FMP4Cache) GetAudioHeader

func (fmp4Cache *FMP4Cache) GetAudioHeader() (data []byte, err error)

func (*FMP4Cache) GetAudioSegment

func (fmp4Cache *FMP4Cache) GetAudioSegment(timestamp int64) (seg []byte, err error)

func (*FMP4Cache) GetVideoHeader

func (fmp4Cache *FMP4Cache) GetVideoHeader() (data []byte, err error)

func (*FMP4Cache) GetVideoSegment

func (fmp4Cache *FMP4Cache) GetVideoSegment(timestamp int64) (seg []byte, err error)

func (*FMP4Cache) VideoHeaderGenerated

func (fmp4Cache *FMP4Cache) VideoHeaderGenerated(videoHeader []byte)

func (*FMP4Cache) VideoSegmentGenerated

func (fmp4Cache *FMP4Cache) VideoSegmentGenerated(videoSegment []byte, timestamp int64, duration int)

type MPD

type MPD struct {
	ID                        string      `xml:"id,attr"`
	Profiles                  string      `xml:"profiles,attr"`
	Type                      string      `xml:"type,attr"`
	AvailabilityStartTime     string      `xml:"availabilityStartTime,attr"`
	PublishTime               string      `xml:"publishTime,attr"`
	MediaPresentationDuration string      `xml:"mediaPresentationDuration,attr,omitempty"`
	MinimumUpdatePeriod       string      `xml:"minimumUpdatePeriod,attr,omitempty"`
	MinBufferTime             string      `xml:"minBufferTime,attr"`
	Xmlns                     string      `xml:"xmlns,attr"`
	Period                    []PeriodXML `xml:"Period"`
}

MPD Struct

type PeriodXML

type PeriodXML struct {
	ID            string             `xml:"id,attr"`
	AdaptationSet []AdaptationSetXML `xml:"AdaptationSet"`
}

type RepresentationXML

type RepresentationXML struct {
	ID                string `xml:"id,attr"`
	Bandwidth         string `xml:"bandwidth,attr"`
	Width             string `xml:"width,attr,omitempty"`
	Height            string `xml:"height,attr,omitempty"`
	FrameRate         string `xml:"frameRate,attr,omitempty"`
	AudioSamplingRate string `xml:"audioSamplingRate,attr,omitempty"`
}

RepresentationXML file

type SegmentTemplateXML

type SegmentTemplateXML struct {
	Media           string              `xml:"media,attr"`
	Initialization  string              `xml:"initialization,attr"`
	Duration        *int                `xml:"duration,attr,omitempty"`
	StartNumber     string              `xml:"startNumber,attr"`
	TimeScale       string              `xml:"timescale,attr"`
	SegmentTimeline *SegmentTimelineXML `xml:"SegmentTimeline,omitempty"`
}

type SegmentTimelineDesc

type SegmentTimelineDesc struct {
	T string `xml:"t,attr,omitempty"` //time
	D string `xml:"d,attr"`           //duration
	R string `xml:"r,attr,omitempty"` //repreat count default 0
}

SegmentTimelineDesc from file

type SegmentTimelineXML

type SegmentTimelineXML struct {
	S []SegmentTimelineDesc `xml:"S"`
}

SegmentTimelineXML from file

Jump to

Keyboard shortcuts

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