Documentation ¶
Index ¶
- Variables
- func GetAllSegmentHeaders(mpdList []MPD, codecIndexList [][]int, maxHeight int, segmentNumber int, ...) map[int]map[int][]int
- func GetByteRangeSegmentDetails(mpd []MPD, mpdListIndex int) (int, []int)
- func GetCodec(mpdList []MPD, codec string, debugLog bool) ([][]string, [][]int)
- func GetContentLengthHeader(currentMPD MPD, currentURL string, currentMPDRepAdaptSet int, repRate int, ...) int
- func GetFile(currentURL string, fileBaseURL string, fileLocation string, ...) (time.Duration, int, string, string)
- func GetFileProgressively(currentURL string, fileBaseURL string, fileLocation string, ...) (time.Duration, int)
- func GetFullStreamHeader(mpd MPD, isByteRangeMPD bool) string
- func GetMPDValues(mpd []MPD, mpdListIndex int, maxHeight int, streamDuration int, maxBuffer int, ...) (int, int, int, int, []int, []int, string)
- func GetMPDheightIndex(mpd MPD, maxHeight int, currentMPDRepAdaptSet int, debugLog bool) int
- func GetMaxListIndex(mpd MPD, currentMPDRepAdaptSet int) int
- func GetNSegmentHeaders(mpdList []MPD, codecIndexList [][]int, maxHeight int, segmentNumber int, ...) map[int]map[int][]int
- func GetNextByteRangeURL(mpd MPD, SegNumber int, SegQUALITY int, currentMPDRepAdaptSet int) (string, int, int)
- func GetNextSegment(mpd MPD, SegNumber int, SegQUALITY int, currentMPDRepAdaptSet int) string
- func GetNextSegmentDuration(segmentDurations []int, lastSegmentDuration int, totalSegmentDuration int, ...) (stopApp bool, mpdIndex int, nextSegmentNumber int)
- func GetRepresentationBandwidth(mpd MPD, currentMPDRepAdaptSet int) (bandwithList []int)
- func GetRepresentationBaseURL(mpd MPD, currentMPDRepAdaptSet int) string
- func GetSegmentDetails(mpd []MPD, mpdListIndex int) (int, []int)
- func GetURL(url string, isByteRangeMPD bool, startRange int, endRange int, quicBool bool, ...) ([]byte, time.Duration, string)
- func GetURLByteRangeBody(url string, startRange int, endRange int) (io.ReadCloser, time.Duration)
- func JoinURL(baseURL string, append string, debugLog bool) string
- func SplitMPDSegmentDuration(mpdSegDuration string) int
- func URLList(urlString string) []string
- type AdaptationSet
- type Initialization
- type MPD
- type Period
- type ProgramInformation
- type Representation
- type SegmentList
- type SegmentTemplate
Constants ¶
This section is empty.
Variables ¶
var SegHeadValues map[int]map[int][]int
SegHeadValues store the seg header maps
Functions ¶
func GetAllSegmentHeaders ¶
func GetAllSegmentHeaders(mpdList []MPD, codecIndexList [][]int, maxHeight int, segmentNumber int, streamDuration int, isByteRangeMPD bool, maxBuffer int, headerURL string, codec string, urlInput []string, debugLog bool, printToFile bool) map[int]map[int][]int
GetAllSegmentHeaders : get all segment headers for all MPD urls
func GetByteRangeSegmentDetails ¶
GetByteRangeSegmentDetails : get segment duration and number of segments from provided MPD file
func GetCodec ¶
GetCodec :
- for the list of passed in MPD urls
- return an array of the codecs offered in the MPDs
- return the index for the codec provided, -1 for all codecs
func GetContentLengthHeader ¶
func GetContentLengthHeader(currentMPD MPD, currentURL string, currentMPDRepAdaptSet int, repRate int, segmentNumber int, adaptationSetBaseURL string, debugLog bool) int
GetContentLengthHeader : get the header of the next segment to have the informations about it
func GetFile ¶
func GetFile(currentURL string, fileBaseURL string, fileLocation string, isByteRangeMPD bool, startRange int, endRange int, segmentNumber int, segmentDuration int, addSegDuration bool, quicBool bool, debugFile string, debugLog bool, useTestbedBool bool, repRate int) (time.Duration, int, string, string)
GetFile :
- Function getFile :
- get the provided file from the online HTTP server and save to folder
func GetFileProgressively ¶
func GetFileProgressively(currentURL string, fileBaseURL string, fileLocation string, isByteRangeMPD bool, startRange int, endRange int, segmentNumber int, segmentDuration int, addSegDuration bool, debugLog bool) (time.Duration, int)
GetFileProgressively :
- get the provided file from the online HTTP server and save to folder
- get a 1-second piece of each file
func GetFullStreamHeader ¶
GetFullStreamHeader :
- get the header file for the current video clip
- I've called this full in case the other profile have a different structure
func GetMPDValues ¶
func GetMPDValues(mpd []MPD, mpdListIndex int, maxHeight int, streamDuration int, maxBuffer int, currentMPDRepAdaptSet int, isByteRangeMPD bool, debugLog bool) (int, int, int, int, []int, []int, string)
GetMPDValues : get important values from the provided MPD
func GetMPDheightIndex ¶
GetMPDheightIndex : get the maximum index for a given resolution height in a provided MPD file
func GetMaxListIndex ¶
GetMaxListIndex : get the maximum rep_rate from the MPD
func GetNSegmentHeaders ¶
func GetNSegmentHeaders(mpdList []MPD, codecIndexList [][]int, maxHeight int, segmentNumber int, streamDuration int, isByteRangeMPD bool, maxBuffer int, headerURL string, codec string, urlInput []string, debugLog bool, useHeaderFile bool) map[int]map[int][]int
GetNSegmentHeaders : get N segment headers for all MPD urls (based on stream time)
func GetNextByteRangeURL ¶
func GetNextByteRangeURL(mpd MPD, SegNumber int, SegQUALITY int, currentMPDRepAdaptSet int) (string, int, int)
GetNextByteRangeURL : Return the base URL, start and end range for the byte range MPD
func GetNextSegment ¶
GetNextSegment :
- select the right segment in the MPD given
- Return the URL of this segment
func GetNextSegmentDuration ¶
func GetNextSegmentDuration(segmentDurations []int, lastSegmentDuration int, totalSegmentDuration int, debugFile string, debugLog bool, segmentDuration int, streamDuration int) (stopApp bool, mpdIndex int, nextSegmentNumber int)
GetNextSegmentDuration : * returns an index for the MPD and the next segment we can use * currently randomised - to illustrate functionality
func GetRepresentationBandwidth ¶
GetRepresentationBandwidth : get Representation Bandwidth - divided by 1000
func GetRepresentationBaseURL ¶
GetRepresentationBaseURL : * get BaseURL for byte-range MPD
func GetSegmentDetails ¶
GetSegmentDetails : get segment duration and number of segments from provided MPD file
func GetURL ¶
func GetURL(url string, isByteRangeMPD bool, startRange int, endRange int, quicBool bool, debugFile string, debugLog bool, useTestbedBool bool) ([]byte, time.Duration, string)
GetURL : * return the content of the body of the url
func GetURLByteRangeBody ¶
GetURLByteRangeBody : * get the response body of the url and return an io.ReadCloser * based on byte-ranges
func JoinURL ¶
JoinURL :
- func joinURL(baseURL string, append string) string *
- join components of urls together
- return the URL
func SplitMPDSegmentDuration ¶
SplitMPDSegmentDuration : get the per second details from the MPD segments
Types ¶
type AdaptationSet ¶
type AdaptationSet struct { XMLName xml.Name `xml:"AdaptationSet"` SegmentAlignment bool `xml:"segmentAlignment,attr"` BitstreamSwitching bool `xml:"bitstreamSwitching,attr"` MaxWidth int `xml:"maxWidth,attr"` MaxHeight int `xml:"maxHeight"` MaxFrameRate int `xml:"maxFrameRate"` Par string `xml:"par,attr"` Lang string `xml:"lang,attr"` BaseURL string `xml:"BaseURL"` Representation []Representation `xml:"Representation"` SegmentTemplate []SegmentTemplate `xml:"SegmentTemplate"` SegmentList SegmentList `xml:"SegmentList"` }
AdaptationSet in MPD
type Initialization ¶
type Initialization struct { XMLName xml.Name `xml:"Initialization"` SourceURL string `xml:"sourceURL,attr"` }
Initialization in MPD
type MPD ¶
type MPD struct { XMLName xml.Name `xml:"MPD"` Xmlns string `xml:"xmlns,attr"` MinBufferTime string `xml:"minBufferTime,attr"` MediaPresentationDuration string `xml:"mediaPresentationDuration,attr"` MaxSegmentDuration string `xml:"maxSegmentDuration,attr"` Profiles string `xml:"profiles,attr"` Periods []Period `xml:"Period"` ProgramInformation ProgramInformation `xml:"ProgramInformation"` }
MPD structure
type Period ¶
type Period struct { XMLName xml.Name `xml:"Period"` Duration string `xml:"duration,attr"` AdaptationSet []AdaptationSet `xml:"AdaptationSet"` }
Period in MPD
type ProgramInformation ¶
type ProgramInformation struct { XMLName xml.Name `xml:"ProgramInformation"` MoreInformationURL string `xml:"moreInformationURL,attr"` Title string `xml:"Title"` }
ProgramInformation in MPD
type Representation ¶
type Representation struct { XMLName xml.Name `xml:"Representation"` ID int `xml:"id,attr"` MimType string `xml:"mimType,attr"` Codecs string `xml:"codecs,attr"` Width int `xml:"width,attr"` Height int `xml:"height,attr"` FrameRate int `xml:"frameRate,attr"` Sar string `xml:"sar,attr"` StartWithSap int `xml:"startWithSap,attr"` BandWidth int `xml:"bandwidth,attr"` BaseURL string `xml:"BaseURL"` SegmentTemplate SegmentTemplate `xml:"SegmentTemplate"` SegmentList SegmentList `xml:"SegmentList"` }
Representation in MPD
type SegmentList ¶
type SegmentList struct { XMLName xml.Name `xml:"SegmentList"` Timescale int `xml:"timescale,attr"` Duration int `xml:"duration,attr"` SegmentURL []segmentURL `xml:"SegmentURL"` SegmentInitization Initialization `xml:"Initialization"` }
SegmentList in MPD
type SegmentTemplate ¶
type SegmentTemplate struct { XMLName xml.Name `xml:"SegmentTemplate"` Media string `xml:"media,attr"` Timescale int `xml:"timescale,attr"` StartNumber int `xml:"startNumber,attr"` Duration int `xml:"duration,attr"` Initialization string `xml:"initialization,attr"` }
SegmentTemplate in MPD