Skip to content

Commit

Permalink
update ffi protocol to v0.4.7 (#31)
Browse files Browse the repository at this point in the history
* update ffi protocol.

* update ffi binaries.

* update.

* new file NOTICE.meta.

* update.

* update lfs tracking list.
  • Loading branch information
cloudwebrtc authored Apr 19, 2024
1 parent 0a3868d commit c3073f7
Show file tree
Hide file tree
Showing 16 changed files with 906 additions and 316 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Runtime/Plugins/ffi-macos-arm64/liblivekit_ffi.dylib filter=lfs diff=lfs merge=l
Runtime/Plugins/ffi-macos-x86_64/liblivekit_ffi.dylib filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/ffi-linux-arm64/liblivekit_ffi.so filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/ffi-linux-x86_64/liblivekit_ffi.so filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/ffi-windows-x86_64/liblivekit_ffi.dll filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/ffi-windows-arm64/liblivekit_ffi.dll filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/ffi-windows-x86_64/livekit_ffi.dll filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/ffi-windows-arm64/livekit_ffi.dll filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/Google.Protobuf.dll filter=lfs diff=lfs merge=lfs -text
Runtime/Plugins/System.Runtime.CompilerServices.Unsafe.dll filter=lfs diff=lfs merge=lfs -text
7 changes: 7 additions & 0 deletions NOTICE.meta

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

4 changes: 2 additions & 2 deletions Runtime/Plugins/ffi-android-arm64/liblivekit_ffi.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions Runtime/Plugins/ffi-android-armv7/liblivekit_ffi.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions Runtime/Plugins/ffi-android-x86_64/liblivekit_ffi.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions Runtime/Plugins/ffi-linux-arm64/liblivekit_ffi.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions Runtime/Plugins/ffi-linux-x86_64/liblivekit_ffi.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions Runtime/Plugins/ffi-macos-arm64/liblivekit_ffi.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions Runtime/Plugins/ffi-macos-x86_64/liblivekit_ffi.dylib
Git LFS file not shown
Binary file modified Runtime/Plugins/ffi-windows-arm64/livekit_ffi.dll
Binary file not shown.
Binary file modified Runtime/Plugins/ffi-windows-x86_64/livekit_ffi.dll
Binary file not shown.
1,136 changes: 853 additions & 283 deletions Runtime/Scripts/Proto/Room.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Runtime/Scripts/Proto/Stats.cs

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

11 changes: 2 additions & 9 deletions Runtime/Scripts/Proto/Track.cs

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

32 changes: 26 additions & 6 deletions Runtime/Scripts/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public class Room
public delegate void SpeakersChangeDelegate(List<Participant> speakers);
public delegate void ConnectionQualityChangeDelegate(ConnectionQuality quality, Participant participant);
public delegate void DataDelegate(byte[] data, Participant participant, DataPacketKind kind, string topic);
public delegate void SipDtmfDelegate(Participant participant, UInt32 code, string digit);
public delegate void ConnectionStateChangeDelegate(ConnectionState connectionState);
public delegate void ConnectionDelegate(Room room);
public delegate void E2EeStateChangedDelegate(Participant participant, EncryptionState state);
Expand All @@ -146,6 +147,7 @@ public class Room
public event SpeakersChangeDelegate ActiveSpeakersChanged;
public event ConnectionQualityChangeDelegate ConnectionQualityChanged;
public event DataDelegate DataReceived;
public event SipDtmfDelegate SipDtmfReceived;
public event ConnectionStateChangeDelegate ConnectionStateChanged;
public event ConnectionDelegate Connected;
public event ConnectionDelegate Disconnected;
Expand Down Expand Up @@ -338,13 +340,31 @@ internal void OnEventReceived(RoomEvent e)
ConnectionQualityChanged?.Invoke(quality, participant);
}
break;
case RoomEvent.MessageOneofCase.DataReceived:
case RoomEvent.MessageOneofCase.DataPacketReceived:
{
var dataInfo = e.DataReceived;
var data = new byte[dataInfo.Data.Data.DataLen];
Marshal.Copy((IntPtr)dataInfo.Data.Data.DataPtr, data, 0, data.Length);
var participant = GetParticipant(e.DataReceived.ParticipantSid);
DataReceived?.Invoke(data, participant, dataInfo.Kind, dataInfo.Topic);
var valueType = e.DataPacketReceived.ValueCase;
switch(valueType)
{
case DataPacketReceived.ValueOneofCase.None:
//do nothing.
break;
case DataPacketReceived.ValueOneofCase.User:
{
var dataInfo = e.DataPacketReceived.User;
var data = new byte[dataInfo.Data.Data.DataLen];
Marshal.Copy((IntPtr)dataInfo.Data.Data.DataPtr, data, 0, data.Length);
var participant = GetParticipant(e.DataPacketReceived.ParticipantSid);
DataReceived?.Invoke(data, participant, e.DataPacketReceived.Kind, dataInfo.Topic);
}
break;
case DataPacketReceived.ValueOneofCase.SipDtmf:
{
var dtmfInfo = e.DataPacketReceived.SipDtmf;
var participant = GetParticipant(e.DataPacketReceived.ParticipantSid);
SipDtmfReceived?.Invoke(participant, dtmfInfo.Code, dtmfInfo.Digit);
}
break;
}
}
break;
case RoomEvent.MessageOneofCase.ConnectionStateChanged:
Expand Down
2 changes: 1 addition & 1 deletion client-sdk-rust~

0 comments on commit c3073f7

Please sign in to comment.