BIG core logic rewrite

This commit is contained in:
Alexey Khit
2023-03-17 06:48:02 +03:00
parent 2146ea470b
commit 12a7b96289
107 changed files with 3000 additions and 3024 deletions
+4 -5
View File
@@ -4,7 +4,6 @@ import (
"encoding/base64"
"fmt"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/streamer"
"github.com/AlexxIT/go2rtc/pkg/webrtc"
"github.com/gorilla/websocket"
pion "github.com/pion/webrtc/v3"
@@ -16,11 +15,11 @@ func NewClient(tracker, share, pwd string, pc *pion.PeerConnection) (*webrtc.Con
// 1. Create WebRTC producer
prod := webrtc.NewConn(pc)
prod.Desc = "WebRTC/WebTorrent sync"
prod.Mode = streamer.ModeActiveProducer
prod.Mode = core.ModeActiveProducer
medias := []*streamer.Media{
{Kind: streamer.KindVideo, Direction: streamer.DirectionRecvonly},
{Kind: streamer.KindAudio, Direction: streamer.DirectionRecvonly},
medias := []*core.Media{
{Kind: core.KindVideo, Direction: core.DirectionRecvonly},
{Kind: core.KindAudio, Direction: core.DirectionRecvonly},
}
// 2. Create offer
+1 -2
View File
@@ -4,14 +4,13 @@ import (
"encoding/base64"
"fmt"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/streamer"
"github.com/gorilla/websocket"
"sync"
"time"
)
type Server struct {
streamer.Element
core.Listener
URL string
Exchange func(src, offer string) (answer string, err error)