对其他音频的支持

This commit is contained in:
langhuihui
2020-09-20 15:54:27 +08:00
parent 7f40078b50
commit 02f3e91085
5 changed files with 30 additions and 12 deletions

14
main.go
View File

@@ -144,6 +144,20 @@ type RTSP struct {
UDPClient *UDPClient
Auth func(string) string
}
func (rtsp *RTSP) setAudioFormat(){
switch rtsp.ASdp.Codec {
case "aac":
rtsp.AudioInfo.SoundFormat = 10
case "pcma":
rtsp.AudioInfo.SoundFormat = 7
rtsp.AudioInfo.SoundRate = rtsp.ASdp.TimeScale
rtsp.AudioInfo.SoundSize = 16
case "pcmu":
rtsp.AudioInfo.SoundFormat = 8
rtsp.AudioInfo.SoundRate = rtsp.ASdp.TimeScale
rtsp.AudioInfo.SoundSize = 16
}
}
type RTSPClientInfo struct {
Agent string
Session string