parser

package
v0.0.0-...-f1f0bfa Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2015 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DurationRegexp = regexp.MustCompile(`P((?P<year>[\d\.]+)Y)?((?P<month>[\d\.]+)M)?((?P<day>[\d\.]+)D)?(T((?P<hour>[\d\.]+)H)?((?P<minute>[\d\.]+)M)?((?P<second>[\d\.]+)S)?)?`)
)
View Source
var (
	PlayReadyRegexp = regexp.MustCompile(`^.+<KID>([^<]+)</KID>.+$`)
)

Functions

func CArray

func CArray(buffer []byte) unsafe.Pointer

func CFree

func CFree(ptr unsafe.Pointer)

func CInt

func CInt(val int) C.int

func FFMPEGInitialise

func FFMPEGInitialise() error

Called when starting the program, initialise FFMPEG demuxers

func GetAuthorizedProtocols

func GetAuthorizedProtocols() []string

func InitialiseDemuxers

func InitialiseDemuxers() error

Initialise specifics for each demuxer interface

func TimebaseRescale

func TimebaseRescale(val int, tbIn int, tbOut int) int

Types

type AtomBuilder

type AtomBuilder func(t Track) ([]byte, error)

Function type used for atom generation

type Builder

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

Structure used to build chunks

func (*Builder) Initialise

func (b *Builder) Initialise()

Initialise builder building function map

type DASHAtomParser

type DASHAtomParser func(d *DASHDemuxer, reader io.ReadSeeker, size int, t *Track)

type DASHDemuxer

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

Demuxer structure foàr DASH streaming parsing

func (*DASHDemuxer) Close

func (d *DASHDemuxer) Close()

Clean demuxer internal info

func (*DASHDemuxer) ExtractChunk

func (d *DASHDemuxer) ExtractChunk(tracks *[]*Track, isLive bool) bool

Extract samples from one chunk for each track declared

func (*DASHDemuxer) GetTracks

func (d *DASHDemuxer) GetTracks(tracks *[]*Track) error

Retrieve all tracks from a DASH source

func (*DASHDemuxer) Open

func (d *DASHDemuxer) Open(path string) error

Initialise DASH demuxer

type DASHManifest

type DASHManifest struct {
	XMLName  xml.Name `xml:"MPD"`
	Duration string   `xml:"mediaPresentationDuration,attr"`
	Period   DASHXMLPeriod
}

type DASHXMLAdaptionSet

type DASHXMLAdaptionSet struct {
	XMLName         xml.Name `xml:"AdaptationSet"`
	Group           string   `xml:"group,attr"`
	MimeType        string   `xml:"mimeType,attr"`
	MinWidth        int      `xml:"minWidth,attr"`
	MaxWidth        int      `xml:"maxWidth,attr"`
	MinHeight       int      `xml:"minHeight,attr"`
	Maxheight       int      `xml:"maxHeight,attr"`
	Template        DASHXMLSegmentTemplate
	Representations []DASHXMLRepresentation `xml:"Representation"`
}

type DASHXMLInitialization

type DASHXMLInitialization struct {
	XMLName xml.Name `xml:"Initialization"`
	Range   string   `xml:"range,attr"`
}

type DASHXMLPeriod

type DASHXMLPeriod struct {
	XMLName        xml.Name             `xml:"Period"`
	BaseURL        string               `xml:"BaseURL"`
	AdaptationSets []DASHXMLAdaptionSet `xml:"AdaptationSet"`
}

type DASHXMLRepresentation

type DASHXMLRepresentation struct {
	XMLName           xml.Name `xml:"Representation"`
	Id                string   `xml:"id,attr"`
	Bandwidth         string   `xml:"bandwidth,attr"`
	Codecs            string   `xml:"codecs,attr"`
	AudioSamplingRate string   `xml:"audioSamplingRate,attr"`
	Width             int      `xml:"width,attr"`
	Height            int      `xml:"height,attr"`
	Sar               int      `xml:"sar,attr"`
	Base              DASHXMLSegmentBase
	BaseURL           string `xml:"BaseURL">`
}

type DASHXMLSegment

type DASHXMLSegment struct {
	XMLName    xml.Name `xml:"S"`
	Duration   int      `xml:"d,attr"`
	Time       int      `xml:"t,attr"`
	Repetition int      `xml:"r,attr"`
}

