mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +08:00
Migrate SDP generation to Unified Plan
This commit has breaking changes. This API change means we can no longer support an arbitrary number of receivers. For every track you want to receive you MUST call PeerConnection.AddTransceiver We do now support sending an multiple audio/video feeds. You can see this behavior via gstreamer-receive and gstreamer-send currently. Resolves #54
This commit is contained in:
@@ -4,6 +4,7 @@ package webrtc
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/pions/rtp"
|
||||
"github.com/pions/rtp/codecs"
|
||||
@@ -164,6 +165,18 @@ func (t RTPCodecType) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
// NewRTPCodecType creates a RTPCodecType from a string
|
||||
func NewRTPCodecType(r string) RTPCodecType {
|
||||
switch {
|
||||
case strings.EqualFold(r, "audio"):
|
||||
return RTPCodecTypeAudio
|
||||
case strings.EqualFold(r, "video"):
|
||||
return RTPCodecTypeVideo
|
||||
default:
|
||||
return RTPCodecType(0)
|
||||
}
|
||||
}
|
||||
|
||||
// RTPCodec represents a codec supported by the PeerConnection
|
||||
type RTPCodec struct {
|
||||
RTPCodecCapability
|
||||
|
Reference in New Issue
Block a user