mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-26 19:51:14 +08:00
适配3.1
This commit is contained in:
4
main.go
4
main.go
@@ -164,12 +164,12 @@ func (rtsp *RTSP) setVideoTrack() {
|
||||
if rtsp.VSdp.Codec == "H264" {
|
||||
rtsp.RtpVideo = rtsp.NewRTPVideo(7)
|
||||
if len(rtsp.VSdp.SpropParameterSets) > 1 {
|
||||
rtsp.RtpVideo.PushNalu(VideoPack{NALUs: rtsp.VSdp.SpropParameterSets})
|
||||
rtsp.RtpVideo.PushNalu(0, 0, rtsp.VSdp.SpropParameterSets...)
|
||||
}
|
||||
} else if rtsp.VSdp.Codec == "H265" {
|
||||
rtsp.RtpVideo = rtsp.NewRTPVideo(12)
|
||||
if len(rtsp.VSdp.VPS) > 0 {
|
||||
rtsp.RtpVideo.PushNalu(VideoPack{NALUs: [][]byte{rtsp.VSdp.VPS, rtsp.VSdp.SPS, rtsp.VSdp.PPS}})
|
||||
rtsp.RtpVideo.PushNalu(0, 0, rtsp.VSdp.VPS, rtsp.VSdp.SPS, rtsp.VSdp.PPS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -60,6 +60,8 @@ func ParseSDP(sdpRaw string) map[string]*SDPInfo {
|
||||
switch keyval[0] {
|
||||
case "H264", "H265", "PCMA", "PCMU":
|
||||
info.Codec = keyval[0]
|
||||
case "HEVC":
|
||||
info.Codec = "H265"
|
||||
case "MPEG4-GENERIC":
|
||||
info.Codec = "AAC"
|
||||
}
|
||||
|
@@ -14,7 +14,6 @@ import (
|
||||
|
||||
. "github.com/Monibuca/engine/v3"
|
||||
. "github.com/Monibuca/utils/v3"
|
||||
"github.com/Monibuca/utils/v3/codec"
|
||||
"github.com/pion/rtp"
|
||||
"github.com/teris-io/shortid"
|
||||
)
|
||||
@@ -129,13 +128,7 @@ func (session *RTSP) AcceptPush() {
|
||||
Println("Recv an audio RTP package")
|
||||
timer = time.Now()
|
||||
}
|
||||
if session.RtpAudio.CodecID == 10 {
|
||||
for _, payload := range codec.ParseRTPAAC(rtpBytes) {
|
||||
session.RtpAudio.Push(payload)
|
||||
}
|
||||
} else {
|
||||
session.RtpAudio.Push(rtpBytes)
|
||||
}
|
||||
session.RtpAudio.Push(rtpBytes)
|
||||
case session.aRTPControlChannel:
|
||||
// pack.Type = RTP_TYPE_AUDIOCONTROL
|
||||
case session.vRTPChannel:
|
||||
|
Reference in New Issue
Block a user