mirror of
https://github.com/pion/webrtc.git
synced 2025-10-06 07:37:10 +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:
@@ -32,6 +32,15 @@ func gstreamerReceiveMain() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Allow us to receive 1 audio track, and 2 video tracks
|
||||
if _, err = peerConnection.AddTransceiver(webrtc.RTPCodecTypeAudio); err != nil {
|
||||
panic(err)
|
||||
} else if _, err = peerConnection.AddTransceiver(webrtc.RTPCodecTypeVideo); err != nil {
|
||||
panic(err)
|
||||
} else if _, err = peerConnection.AddTransceiver(webrtc.RTPCodecTypeVideo); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Set a handler for when a new remote track starts, this handler creates a gstreamer pipeline
|
||||
// for the given codec
|
||||
peerConnection.OnTrack(func(track *webrtc.Track, receiver *webrtc.RTPReceiver) {
|
||||
|
Reference in New Issue
Block a user