type DASHXMLSegmentBase

type DASHXMLSegmentBase struct {
	XMLName        xml.Name                `xml:"SegmentBase"`
	Timescale      int                     `xml:"timescale,attr"`
	Range          string                  `xml:"indexRange,attr"`
	Initialization []DASHXMLInitialization `xml:"Initialization"`
}

type DASHXMLSegmentTemplate

type DASHXMLSegmentTemplate struct {
	XMLName        xml.Name         `xml:"SegmentTemplate"`
	Timescale      int              `xml:"timescale,attr"`
	Initialization string           `xml:"initialization,attr"`
	Media          string           `xml:"media,attr"`
	StartNumber    int              `xml:"startNumber,attr"`
	Segments       []DASHXMLSegment `xml:"SegmentTimeline>S"`
}

type Demuxer

type Demuxer interface {
	Open(path string) error
	GetTracks(tracks *[]*Track) error
	Close()
	ExtractChunk(tracks *[]*Track, isLive bool) bool
}

func OpenDemuxer

func OpenDemuxer(path string) (Demuxer, error)

Open a file from a path and initialize a demuxer structure

type DemuxerConstructor

type DemuxerConstructor func() Demuxer

type EncryptionInfo

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

Strcture used to store encryption specific info of the track

type FFMPEGDemuxer

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

Structure used to reference FFMPEG C AVFormatContext structure

func (*FFMPEGDemuxer) AppendSample

func (d *FFMPEGDemuxer) AppendSample(track *Track, stream *C.AVStream)

Append a sample to a track

func (*FFMPEGDemuxer) Close

func (d *FFMPEGDemuxer) Close()

Close demuxer and free FFMPEG specific data

func (*FFMPEGDemuxer) ExtractChunk

func (d *FFMPEGDemuxer) ExtractChunk(tracks *[]*Track, isLive bool) bool

Extract one chunk for each track from input, size of the chunk depends on the first

video track found.

func (*FFMPEGDemuxer) GetTracks

func (d *FFMPEGDemuxer) GetTracks(tracks *[]*Track) error

Retrieve tracks from previously opened file using FFMPEG

func (*FFMPEGDemuxer) Open

func (d *FFMPEGDemuxer) Open(path string) error

Open FFMPEG specific demuxer

type HTTPRequest

type HTTPRequest struct {
	Url     string
	Headers []struct {
		// contains filtered or unexported fields
	}
}

type Range

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

Structure representing range in a segment base DASH

type Sample

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

Structure used to store a Sample for chunk generation

func (*Sample) GetData

func (s *Sample) GetData() []byte

Return byte data from a sample

func (*Sample) Print

func (s *Sample) Print()

Print track on stdout

type SampleEncryption

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

Structure used to store encryption parameters of a sample

type SmoothAtomParser

type SmoothAtomParser func(d *SmoothDemuxer, reader io.ReadSeeker, size int, t *Track)

type SmoothChunk

type SmoothChunk struct {
	XMLName   xml.Name `xml:"c"`
	Duration  int64    `xml:"d,attr"`
	StartTime int64    `xml:"t,attr"`
}

type SmoothDemuxer

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

Demuxer structure for smooth streaming parsing

func (*SmoothDemuxer) Close

func (d *SmoothDemuxer) Close()

Clean demuxer internal info

func (*SmoothDemuxer) ExtractChunk

func (d *SmoothDemuxer) ExtractChunk(tracks *[]*Track, isLive bool) bool

Extract samples from one chunk for each track declared

func (*SmoothDemuxer) GetTracks

func (d *SmoothDemuxer) GetTracks(tracks *[]*Track) error

Retrieve all tracks from a smooth source

func (*SmoothDemuxer) Open

func (d *SmoothDemuxer) Open(path string) error

Initialise smooth demuxer structure

type SmoothProtectionHeader

type SmoothProtectionHeader struct {
	XMLName  xml.Name `xml:"ProtectionHeader"`
	SystemId string   `xml:"SystemID,attr"`
	Blob     string   `xml:",chardata"`
}

type SmoothQualityLevel

