This repository has been archived by the owner on Dec 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/pion/webrtc-v3-design/webrtc" | ||
"github.com/pion/webrtc-v3-design/webrtc/pkg/media" | ||
) | ||
|
||
func main() { | ||
var s webrtc.SettingEngine | ||
|
||
// During Offer/Answer exchange the only codec we support will be VP8 | ||
// If the remote doesn't support VP8 signaling will fail | ||
s.SetEncodings([]*webrtc.RTPCodecCapability{ | ||
{ | ||
MimeType: "video/vp8", // Should we make this a enum? | ||
ClockRate: 90000, // Sholud we drop from API and just assume? | ||
}, | ||
}) | ||
|
||
peerConnection, _ := s.NewPeerConnection(webrtc.Configuration{}) | ||
|
||
track := media.NewStaticLocalRTPTrack(webrtc.RTPCodecCapability{ | ||
MimeType: "video/vp8", // Should we make this a enum? | ||
ClockRate: 90000, // Sholud we drop from API and just assume? | ||
}) | ||
|
||
peerConnection.AddTransceiverFromTrack(track, nil) | ||
|
||
// TODO | ||
// Do we expose a packetizer as a public API? | ||
// Do we add WriteSample? | ||
track.WriteRTP(nil) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package media | ||
|
||
import ( | ||
"github.com/pion/rtcp" | ||
"github.com/pion/rtp" | ||
"github.com/pion/webrtc-v3-design/webrtc" | ||
) | ||
|
||
type staticLocalRTPTrack struct{} | ||
|
||
// NewStaticTrack returns a LocalRTPTrack with a pre-set codec. | ||
func NewStaticLocalRTPTrack(webrtc.RTPCodecCapability) *staticLocalRTPTrack { return nil } | ||
|
||
func (s *staticLocalRTPTrack) ID() string { return "" } | ||
func (s *staticLocalRTPTrack) Stop() error { return nil } | ||
|
||
func (s *staticLocalRTPTrack) WriteRTP(*rtp.Packet) error { return nil } | ||
func (s *staticLocalRTPTrack) ReadRTCP() (rtcp.Packet, error) { return nil, nil } | ||
|
||
// SetParameters asserts that requested codec is available from the other side | ||
func (s *staticLocalRTPTrack) SetParameters(webrtc.RTPParameters) error { return nil } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters