golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
592 B
29 lines
592 B
package core |
|
|
|
import ( |
|
"github.com/bluenviron/gortsplib/v3/pkg/formats" |
|
"github.com/bluenviron/gortsplib/v3/pkg/media" |
|
) |
|
|
|
type streamMedia struct { |
|
formats map[formats.Format]*streamFormat |
|
} |
|
|
|
func newStreamMedia(udpMaxPayloadSize int, |
|
medi *media.Media, |
|
generateRTPPackets bool, |
|
) (*streamMedia, error) { |
|
sm := &streamMedia{ |
|
formats: make(map[formats.Format]*streamFormat), |
|
} |
|
|
|
for _, forma := range medi.Formats { |
|
var err error |
|
sm.formats[forma], err = newStreamFormat(udpMaxPayloadSize, forma, generateRTPPackets) |
|
if err != nil { |
|
return nil, err |
|
} |
|
} |
|
|
|
return sm, nil |
|
}
|
|
|