Documentation
¶
Overview ¶
Package rtpaac contains a RTP/AAC decoder and encoder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMorePacketsNeeded = errors.New("need more packets")
ErrMorePacketsNeeded is returned when more packets are needed.
Functions ¶
This section is empty.
Types ¶
type ADTSHeader ¶
type ADTSHeader struct {
//fixed header
// 12 bit syncword '1111 1111 1111', denoting stary of a frame
Syncword uint
// 1 bit of MPEG tag, 0 for MPEG-4, 1 for MPEG-2
Id uint
// 2 bits which is always '00'
Layer uint
// 1 bit, 1 without crc and 0 indicated that crc is used
ProtectionAbsent uint
// 1 bit indicated which level of aac to use
Profile uint
// 4 bits represents sample rate
SamplingFreIndex uint
// 1 bit
PrivateBit uint
// 3 bit represents channel count
ChannelCfg uint
// 1 bit
OriginalCopy uint
// 1 bit
Home uint
// variable header
// 1 bit
CopyrightIdentificationBit uint
// 1 bit
CopyrightIndentificationStart uint
// 13 bit represents size of the adts frame which includes header and audio stream
AacFrameLength uint
// 11 bit 0x7FF indicates that is a variable bitrate stream
AdtsBufferFullness uint
/* number_of_raw_data_blocks_in_frame
* 表示ADTS帧中有number_of_raw_data_blocks_in_frame + 1个AAC原始帧
* 所以说number_of_raw_data_blocks_in_frame == 0
* 表示说ADTS帧中有一个AAC数据块并不是说没有。(一个AAC原始帧包含一段时间内1024个采样及相关数据)
*/
// 2 bits
NumberOfRawDataBlockInFrame uint
}
type AudioConfig ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is a RTP/AAC decoder.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is a RTP/AAC encoder.
type MPEG2AudioConfig ¶
type MPEG2AudioConfig struct {
Header ADTSHeader
}
func (*MPEG2AudioConfig) Decode ¶
func (c *MPEG2AudioConfig) Decode(bytes []byte) error
Decode decodes an MPEG_2 Audio Configuration
type MPEG4AudioConfig ¶
type MPEG4AudioConfig struct {
Type MPEG4AudioType
SampleRate int
ChannelCount int
}
MPEG4AudioConfig is a MPEG-4 Audio configuration.
func (*MPEG4AudioConfig) Decode ¶
func (c *MPEG4AudioConfig) Decode(byts []byte) error
Decode decodes an MPEG-4 Audio configuration.
type MPEG4AudioType ¶
type MPEG4AudioType int
MPEG4AudioType is the type of a MPEG-4 Audio stream.
const (
MPEG4AudioTypeAACLC MPEG4AudioType = 2
)
standard MPEG-4 Audio types.
Click to show internal directories.
Click to hide internal directories.