mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-27 03:56:08 +08:00
feat: add LATM support
This commit is contained in:
@@ -68,13 +68,14 @@ func (p *RTSPPublisher) SetTracks() error {
|
|||||||
at := p.AudioTrack
|
at := p.AudioTrack
|
||||||
if at == nil {
|
if at == nil {
|
||||||
conf := f.Config
|
conf := f.Config
|
||||||
if f.LATM {
|
if f.LATM && f.StreamMuxConfig != nil && len(f.StreamMuxConfig.Programs) > 0 && len(f.StreamMuxConfig.Programs[0].Layers) > 0 {
|
||||||
conf = f.StreamMuxConfig.Programs[0].Layers[0].AudioSpecificConfig
|
conf = f.StreamMuxConfig.Programs[0].Layers[0].AudioSpecificConfig
|
||||||
}
|
}
|
||||||
at := p.CreateAudioTrack(codec.CodecID_AAC, byte(f.PayloadType()), uint32(conf.SampleRate)).(*AAC)
|
at := p.CreateAudioTrack(codec.CodecID_AAC, byte(f.PayloadType()), uint32(conf.SampleRate)).(*AAC)
|
||||||
at.IndexDeltaLength = f.IndexDeltaLength
|
at.AACDecoder.LATM = f.LATM
|
||||||
at.IndexLength = f.IndexLength
|
at.AACDecoder.IndexDeltaLength = f.IndexDeltaLength
|
||||||
at.SizeLength = f.SizeLength
|
at.AACDecoder.IndexLength = f.IndexLength
|
||||||
|
at.AACDecoder.SizeLength = f.SizeLength
|
||||||
if conf.Type == mpeg4audio.ObjectTypeAACLC {
|
if conf.Type == mpeg4audio.ObjectTypeAACLC {
|
||||||
at.Mode = 1
|
at.Mode = 1
|
||||||
}
|
}
|
||||||
|
@@ -78,9 +78,9 @@ func (s *RTSPSubscriber) OnEvent(event any) {
|
|||||||
SampleRate: int(v.SampleRate),
|
SampleRate: int(v.SampleRate),
|
||||||
ChannelCount: int(v.Channels),
|
ChannelCount: int(v.Channels),
|
||||||
},
|
},
|
||||||
SizeLength: v.SizeLength,
|
SizeLength: v.AACDecoder.SizeLength,
|
||||||
IndexLength: v.IndexLength,
|
IndexLength: v.AACDecoder.IndexLength,
|
||||||
IndexDeltaLength: v.IndexDeltaLength,
|
IndexDeltaLength: v.AACDecoder.IndexDeltaLength,
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
case codec.CodecID_PCMA:
|
case codec.CodecID_PCMA:
|
||||||
|
Reference in New Issue
Block a user