这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
db871de
Fixed building issue.
ashkan-saeedi-mazdeh Dec 15, 2023
561282f
Fixed a memory leak
ashkan-saeedi-mazdeh Dec 16, 2023
7320b31
Fixed a compile error on the distructor
ashkan-saeedi-mazdeh Dec 16, 2023
80d3dcd
Fixed the last error regarding the leak fix
ashkan-saeedi-mazdeh Dec 16, 2023
bb762d2
Updated dll
ashkan-saeedi-mazdeh Dec 23, 2023
c8e3906
updated protobuf messages to latest to be able to publish data.
ashkan-saeedi-mazdeh Dec 23, 2023
2cf59c3
Updated FFIClient with the correct FfiRequest class name based on upd…
ashkan-saeedi-mazdeh Dec 24, 2023
496618c
Added metas.
ashkan-saeedi-mazdeh Dec 27, 2023
830ebd1
modification trying to fix compiler errors
cdga777 Dec 27, 2023
eca1cb5
new initialize call
markgrossnickle Dec 27, 2023
6456edc
Test sending data
markgrossnickle Dec 28, 2023
511ef58
Hack for now
markgrossnickle Dec 28, 2023
72b2a83
Merge pull request #7 from markgrossnickle/fixcompilererror-cdga777
cdga777 Dec 28, 2023
892407a
to prevent null reference
cdga777 Dec 28, 2023
54bcdfa
Merge pull request #6 from decentraland/fixcompilererror-cdga777
markgrossnickle Dec 28, 2023
a5a63c4
minor cleanup
markgrossnickle Dec 28, 2023
a400ec9
enable nullables
NickKhalow Jan 18, 2024
d15025a
Merge pull request #15 from decentraland/feat/nullables
NickKhalow Jan 18, 2024
768fb01
Multithread refactor (#13)
markgrossnickle Jan 24, 2024
2d7c0f6
feat: optimisations (#16)
NickKhalow Jan 25, 2024
f54abcd
m1 support (#17)
NickKhalow Jan 31, 2024
968ebfa
todos
NickKhalow Feb 1, 2024
f5dca6c
feat: optimisation - memory pooling, FfiHandles (#18)
NickKhalow Feb 2, 2024
f214f8a
Merge remote-tracking branch 'origin/main'
NickKhalow Feb 2, 2024
f641f02
room support spans
NickKhalow Feb 2, 2024
1e760ce
obsolete message
NickKhalow Feb 2, 2024
ad1b226
todo shared_ptr + readonly span<byte>
NickKhalow Feb 2, 2024
1645aac
remove redundant hierarchies
NickKhalow Feb 5, 2024
a90b5eb
participants hub
NickKhalow Feb 5, 2024
732c690
fix remove
NickKhalow Feb 5, 2024
c00d313
refactor extensions
NickKhalow Feb 5, 2024
683d155
tracks factory
NickKhalow Feb 5, 2024
db557e5
FfiHandle factory
NickKhalow Feb 5, 2024
67a57a8
ffi handle factory dependency
NickKhalow Feb 5, 2024
6b357ae
participant factory
NickKhalow Feb 5, 2024
ffadd26
TrackPublication Factory
NickKhalow Feb 5, 2024
dd15a81
encapsulate ITrackPublicationFactory
NickKhalow Feb 5, 2024
a99c97b
fix naming
NickKhalow Feb 5, 2024
0881c08
fix naming
NickKhalow Feb 5, 2024
6bd701d
RingBuffer recycling
NickKhalow Feb 6, 2024
0ea6de8
Merge pull request #19 from decentraland/feat/room-optimisation
mikhail-dcl Feb 7, 2024
375276d
destination sids add for send data
NickKhalow Feb 7, 2024
e27f50b
Merge pull request #20 from decentraland/feat/room-contract
mikhail-dcl Feb 7, 2024
93b69cf
ring buffer as struct
NickKhalow Feb 8, 2024
57a6e35
package info (#22)
NickKhalow Feb 9, 2024
814b015
chore: room (#23)
NickKhalow Feb 9, 2024
124996d
fix disposing on disconnect (#24)
NickKhalow Feb 12, 2024
1f133dd
initialize control from Interface (#25)
NickKhalow Feb 12, 2024
a5f5db7
dangerous access for memory buffer (#26)
NickKhalow Feb 13, 2024
bfdd4ad
Merge pull request #21 from decentraland/feat/ringbuffer-alloc-free
mikhail-dcl Feb 14, 2024
36b76d5
remove finished todo (#27)
NickKhalow Feb 16, 2024
fab6942
win x86_64 libs
NickKhalow Feb 20, 2024
9e18361
fix InitializeSdk (#28)
NickKhalow Feb 20, 2024
03202af
datapipe contracts (#30)
NickKhalow Feb 26, 2024
bf3e7a6
hotfix no-livekit mode (#31)
NickKhalow Feb 29, 2024
985eb1e
feat: Audio/Video Support (#29)
markgrossnickle Mar 6, 2024
1059e74
feat: room contracts (#33)
NickKhalow Mar 21, 2024
2b8157a
feat: clears (#34)
NickKhalow Mar 21, 2024
7bb6841
update local metadata
NickKhalow Mar 21, 2024
4158a6f
lk debug verbose
NickKhalow Mar 21, 2024
bf5b04f
verbose async id
NickKhalow Mar 21, 2024
1e6a0a6
room info with connection state
NickKhalow Mar 22, 2024
404f96e
disconnect async
NickKhalow Mar 22, 2024
cc64cb4
performance improve: remove SynchronizationContext
NickKhalow Mar 23, 2024
1c03523
single binary for mac
NickKhalow Apr 5, 2024
593d34d
remove EditorApplication.quitting
NickKhalow Apr 8, 2024
0aa0bb3
already disposed check
NickKhalow Apr 8, 2024
33d5d9b
Catch DllNotFoundException on initialization
mikhail-dcl Apr 9, 2024
da64c14
Add Library for Linux
mikhail-dcl Apr 9, 2024
1424412
Upgrade SDK to 0.7.2 (API v2)
mikhail-dcl Aug 9, 2024
f5b6fbc
Keep only one copy of headers, remove arm64
mikhail-dcl Aug 12, 2024
77fdfec
update ffi for mac to v0.7.2
NickKhalow Aug 13, 2024
61ec412
Handle LocalMetadata and LocalName correctly
mikhail-dcl Aug 14, 2024
c4211b6
propagate ConnectionQuality to Participant
NickKhalow Aug 16, 2024
0186b8d
Fix ParticipantMetadataChanged
mikhail-dcl Oct 1, 2024
8c3fe36
expose sid event
NickKhalow Feb 14, 2025
9a68988
videostream support
NickKhalow Mar 13, 2025
2ce306e
free streams
NickKhalow Mar 13, 2025
e62c9ed
VideoStream texture dispose
NickKhalow Mar 13, 2025
ca92539
bgra support
NickKhalow Mar 14, 2025
abf7dc8
release link VideoStreams
NickKhalow Mar 17, 2025
c560d20
fix handle
NickKhalow Apr 14, 2025
d2c940c
ffi exception safe wrap
NickKhalow Apr 16, 2025
f3b0668
audio streams
NickKhalow Apr 17, 2025
99b9df4
AudioRemixConveyor, remove creation of thread per stream
NickKhalow Apr 17, 2025
a3d04b4
meta fix
NickKhalow Apr 17, 2025
af192a4
Now the topic is sent too in the Notification of the data pipe
QThund May 23, 2025
8d05bfc
Merge pull request #36 from decentraland/feature/adding-topic-support
QThund May 23, 2025
264403a
feat: add IAudioTrack to create tracks + refactor AudioSource (#35)
fcolarich May 26, 2025
0c104ad
small tweak to AudioStream Dispose logic to avoid error when Freeing …
fcolarich May 27, 2025
8cda12d
Fixes for AudioFrame disposal
fcolarich Jun 6, 2025
0c733fa
feat: update livekit version (#38)
NickKhalow Jul 8, 2025
ff71e45
feat: voice chat improvements (#37)
fcolarich Jul 8, 2025
596c41c
expose error message on Connect method
NickKhalow Jul 16, 2025
840b099
Added missing local track subscription event to room which caused Arg…
fcolarich Jul 16, 2025
843d261
support APM
NickKhalow Jul 25, 2025
aec228e
integrate apm module with example
NickKhalow Jul 28, 2025
51f42e9
migrate rtc location
NickKhalow Jul 28, 2025
f62a4e3
borrow handle
NickKhalow Jul 28, 2025
4d3ded3
connection operation with result type
NickKhalow Jul 28, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/downloads~/*
**/.DS_Store
7 changes: 7 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\C:\\Users\\ashka\\Source\\Repos\\client-sdk-unity",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/client-sdk-unity/v17/.wsuo
Binary file not shown.
11 changes: 8 additions & 3 deletions BuildScripts~/generate_proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ OUT_CSHARP=../Runtime/Scripts/Proto
protoc \
-I=$FFI_PROTOCOL \
--csharp_out=$OUT_CSHARP \
$FFI_PROTOCOL/audio_frame.proto \
$FFI_PROTOCOL/ffi.proto \
$FFI_PROTOCOL/handle.proto \
$FFI_PROTOCOL/participant.proto \
$FFI_PROTOCOL/room.proto \
$FFI_PROTOCOL/track.proto \
$FFI_PROTOCOL/video_frame.proto
$FFI_PROTOCOL/track_publication.proto \
$FFI_PROTOCOL/participant.proto \
$FFI_PROTOCOL/video_frame.proto \
$FFI_PROTOCOL/audio_frame.proto \
$FFI_PROTOCOL/e2ee.proto \
$FFI_PROTOCOL/stats.proto \
$FFI_PROTOCOL/rpc.proto \
$FFI_PROTOCOL/data_stream.proto
2 changes: 1 addition & 1 deletion Runtime/Plugins/arm64.meta → Examples.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions Examples/ExampleRoom.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Threading;
using Cysharp.Threading.Tasks;
using LiveKit.Audio;
using LiveKit.Proto;
using LiveKit.Rooms;
using LiveKit.Rooms.Participants;
using LiveKit.Rooms.Streaming.Audio;
using UnityEngine.SceneManagement;

public class ExampleRoom : MonoBehaviour
{
private Room? m_Room;
private MicrophoneRtcAudioSource? microphoneSource;

private readonly Dictionary<IAudioStream, LivekitAudioSource> sourcesMap = new();

public Button DisconnectButton;

private void Start()
{
StartAsync().Forget();
}

private void Update()
{
foreach (var remoteParticipantIdentity in m_Room.Participants.RemoteParticipantIdentities())
{
var participant = m_Room.Participants.RemoteParticipant(remoteParticipantIdentity)!;
foreach (var (key, value) in participant.Tracks)
{
var track = m_Room.AudioStreams.ActiveStream(remoteParticipantIdentity, key!);
if (track != null)
{
if (track.TryGetTarget(out var audioStream))
{
if (sourcesMap.ContainsKey(audioStream) == false)
{
var livekitAudioSource = LivekitAudioSource.New(true);
livekitAudioSource.Construct(track);
livekitAudioSource.Play();
Debug.Log($"Participant {remoteParticipantIdentity} added track {key}");
sourcesMap[audioStream] = livekitAudioSource;
}
}
}
}
}
}

private async UniTaskVoid StartAsync()
{
// New Room must be called when WebGL assembly is loaded
m_Room = new Room();

// Setup the callbacks before connecting to the Room
m_Room.Participants.UpdatesFromParticipant += (p, update) =>
{
if (update == UpdateFromParticipant.Connected)
Debug.Log($"Participant connected: {p.Sid}");
};

var c = await m_Room.ConnectAsync(JoinMenu.LivekitURL, JoinMenu.RoomToken, CancellationToken.None, true);

if (c.Success == false)
{
Debug.Log($"Failed to connect to the room !: {c.ErrorMessage}");
return;
}

Debug.Log("Connected to the room");

DisconnectButton.onClick.AddListener(() =>
{
m_Room.DisconnectAsync(CancellationToken.None);
SceneManager.LoadScene("JoinScene", LoadSceneMode.Single);
});

// Microphone usage
var sourceResult = MicrophoneRtcAudioSource.New();
if (sourceResult.Success == false)
{
Debug.LogError($"Cannot create microphone source: {sourceResult.ErrorMessage}");
return;
}

microphoneSource = sourceResult.Value;
microphoneSource.Start();

var myTrack = m_Room.AudioTracks.CreateAudioTrack("own", microphoneSource);
var trackOptions = new TrackPublishOptions
{
AudioEncoding = new AudioEncoding
{
MaxBitrate = 124000
},
Source = TrackSource.SourceMicrophone
};
var publishTask = m_Room.Participants.LocalParticipant()
.PublishTrack(myTrack, trackOptions, CancellationToken.None);
await UniTask.WaitUntil(() => publishTask.IsDone);
Debug.Log("Init finished");
}

private void OnDestroy()
{
m_Room?.DisconnectAsync(CancellationToken.None);
microphoneSource?.Dispose();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions Examples/JoinMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class JoinMenu : MonoBehaviour
{
public static string LivekitURL { get; private set; }
public static string RoomToken { get; private set; }

public RawImage PreviewCamera;
public InputField URLField;
public InputField TokenField;
public Button ConnectButton;

void Start()
{
if (PlayerPrefs.HasKey(nameof(LivekitURL)))
{
URLField.text = PlayerPrefs.GetString(nameof(LivekitURL));
}

if (PlayerPrefs.HasKey(nameof(RoomToken)))
{
TokenField.text = PlayerPrefs.GetString(nameof(RoomToken));
}

StartCoroutine(StartPreviewCamera());

ConnectButton.onClick.AddListener(() =>
{
PlayerPrefs.SetString(nameof(LivekitURL), URLField.text);
PlayerPrefs.SetString(nameof(RoomToken), TokenField.text);

LivekitURL = URLField.text;
RoomToken = TokenField.text;

if (string.IsNullOrWhiteSpace(RoomToken))
return;

SceneManager.LoadScene("RoomScene", LoadSceneMode.Single);
});
}

private IEnumerator StartPreviewCamera()
{
Debug.LogError("Preview camera is not supported");
yield break;
}
}
11 changes: 11 additions & 0 deletions Examples/JoinMenu.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading