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:
Sean DuBois
2019-03-12 23:54:35 -07:00
parent bc94eaa968
commit 1202dbaa06
20 changed files with 340 additions and 169 deletions

View File

@@ -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