riff

package
v0.0.0-...-d16ac53 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2016 License: Apache-2.0, BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package riff implements the Resource Interchange File Format, used by media formats such as AVI, WAVE and WEBP.

A RIFF stream contains a sequence of chunks. Each chunk consists of an 8-byte header (containing a 4-byte chunk type and a 4-byte chunk length), the chunk data (presented as an io.Reader), and some padding bytes.

A detailed description of the format is at http://www.tactilemedia.com/info/MCI_Control_Info.html

Index

Constants

This section is empty.

Variables

View Source
var LIST = FourCC{'L', 'I', 'S', 'T'}

LIST is the "LIST" FourCC.

Functions

func NewListReader

func NewListReader(chunkLen uint32, chunkData io.Reader) (listType FourCC, data *Reader, err error)

NewListReader returns a LIST chunk's list type, such as "movi" or "wavl", and its chunks as a *Reader.

func NewReader

func NewReader(r io.Reader) (formType FourCC, data *Reader, err error)

NewReader returns the RIFF stream's form type, such as "AVI " or "WAVE", and its chunks as a *Reader.

Types

type FourCC

type FourCC [4]byte

FourCC is a four character code.

type Reader

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

Reader reads chunks from an underlying io.Reader.

func (*Reader) Next

func (z *Reader) Next() (chunkID FourCC, chunkLen uint32, chunkData io.Reader, err error)

Next returns the next chunk's ID, length and data. It returns io.EOF if there are no more chunks. The io.Reader returned becomes stale after the next Next call, and should no longer be used.

It is valid to call Next even if all of the previous chunk's data has not been read.

Jump to

Keyboard shortcuts

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