diff --git a/examples/gstreamer-receive/main.go b/examples/gstreamer-receive/main.go index 141a5c17..fde03da6 100644 --- a/examples/gstreamer-receive/main.go +++ b/examples/gstreamer-receive/main.go @@ -59,8 +59,8 @@ func main() { // Set the remote SessionDescription offer := webrtc.RTCSessionDescription{ - Typ: webrtc.RTCSdpTypeOffer, - Sdp: string(sd), + Type: webrtc.RTCSdpTypeOffer, + Sdp: string(sd), } if err := peerConnection.SetRemoteDescription(offer); err != nil { panic(err) diff --git a/examples/gstreamer-send/main.go b/examples/gstreamer-send/main.go index e16a5bc4..826958b5 100644 --- a/examples/gstreamer-send/main.go +++ b/examples/gstreamer-send/main.go @@ -45,7 +45,7 @@ func main() { } // Create a audio track - opusTrack, err := peerConnection.NewRTCTrack(webrtc.PayloadTypeOpus, "audio", "pions1") + opusTrack, err := peerConnection.NewRTCTrack(webrtc.PayloadTypeOpus, "audio", "pion1") if err != nil { panic(err) } @@ -55,7 +55,7 @@ func main() { } // Create a video track - vp8Track, err := peerConnection.NewRTCTrack(webrtc.PayloadTypeVP8, "video", "pions2") + vp8Track, err := peerConnection.NewRTCTrack(webrtc.PayloadTypeVP8, "video", "pion2") if err != nil { panic(err) } @@ -66,8 +66,8 @@ func main() { // Set the remote SessionDescription offer := webrtc.RTCSessionDescription{ - Typ: webrtc.RTCSdpTypeOffer, - Sdp: string(sd), + Type: webrtc.RTCSdpTypeOffer, + Sdp: string(sd), } if err := peerConnection.SetRemoteDescription(offer); err != nil { panic(err) diff --git a/examples/save-to-disk/main.go b/examples/save-to-disk/main.go index da9748d6..27819290 100644 --- a/examples/save-to-disk/main.go +++ b/examples/save-to-disk/main.go @@ -61,8 +61,8 @@ func main() { // Set the remote SessionDescription offer := webrtc.RTCSessionDescription{ - Typ: webrtc.RTCSdpTypeOffer, - Sdp: string(sd), + Type: webrtc.RTCSdpTypeOffer, + Sdp: string(sd), } if err := peerConnection.SetRemoteDescription(offer); err != nil { panic(err) diff --git a/examples/stun/main.go b/examples/stun/main.go index 2b17fdbd..504a128d 100644 --- a/examples/stun/main.go +++ b/examples/stun/main.go @@ -52,8 +52,8 @@ func main() { // Set the remote SessionDescription offer := webrtc.RTCSessionDescription{ - Typ: webrtc.RTCSdpTypeOffer, - Sdp: string(sd), + Type: webrtc.RTCSdpTypeOffer, + Sdp: string(sd), } if err := peerConnection.SetRemoteDescription(offer); err != nil { panic(err) diff --git a/internal/sdp/jsep.go b/internal/sdp/jsep.go index 48b310d3..a296ed10 100644 --- a/internal/sdp/jsep.go +++ b/internal/sdp/jsep.go @@ -75,10 +75,10 @@ func (d *SessionDescription) WithMedia(md *MediaDescription) *SessionDescription // NewJSEPMediaDescription creates a new MediaDescription with // some settings that are required by the JSEP spec. -func NewJSEPMediaDescription(typ string, codecPrefs []string) *MediaDescription { +func NewJSEPMediaDescription(codecType string, codecPrefs []string) *MediaDescription { // TODO: handle codecPrefs d := &MediaDescription{ - MediaName: fmt.Sprintf("%s 9 UDP/TLS/RTP/SAVPF", typ), // TODO: other transports? + MediaName: fmt.Sprintf("%s 9 UDP/TLS/RTP/SAVPF", codecType), // TODO: other transports? ConnectionData: "IN IP4 0.0.0.0", Attributes: []string{}, } diff --git a/mediaengine.go b/mediaengine.go index 612b2c7b..b9c309be 100644 --- a/mediaengine.go +++ b/mediaengine.go @@ -164,7 +164,7 @@ type RTCRtpCodec struct { // NewRTCRtpCodec is used to define a new codec func NewRTCRtpCodec( - typ RTCRtpCodecType, + codecType RTCRtpCodecType, name string, clockrate uint32, channels uint16, @@ -174,14 +174,14 @@ func NewRTCRtpCodec( ) *RTCRtpCodec { return &RTCRtpCodec{ RTCRtpCodecCapability: RTCRtpCodecCapability{ - MimeType: typ.String() + "/" + name, + MimeType: codecType.String() + "/" + name, ClockRate: clockrate, Channels: channels, SdpFmtpLine: fmtp, }, PayloadType: payloadType, Payloader: payloader, - Type: typ, + Type: codecType, Name: name, } } diff --git a/pkg/ice/address.go b/pkg/ice/address.go index 4a71e315..87ea5903 100644 --- a/pkg/ice/address.go +++ b/pkg/ice/address.go @@ -74,7 +74,7 @@ func (t TransportType) String() string { } } -// URL represents a STUN (rfc7064) or TRUN (rfc7065) URL +// URL represents a STUN (rfc7064) or TURN (rfc7065) URL type URL struct { Type ServerType Secure bool @@ -83,7 +83,7 @@ type URL struct { TransportType TransportType } -// NewURL creates a new URL by parsing a STUN (rfc7064) or TRUN (rfc7065) uri string +// NewURL creates a new URL by parsing a STUN (rfc7064) or TURN (rfc7065) uri string func NewURL(address string) (URL, error) { var result URL diff --git a/signaling.go b/signaling.go index 2bf71bfb..9fc9f608 100644 --- a/signaling.go +++ b/signaling.go @@ -131,8 +131,8 @@ func (t RTCSdpType) String() string { // RTCSessionDescription is used to expose local and remote session descriptions. type RTCSessionDescription struct { - Typ RTCSdpType - Sdp string + Type RTCSdpType + Sdp string } // SetRemoteDescription sets the SessionDescription of the remote peer @@ -179,8 +179,8 @@ func (r *RTCPeerConnection) CreateOffer(options *RTCOfferOptions) (RTCSessionDes continue } track := tranceiver.Sender.Track - cname := "poins" // TODO: Support RTP streams synchronisation - steamlabel := "poins" // TODO: Support steam labels + cname := "pion" // TODO: Support RTP streams synchronisation + steamlabel := "pion" // TODO: Support steam labels codec, err := rtcMediaEngine.getCodec(track.PayloadType) if err != nil { return RTCSessionDescription{}, err @@ -213,8 +213,8 @@ func (r *RTCPeerConnection) CreateOffer(options *RTCOfferOptions) (RTCSessionDes d.WithValueAttribute(sdp.AttrKeyMsidSemantic, " "+sdp.SemanticTokenWebRTCMediaStreams+streamlabels) return RTCSessionDescription{ - Typ: RTCSdpTypeOffer, - Sdp: d.Marshal(), + Type: RTCSdpTypeOffer, + Sdp: d.Marshal(), }, nil } @@ -255,19 +255,19 @@ func (r *RTCPeerConnection) CreateAnswer(options *RTCOfferOptions) (RTCSessionDe d.WithValueAttribute(sdp.AttrKeyMsidSemantic, " "+sdp.SemanticTokenWebRTCMediaStreams+audioStreamLabels+videoStreamLabels) return RTCSessionDescription{ - Typ: RTCSdpTypeAnswer, - Sdp: d.Marshal(), + Type: RTCSdpTypeAnswer, + Sdp: d.Marshal(), }, nil } -func (r *RTCPeerConnection) addAnswerMedia(d *sdp.SessionDescription, typ RTCRtpCodecType) (string, error) { +func (r *RTCPeerConnection) addAnswerMedia(d *sdp.SessionDescription, codecType RTCRtpCodecType) (string, error) { added := false var streamlabels string for _, tranceiver := range r.rtpTransceivers { if tranceiver.Sender == nil || tranceiver.Sender.Track == nil || - tranceiver.Sender.Track.Kind != typ { + tranceiver.Sender.Track.Kind != codecType { continue } track := tranceiver.Sender.Track @@ -305,16 +305,16 @@ func (r *RTCPeerConnection) addAnswerMedia(d *sdp.SessionDescription, typ RTCRtp if !added { // Add media line to advertise capabilities - media := sdp.NewJSEPMediaDescription(typ.String(), []string{}). + media := sdp.NewJSEPMediaDescription(codecType.String(), []string{}). WithValueAttribute(sdp.AttrKeyConnectionSetup, sdp.ConnectionRoleActive.String()). // TODO: Support other connection types - WithValueAttribute(sdp.AttrKeyMID, typ.String()). + WithValueAttribute(sdp.AttrKeyMID, codecType.String()). WithPropertyAttribute(RTCRtpTransceiverDirectionSendrecv.String()). WithICECredentials(r.iceAgent.Ufrag, r.iceAgent.Pwd). // TODO: get credendials form ICE agent WithPropertyAttribute(sdp.AttrKeyICELite). // TODO: get ICE type from ICE Agent (#23) WithPropertyAttribute(sdp.AttrKeyRtcpMux). // TODO: support RTCP fallback WithPropertyAttribute(sdp.AttrKeyRtcpRsize) // TODO: Support Reduced-Size RTCP? - for _, codec := range rtcMediaEngine.getCodecsByKind(typ) { + for _, codec := range rtcMediaEngine.getCodecsByKind(codecType) { media.WithCodec( codec.PayloadType, codec.Name,