Update pion/webrtc library to v4

This commit is contained in:
Alex X
2025-04-07 16:21:14 +03:00
parent bfd26560b1
commit af7509ebaf
25 changed files with 57 additions and 131 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/webrtc"
pion "github.com/pion/webrtc/v3"
pion "github.com/pion/webrtc/v4"
)
type Client struct {
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/rtsp"
"github.com/AlexxIT/go2rtc/pkg/webrtc"
pion "github.com/pion/webrtc/v3"
pion "github.com/pion/webrtc/v4"
)
type WebRTCClient struct {
+2 -2
View File
@@ -12,7 +12,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/webrtc"
"github.com/google/uuid"
"github.com/gorilla/websocket"
pion "github.com/pion/webrtc/v3"
pion "github.com/pion/webrtc/v4"
)
type Client struct {
@@ -536,6 +536,6 @@ func (c *Client) MarshalJSON() ([]byte, error) {
if webrtcProd, ok := c.prod.(*webrtc.Conn); ok {
return webrtcProd.MarshalJSON()
}
return json.Marshal(c.prod)
}
+1 -1
View File
@@ -15,7 +15,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/roborock/iot"
"github.com/AlexxIT/go2rtc/pkg/webrtc"
pion "github.com/pion/webrtc/v3"
pion "github.com/pion/webrtc/v4"
)
// Deprecated: should be rewritten to core.Connection
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"github.com/pion/rtcp"
"github.com/pion/rtp"
"github.com/pion/srtp/v2"
"github.com/pion/srtp/v3"
)
type Session struct {
+2 -2
View File
@@ -5,9 +5,9 @@ import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/xnet"
"github.com/pion/ice/v2"
"github.com/pion/ice/v4"
"github.com/pion/interceptor"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
)
// ReceiveMTU = Ethernet MTU (1500) - IP Header (20) - UDP Header (8)
+1 -1
View File
@@ -3,7 +3,7 @@ package webrtc
import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/sdp/v3"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
)
func (c *Conn) CreateOffer(medias []*core.Media) (string, error) {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"testing"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/rtcp"
"github.com/pion/rtp"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
)
type Conn struct {
+3 -3
View File
@@ -11,10 +11,10 @@ import (
"time"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/ice/v2"
"github.com/pion/ice/v4"
"github.com/pion/sdp/v3"
"github.com/pion/stun"
"github.com/pion/webrtc/v3"
"github.com/pion/stun/v3"
"github.com/pion/webrtc/v4"
)
func UnmarshalMedias(descriptions []*sdp.MediaDescription) (medias []*core.Media) {
+1 -1
View File
@@ -2,7 +2,7 @@ package webrtc
import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
)
func (c *Conn) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error) {
+1 -1
View File
@@ -3,7 +3,7 @@ package webrtc
import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/sdp/v3"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
)
func (c *Conn) SetOffer(offer string) (err error) {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"sync"
"github.com/pion/rtp"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
)
type Track struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package webrtc
import (
"testing"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
"github.com/stretchr/testify/require"
)
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/webrtc"
"github.com/gorilla/websocket"
pion "github.com/pion/webrtc/v3"
pion "github.com/pion/webrtc/v4"
)
func NewClient(tracker, share, pwd string, pc *pion.PeerConnection) (*webrtc.Conn, error) {