mirror of
https://github.com/Monibuca/plugin-webrtc.git
synced 2025-09-27 19:22:13 +08:00
加入批量连接中上行逻辑
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
package webrtc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/pion/rtcp"
|
||||
. "github.com/pion/webrtc/v3"
|
||||
@@ -29,14 +27,14 @@ func (suber *WebRTCSubscriber) OnEvent(event any) {
|
||||
case *track.Video:
|
||||
switch v.CodecID {
|
||||
case codec.CodecID_H264:
|
||||
pli := "42001f"
|
||||
pli = fmt.Sprintf("%x", v.GetDecoderConfiguration().Raw[0][1:4])
|
||||
if !strings.Contains(suber.SDP, pli) {
|
||||
list := reg_level.FindAllStringSubmatch(suber.SDP, -1)
|
||||
if len(list) > 0 {
|
||||
pli = list[0][1]
|
||||
}
|
||||
}
|
||||
pli := "420028"
|
||||
// pli = fmt.Sprintf("%x", v.GetDecoderConfiguration().Raw[0][1:4])
|
||||
// if !strings.Contains(suber.SDP, pli) {
|
||||
// list := reg_level.FindAllStringSubmatch(suber.SDP, -1)
|
||||
// if len(list) > 0 {
|
||||
// pli = list[0][1]
|
||||
// }
|
||||
// }
|
||||
suber.videoTrack, _ = NewTrackLocalStaticRTP(RTPCodecCapability{MimeType: MimeTypeH264, SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=" + pli}, v.Name, suber.Subscriber.Stream.Path)
|
||||
case codec.CodecID_H265:
|
||||
// suber.videoTrack, _ = NewTrackLocalStaticRTP(RTPCodecCapability{MimeType: MimeTypeH265, SDPFmtpLine: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=" + pli}, "video", suber.Subscriber.Stream.Path)
|
||||
|
Reference in New Issue
Block a user