Skip to content

Commit

Permalink
Merge branch 'main' into sk_add_encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
skheyfets-asapp authored Dec 13, 2024
2 parents 7f381b0 + 7610e16 commit a95639b
Show file tree
Hide file tree
Showing 26 changed files with 264 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.23

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
Expand Down
7 changes: 6 additions & 1 deletion callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package lksdk

import (
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"

"github.com/livekit/protocol/livekit"
)
Expand Down Expand Up @@ -46,6 +46,7 @@ type ParticipantCallback struct {
OnTrackUnpublished func(publication *RemoteTrackPublication, rp *RemoteParticipant)
OnDataReceived func(data []byte, params DataReceiveParams) // Deprecated: Use OnDataPacket instead
OnDataPacket func(data DataPacket, params DataReceiveParams)
OnTranscriptionReceived func(transcriptionSegments []*TranscriptionSegment, p Participant, publication TrackPublication)
}

func NewParticipantCallback() *ParticipantCallback {
Expand All @@ -66,6 +67,7 @@ func NewParticipantCallback() *ParticipantCallback {
OnTrackUnpublished: func(publication *RemoteTrackPublication, rp *RemoteParticipant) {},
OnDataReceived: func(data []byte, params DataReceiveParams) {},
OnDataPacket: func(data DataPacket, params DataReceiveParams) {},
OnTranscriptionReceived: func(transcriptionSegments []*TranscriptionSegment, p Participant, publication TrackPublication) {},
}
}

Expand Down Expand Up @@ -115,6 +117,9 @@ func (cb *ParticipantCallback) Merge(other *ParticipantCallback) {
if other.OnDataPacket != nil {
cb.OnDataPacket = other.OnDataPacket
}
if other.OnTranscriptionReceived != nil {
cb.OnTranscriptionReceived = other.OnTranscriptionReceived
}
}

type DisconnectionReason string
Expand Down
7 changes: 6 additions & 1 deletion engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"time"

protoLogger "github.com/livekit/protocol/logger"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v4"
"go.uber.org/atomic"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
Expand Down Expand Up @@ -81,6 +81,7 @@ type RTCEngine struct {
OnRestarted func(*livekit.JoinResponse)
OnResuming func()
OnResumed func()
OnTranscription func(*livekit.Transcription)

// callbacks to get data
CbGetLocalParticipantSID func() string
Expand Down Expand Up @@ -561,6 +562,10 @@ func (e *RTCEngine) handleDataPacket(msg webrtc.DataChannelMessage) {
if e.OnDataPacket != nil {
e.OnDataPacket(identity, msg.SipDtmf)
}
case *livekit.DataPacket_Transcription:
if e.OnTranscription != nil {
e.OnTranscription(msg.Transcription)
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/echo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"syscall"
"time"

"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v3/pkg/media"
"github.com/pion/webrtc/v4"
"github.com/pion/webrtc/v4/pkg/media"

"github.com/livekit/protocol/auth"
"github.com/livekit/protocol/logger"
Expand Down
10 changes: 5 additions & 5 deletions examples/filesaver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"syscall"

"github.com/pion/rtp/codecs"
"github.com/pion/webrtc/v3"
"github.com/pion/webrtc/v3/pkg/media"
"github.com/pion/webrtc/v3/pkg/media/h264writer"
"github.com/pion/webrtc/v3/pkg/media/ivfwriter"
"github.com/pion/webrtc/v3/pkg/media/oggwriter"
"github.com/pion/webrtc/v4"
"github.com/pion/webrtc/v4/pkg/media"
"github.com/pion/webrtc/v4/pkg/media/h264writer"
"github.com/pion/webrtc/v4/pkg/media/ivfwriter"
"github.com/pion/webrtc/v4/pkg/media/oggwriter"

"github.com/livekit/protocol/logger"
lksdk "github.com/livekit/server-sdk-go/v2"
Expand Down
53 changes: 28 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
module github.com/livekit/server-sdk-go/v2

go 1.22.7
go 1.23

toolchain go1.23.3

require (
github.com/bep/debounce v1.2.1
github.com/go-logr/logr v1.4.2
github.com/go-logr/stdr v1.2.2
github.com/gorilla/websocket v1.5.3
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598
github.com/livekit/protocol v1.27.1
github.com/livekit/mediatransportutil v0.0.0-20241128072814-c363618d4c98
github.com/livekit/protocol v1.29.5-0.20241209183753-f6b5078b2244
github.com/magefile/mage v1.15.0
github.com/pion/dtls/v2 v2.2.12
github.com/pion/interceptor v0.1.30
github.com/pion/dtls/v3 v3.0.4
github.com/pion/interceptor v0.1.37
github.com/pion/rtcp v1.2.14
github.com/pion/rtp v1.8.9
github.com/pion/sdp/v3 v3.0.9
github.com/pion/webrtc/v3 v3.3.4
github.com/stretchr/testify v1.9.0
github.com/pion/webrtc/v4 v4.0.5
github.com/stretchr/testify v1.10.0
github.com/twitchtv/twirp v8.1.3+incompatible
go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.30.0
Expand All @@ -26,43 +28,43 @@ require (
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240401165935-b983156c5e99.1 // indirect
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2 // indirect
buf.build/go/protoyaml v0.2.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/bufbuild/protovalidate-go v0.6.1 // indirect
github.com/bufbuild/protoyaml-go v0.1.9 // indirect
github.com/bufbuild/protovalidate-go v0.6.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/frostbyte73/core v0.0.12 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/frostbyte73/core v0.0.13 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/gammazero/deque v0.2.1 // indirect
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
github.com/google/cel-go v0.20.1 // indirect
github.com/google/cel-go v0.21.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jxskiss/base62 v1.1.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/lithammer/shortuuid/v4 v4.0.0 // indirect
github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 // indirect
github.com/livekit/psrpc v0.6.1-0.20241018124827-1efff3d113a8 // indirect
github.com/nats-io/nats.go v1.36.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pion/datachannel v1.5.8 // indirect
github.com/pion/ice/v2 v2.3.36 // indirect
github.com/pion/datachannel v1.5.9 // indirect
github.com/pion/ice/v4 v4.0.3 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/mdns/v2 v2.0.7 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/sctp v1.8.19 // indirect
github.com/pion/srtp/v2 v2.0.20 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/sctp v1.8.34 // indirect
github.com/pion/srtp/v3 v3.0.4 // indirect
github.com/pion/stun/v3 v3.0.0 // indirect
github.com/pion/transport/v3 v3.0.7 // indirect
github.com/pion/turn/v4 v4.0.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/puzpuzpuz/xsync/v3 v3.1.0 // indirect
github.com/redis/go-redis/v9 v9.6.1 // indirect
github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect
github.com/redis/go-redis/v9 v9.7.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/wlynxg/anet v0.0.3 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
Expand All @@ -71,6 +73,7 @@ require (
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.68.0 // indirect
Expand Down
Loading

0 comments on commit a95639b

Please sign in to comment.