Skip to content

Commit 6f685b3

Browse files
Send SDK override and version to FFI (#291)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent fc91503 commit 6f685b3

23 files changed

+1705
-1128
lines changed

livekit-rtc/generate_proto.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ protoc \
3333
$FFI_PROTOCOL/track.proto \
3434
$FFI_PROTOCOL/video_frame.proto \
3535
$FFI_PROTOCOL/e2ee.proto \
36-
$FFI_PROTOCOL/stats.proto
36+
$FFI_PROTOCOL/stats.proto \
37+
$FFI_PROTOCOL/rpc.proto
3738

3839
touch -a "$FFI_OUT_PYTHON/__init__.py"
3940

4041
for f in "$FFI_OUT_PYTHON"/*.py "$FFI_OUT_PYTHON"/*.pyi; do
41-
perl -i -pe 's|^(import (audio_frame_pb2\|ffi_pb2\|handle_pb2\|participant_pb2\|room_pb2\|track_pb2\|video_frame_pb2\|e2ee_pb2\|stats_pb2))|from . $1|g' "$f"
42+
perl -i -pe 's|^(import (audio_frame_pb2\|ffi_pb2\|handle_pb2\|participant_pb2\|room_pb2\|track_pb2\|video_frame_pb2\|e2ee_pb2\|stats_pb2\|rpc_pb2))|from . $1|g' "$f"
4243
done

livekit-rtc/livekit/rtc/_ffi_client.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from contextlib import ExitStack
1919
import ctypes
2020
import importlib.resources
21+
from .version import __version__
2122
import logging
2223
import os
2324
import platform
@@ -61,7 +62,12 @@ def get_ffi_lib():
6162
ffi_cb_fnc = ctypes.CFUNCTYPE(None, ctypes.POINTER(ctypes.c_uint8), ctypes.c_size_t)
6263

6364
# C function types
64-
ffi_lib.livekit_ffi_initialize.argtypes = [ffi_cb_fnc, ctypes.c_bool]
65+
ffi_lib.livekit_ffi_initialize.argtypes = [
66+
ffi_cb_fnc,
67+
ctypes.c_bool,
68+
ctypes.c_char_p,
69+
ctypes.c_char_p,
70+
]
6571

6672
ffi_lib.livekit_ffi_request.argtypes = [
6773
ctypes.POINTER(ctypes.c_ubyte),
@@ -205,7 +211,9 @@ def __init__(self) -> None:
205211
self._lock = threading.RLock()
206212
self._queue = FfiQueue[proto_ffi.FfiEvent]()
207213

208-
ffi_lib.livekit_ffi_initialize(ffi_event_callback, True)
214+
ffi_lib.livekit_ffi_initialize(
215+
ffi_event_callback, True, b"python", __version__.encode("ascii")
216+
)
209217

210218
@atexit.register
211219
def _dispose_lk_ffi():

livekit-rtc/livekit/rtc/_proto/audio_frame_pb2.py

Lines changed: 76 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-rtc/livekit/rtc/_proto/audio_frame_pb2.pyi

Lines changed: 71 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-rtc/livekit/rtc/_proto/e2ee_pb2.py

Lines changed: 53 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-rtc/livekit/rtc/_proto/e2ee_pb2.pyi

Lines changed: 50 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)