Skip to content

Commit

Permalink
fix: data coming from a server sdk (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Oct 2, 2023
1 parent 6c64578 commit 9cc66a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion livekit/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,16 @@ def _on_room_event(self, event: proto_room.RoomEvent):
self.emit('connection_quality_changed',
participant, event.connection_quality_changed.quality)
elif which == 'data_received':
rparticipant = self.participants[event.data_received.participant_sid]
owned_buffer_info = event.data_received.data
buffer_info = owned_buffer_info.data
native_data = ctypes.cast(buffer_info.data_ptr,
ctypes.POINTER(ctypes.c_byte
* buffer_info.data_len)).contents

data = bytearray(native_data)
FfiHandle(owned_buffer_info.handle.id)
if event.data_received.participant_sid:
rparticipant = self.participants[event.data_received.participant_sid]
self.emit('data_received', data,
event.data_received.kind, rparticipant)
elif which == 'e2ee_state_changed':
Expand Down

0 comments on commit 9cc66a0

Please sign in to comment.