feat: 转发流的ssrc以offer sdp的为准

This commit is contained in:
ydajiang
2025-06-04 20:55:18 +08:00
parent c09a132433
commit 98afe59c67
15 changed files with 242 additions and 95 deletions

View File

@@ -83,7 +83,7 @@ func SubscribeStreamWithOptions(sink Sink, values url.Values, ready bool, timeou
return state
}
func ForwardStream(protocol TransStreamProtocol, transport TransportType, sourceId string, values url.Values, remoteAddr string, manager transport.Manager) (Sink, int, error) {
func ForwardStream(protocol TransStreamProtocol, transport TransportType, sourceId string, values url.Values, remoteAddr string, manager transport.Manager, ssrc uint32) (Sink, int, error) {
//source := SourceManager.Find(sourceId)
//if source == nil {
// return nil, 0, fmt.Errorf("source %s 不存在", sourceId)
@@ -91,7 +91,7 @@ func ForwardStream(protocol TransStreamProtocol, transport TransportType, source
sinkId := GenerateUint64SinkID()
var port int
sink, port, err := NewForwardSink(transport, protocol, sinkId, sourceId, remoteAddr, manager)
sink, port, err := NewForwardSink(transport, protocol, sinkId, sourceId, remoteAddr, manager, ssrc)
if err != nil {
return nil, 0, err
}