Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update go sdk to v2 #606

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ require (
github.com/gorilla/websocket v1.5.1
github.com/livekit/livekit-server v1.5.1-0.20231026153736-8b16db227070
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
github.com/livekit/protocol v1.9.5-0.20240117010318-e17b08e9a41f
github.com/livekit/protocol v1.9.7
github.com/livekit/psrpc v0.5.3-0.20231214055026-06ce27a934c9
github.com/livekit/server-sdk-go v1.1.6-0.20240118220104-7ca41b6ea1aa
github.com/livekit/server-sdk-go/v2 v2.0.1
github.com/pion/rtp v1.8.3
github.com/pion/webrtc/v3 v3.2.24
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model v0.5.0
Expand All @@ -32,18 +31,18 @@ require (
github.com/urfave/cli/v2 v2.25.7
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.26.0
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
google.golang.org/api v0.130.0
google.golang.org/grpc v1.60.1
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
google.golang.org/api v0.149.0
google.golang.org/grpc v1.61.0
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v3 v3.0.1
)

require (
cloud.google.com/go v0.110.9 // indirect
cloud.google.com/go/compute v1.23.2 // indirect
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.4 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bep/debounce v1.2.1 // indirect
Expand All @@ -63,9 +62,9 @@ require (
github.com/gobwas/ws v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jxskiss/base62 v1.1.0 // indirect
Expand All @@ -83,24 +82,24 @@ require (
github.com/nats-io/nkeys v0.4.6 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pion/datachannel v1.5.5 // indirect
github.com/pion/dtls/v2 v2.2.8 // indirect
github.com/pion/dtls/v2 v2.2.9 // indirect
github.com/pion/ice/v2 v2.3.11 // indirect
github.com/pion/interceptor v0.1.25 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.9 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.12 // indirect
github.com/pion/rtcp v1.2.13 // indirect
github.com/pion/sctp v1.8.9 // indirect
github.com/pion/sdp/v3 v3.0.6 // indirect
github.com/pion/srtp/v2 v2.0.18 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.4 // indirect
github.com/pion/turn/v2 v2.1.4 // indirect
github.com/pion/webrtc/v3 v3.2.24 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/redis/go-redis/v9 v9.4.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/thoas/go-funk v0.9.3 // indirect
github.com/twitchtv/twirp v8.1.3+incompatible // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
Expand All @@ -109,14 +108,14 @@ require (
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/oauth2 v0.14.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
)
96 changes: 34 additions & 62 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/config/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/redis"
lksdk "github.com/livekit/server-sdk-go"
lksdk "github.com/livekit/server-sdk-go/v2"
)

type BaseConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/livekit/protocol/rpc"
"github.com/livekit/protocol/tracer"
"github.com/livekit/protocol/utils"
lksdk "github.com/livekit/server-sdk-go"
lksdk "github.com/livekit/server-sdk-go/v2"
)

const Latency = uint64(3e9)
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/builder/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/livekit/egress/pkg/errors"
"github.com/livekit/egress/pkg/gstreamer"
"github.com/livekit/egress/pkg/types"
lksdk "github.com/livekit/server-sdk-go"
lksdk "github.com/livekit/server-sdk-go/v2"
)

const audioMixerLatency = uint64(2e9)
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/builder/video.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/livekit/egress/pkg/gstreamer"
"github.com/livekit/egress/pkg/types"
"github.com/livekit/protocol/logger"
lksdk "github.com/livekit/server-sdk-go"
lksdk "github.com/livekit/server-sdk-go/v2"
)

const videoTestSrcName = "video_test_src"
Expand Down
20 changes: 10 additions & 10 deletions pkg/pipeline/source/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/tracer"
lksdk "github.com/livekit/server-sdk-go"
"github.com/livekit/server-sdk-go/pkg/synchronizer"
lksdk "github.com/livekit/server-sdk-go/v2"
"github.com/livekit/server-sdk-go/v2/pkg/synchronizer"
)

const (
Expand Down Expand Up @@ -162,13 +162,13 @@ func (s *SDKSource) joinRoom() error {
}

logger.Debugw("connecting to room")
s.room = lksdk.CreateRoom(cb)
if err := s.room.JoinWithToken(s.WsUrl, s.Token, lksdk.WithAutoSubscribe(false)); err != nil {
room, err := lksdk.ConnectToRoomWithToken(s.WsUrl, s.Token, cb, lksdk.WithAutoSubscribe(false))
if err != nil {
return err
}
s.room = room

var fileIdentifier string
var err error
var w, h uint32
switch s.RequestType {
case types.RequestTypeParticipant:
Expand Down Expand Up @@ -210,14 +210,14 @@ func (s *SDKSource) awaitParticipant(identity string) (uint32, uint32, error) {
return 0, 0, err
}

for trackCount := 0; trackCount == 0 || trackCount < len(rp.Tracks()); trackCount++ {
for trackCount := 0; trackCount == 0 || trackCount < len(rp.TrackPublications()); trackCount++ {
if err = <-s.errors; err != nil {
return 0, 0, err
}
}

var w, h uint32
for _, t := range rp.Tracks() {
for _, t := range rp.TrackPublications() {
if t.TrackInfo().Type == livekit.TrackType_VIDEO {
w = t.TrackInfo().Width
h = t.TrackInfo().Height
Expand All @@ -232,7 +232,7 @@ func (s *SDKSource) awaitParticipant(identity string) (uint32, uint32, error) {
func (s *SDKSource) getParticipant(identity string) (*lksdk.RemoteParticipant, error) {
deadline := time.Now().Add(subscriptionTimeout)
for time.Now().Before(deadline) {
for _, p := range s.room.GetParticipants() {
for _, p := range s.room.GetRemoteParticipants() {
if p.Identity() == identity {
return p, nil
}
Expand Down Expand Up @@ -285,8 +285,8 @@ func (s *SDKSource) subscribeToTracks(expecting map[string]struct{}, deadline <-
return nil, errors.ErrTrackNotFound(trackID)
}
default:
for _, p := range s.room.GetParticipants() {
for _, track := range p.Tracks() {
for _, p := range s.room.GetRemoteParticipants() {
for _, track := range p.TrackPublications() {
trackID := track.SID()
if _, ok := expecting[trackID]; ok {
if err := s.subscribe(track); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/pipeline/source/sdk/appwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import (
"github.com/livekit/egress/pkg/gstreamer"
"github.com/livekit/egress/pkg/types"
"github.com/livekit/protocol/logger"
lksdk "github.com/livekit/server-sdk-go"
"github.com/livekit/server-sdk-go/pkg/jitter"
"github.com/livekit/server-sdk-go/pkg/synchronizer"
lksdk "github.com/livekit/server-sdk-go/v2"
"github.com/livekit/server-sdk-go/v2/pkg/jitter"
"github.com/livekit/server-sdk-go/v2/pkg/synchronizer"
)

type state int
Expand Down
2 changes: 1 addition & 1 deletion test/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/livekit/egress/pkg/types"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/rpc"
lksdk "github.com/livekit/server-sdk-go"
lksdk "github.com/livekit/server-sdk-go/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion test/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/rpc"
"github.com/livekit/psrpc"
lksdk "github.com/livekit/server-sdk-go"
lksdk "github.com/livekit/server-sdk-go/v2"
)

type Runner struct {
Expand Down