type SmoothQualityLevel struct {
	XMLName          xml.Name `xml:"QualityLevel"`
	Index            int      `xml:"Index,attr"`
	Bitrate          int      `xml:"Bitrate,attr"`
	MaxWidth         int      `xml:"MaxWidth,attr"`
	MaxHeight        int      `xml:"MaxHeight,attr"`
	FourCC           string   `xml:"FourCC,attr"`
	CodecPrivateData string   `xml:"CodecPrivateData,attr"`
	AudioTag         int      `xml:"AudioTag,attr"`
	SamplingRate     int      `xml:"SamplingRate,attr"`
	BitsPerSample    int      `xml:"BitsPerSample,attr"`
	PacketSize       int      `xml:"PacketSize,attr"`
	Channels         int      `xml:"Channels,attr"`
}

type SmoothStreamIndex

type SmoothStreamIndex struct {
	XMLName       xml.Name             `xml:"StreamIndex"`
	Type          string               `xml:"Type,attr"`
	Url           string               `xml:"Url,attr"`
	Name          string               `xml:"Name,attr"`
	Chunks        int                  `xml:"Chunks,attr"`
	QualityLevels int                  `xml:"QualityLevels,attr"`
	MaxWidth      int                  `xml:"MaxWidth,attr"`
	MaxHeight     int                  `xml:"MaxHeight,attr"`
	DisplayWidth  int                  `xml:"DisplayWidth,attr"`
	DisplayHeight int                  `xml:"DisplayHeight,attr"`
	QualityInfos  []SmoothQualityLevel `xml:"QualityLevel"`
	ChunksInfos   []SmoothChunk        `xml:"c"`
}

type SmoothStreamingMedia

type SmoothStreamingMedia struct {
	XMLName        xml.Name                 `xml:"SmoothStreamingMedia"`
	MajorVersion   int                      `xml:"MajorVersion,attr"`
	MinorVersion   int                      `xml:"MinorVersion,attr"`
	Timescale      int                      `xml:"TimeScale,attr"`
	Duration       int                      `xml:"Duration,attr"`
	IsLive         bool                     `xml:"IsLive,attr"`
	LookaheadCount int                      `xml:"LookaheadCount,attr"`
	StreamIndexes  []SmoothStreamIndex      `xml:"StreamIndex"`
	Protection     []SmoothProtectionHeader `xml:"Protection>ProtectionHeader"`
}

type SmoothTrackInfo

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

Structure used to hold track specific information for smooth streaming

type SubSampleEncryption

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

Structure used to store encryption parts of a sample

type Track

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

Structure representing a track inside an input file

func (*Track) Bandwidth

func (t *Track) Bandwidth() int

Return track bandwidth

func (*Track) BufferDepth

func (t *Track) BufferDepth() float64

Compute track buffer depth

func (*Track) BuildAdaptationSet

func (t *Track) BuildAdaptationSet() string

Build track adaptation part of the manifest

func (*Track) BuildChunk

func (t *Track) BuildChunk(path string) (float64, error)

Build a chunk for the track

func (*Track) BuildInit

func (t *Track) BuildInit(path string) error

Build the init chunk for the track

func (*Track) BuildRepresentation

func (t *Track) BuildRepresentation() string

Build track representation part of the manifest

func (*Track) Clean

func (t *Track) Clean()

Clean track private structures for GC

func (*Track) CleanDirectory

func (t *Track) CleanDirectory(path string)

Clean track directory for unreferenced file in manifest

func (*Track) CleanForLive

func (t *Track) CleanForLive()

Partially clean internal list in order to generate an up to date manifest

func (*Track) ComputePrivateInfos

func (t *Track) ComputePrivateInfos()

Extract codec info and compute bandwidth

func (*Track) Duration

func (t *Track) Duration() float64

Return track duration

func (*Track) Height

func (t *Track) Height() int

Return track height (0 for audio)

func (*Track) InitialiseBuild

func (t *Track) InitialiseBuild(path string) error

Initialise build for the track

func (*Track) IsAudio

func (t *Track) IsAudio() bool

Return if the track is audio or not

func (*Track) MaxChunkDuration

func (t *Track) MaxChunkDuration() float64

Return largest duration of segments in track

func (*Track) MinBufferTime

func (t *Track) MinBufferTime() float64

Return largest duration of segments in track

func (*Track) Print

func (t *Track) Print()

Print track on stdout

func (*Track) SetTimeFields

func (t *Track) SetTimeFields()

Set creationTime and modificationTime in Track structure

func (*Track) Width

func (t *Track) Width() int

Return track width (0 for audio)

Jump to

Keyboard shortcuts

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