remove av.H264CodecData
This commit is contained in:
parent
58acf9ee66
commit
a5e9c7a096
@ -365,14 +365,12 @@ func (self CodecData) MakeADTSHeader(samples int, payloadLength int) []byte {
|
|||||||
return MakeADTSHeader(self.ConfigInfo, samples, payloadLength)
|
return MakeADTSHeader(self.ConfigInfo, samples, payloadLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCodecDataFromMPEG4AudioConfigBytes(config []byte) (codec av.AACCodecData, err error) {
|
func NewCodecDataFromMPEG4AudioConfigBytes(config []byte) (self CodecData, err error) {
|
||||||
self := CodecData{}
|
|
||||||
self.Config = config
|
self.Config = config
|
||||||
if self.ConfigInfo, err = ParseMPEG4AudioConfig(config); err != nil {
|
if self.ConfigInfo, err = ParseMPEG4AudioConfig(config); err != nil {
|
||||||
err = fmt.Errorf("parse MPEG4AudioConfig failed(%s)", err)
|
err = fmt.Errorf("parse MPEG4AudioConfig failed(%s)", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
codec = self
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,8 +575,7 @@ func (self CodecData) Height() int {
|
|||||||
return int(self.SPSInfo.Height)
|
return int(self.SPSInfo.Height)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCodecDataFromAVCDecoderConfRecord(record []byte) (codec av.H264CodecData, err error) {
|
func NewCodecDataFromAVCDecoderConfRecord(record []byte) (self CodecData, err error) {
|
||||||
self := CodecData{}
|
|
||||||
self.Record = record
|
self.Record = record
|
||||||
if self.RecordInfo, err = ParseAVCDecoderConfRecord(record); err != nil {
|
if self.RecordInfo, err = ParseAVCDecoderConfRecord(record); err != nil {
|
||||||
return
|
return
|
||||||
@ -593,11 +592,10 @@ func NewCodecDataFromAVCDecoderConfRecord(record []byte) (codec av.H264CodecData
|
|||||||
err = fmt.Errorf("parse SPS failed(%s)", err)
|
err = fmt.Errorf("parse SPS failed(%s)", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
codec = self
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCodecDataFromSPSAndPPS(sps, pps []byte) (codec av.H264CodecData, err error) {
|
func NewCodecDataFromSPSAndPPS(sps, pps []byte) (self CodecData, err error) {
|
||||||
recordinfo := AVCDecoderConfRecord{}
|
recordinfo := AVCDecoderConfRecord{}
|
||||||
recordinfo.AVCProfileIndication = uint(sps[1])
|
recordinfo.AVCProfileIndication = uint(sps[1])
|
||||||
recordinfo.ProfileCompatibility = uint(sps[2])
|
recordinfo.ProfileCompatibility = uint(sps[2])
|
||||||
@ -609,13 +607,11 @@ func NewCodecDataFromSPSAndPPS(sps, pps []byte) (codec av.H264CodecData, err err
|
|||||||
if err = WriteAVCDecoderConfRecord(buf, recordinfo); err != nil {
|
if err = WriteAVCDecoderConfRecord(buf, recordinfo); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self := CodecData{}
|
|
||||||
self.RecordInfo = recordinfo
|
self.RecordInfo = recordinfo
|
||||||
self.Record = buf.Bytes()
|
self.Record = buf.Bytes()
|
||||||
if self.SPSInfo, err = ParseSPS(sps); err != nil {
|
if self.SPSInfo, err = ParseSPS(sps); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
codec = self
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user