// Copyright 2019, Chef. All rights reserved. // https://github.com/q191201771/lal // // Use of this source code is governed by a MIT-style license // that can be found in the License file. // // Author: Chef (191201771@qq.com) package aac import ( "encoding/hex" "errors" "github.com/q191201771/naza/pkg/nazabits" "github.com/q191201771/naza/pkg/nazalog" ) var ErrAAC = errors.New("lal.aac: fxxk") // Audio Data Transport Stream type ADTS struct { audioObjectType uint8 samplingFrequencyIndex uint8 channelConfiguration uint8 adtsHeader []byte } // 传入AAC Sequence Header,调用GetADTS时需要使用 // @param rtmp message payload,包含前面2个字节 func (a *ADTS) PutAACSequenceHeader(payload []byte) error { if len(payload) < 4 { nazalog.Warnf("aac seq header length invalid. len=%d", len(payload)) return ErrAAC } // TODO chef: 把Seq Header头两字节的解析和ADTS的内容分离开 // ,