Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkData ¶
ChunkData provides a raw fmp4 chunk or a full segment. Start provides an offset in bytes in the segment.
type MP4ChunkParser ¶
type MP4ChunkParser struct {
// contains filtered or unexported fields
}
MP4ChunkParser is a parser for fragmented mp4 content. The callback is called on end of segment of end of fragment (chunk) if fragments are detected.
func NewMP4ChunkParser ¶
NewMP4ChunkParser creates a new MP4ChunkParser with an initial buffer. The buffer is grown as needed and can be retrieved for reuse with GetBuffer().
func (*MP4ChunkParser) GetBuffer ¶
func (p *MP4ChunkParser) GetBuffer() []byte
GetBuffer returns the buffer used by the parser. The buffer is resized as needed during parsing. The intention is to reuse the buffer for subsequent parsing of the same stream of segments to avoid unnecessary allocations.
func (*MP4ChunkParser) Parse ¶
func (p *MP4ChunkParser) Parse() error
Parse parses mp4 content from a reader and sends fragments (ending with mdat) via callback. Init segments are detected by the presence of a moov box. The parsing always and when eof is reached, or an error occurs. If io.EOF is returned at an end of a box, no error is returned.