diff --git a/.gitattributes b/.gitattributes index 52b735b3..9b4c18b0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ **/*.dll filter=lfs diff=lfs merge=lfs -text **/*.so filter=lfs diff=lfs merge=lfs -text **/*.dylib filter=lfs diff=lfs merge=lfs -text +**/*.jpg filter=lfs diff=lfs merge=lfs -text livekit-protocol/livekit/protocol/** linguist-generated=true livekit-rtc/livekit/rtc/_proto/** linguist-generated=true diff --git a/examples/data-streams/data_streams.py b/examples/data-streams/data_streams.py new file mode 100644 index 00000000..e9f483ca --- /dev/null +++ b/examples/data-streams/data_streams.py @@ -0,0 +1,104 @@ +import os +import logging +import asyncio +from signal import SIGINT, SIGTERM +from livekit import rtc + +# Set the following environment variables with your own values +TOKEN = os.environ.get("LIVEKIT_TOKEN") +URL = os.environ.get("LIVEKIT_URL") + + +async def main(room: rtc.Room): + logging.basicConfig(level=logging.INFO) + logger = logging.getLogger(__name__) + + async def greetParticipant(identity: str): + text_writer = await room.local_participant.stream_text( + destination_identities=[identity], topic="chat" + ) + for char in "Hi! Just a friendly message": + await text_writer.write(char) + await text_writer.aclose() + + await room.local_participant.send_file( + "./green_tree_python.jpg", + destination_identities=[identity], + topic="welcome", + ) + + async def on_chat_message_received( + reader: rtc.TextStreamReader, participant_identity: str + ): + full_text = await reader.read_all() + logger.info( + "Received chat message from %s: '%s'", participant_identity, full_text + ) + + async def on_welcome_image_received( + reader: rtc.ByteStreamReader, participant_identity: str + ): + logger.info( + "Received image from %s: '%s'", participant_identity, reader.info["name"] + ) + with open(reader.info["name"], mode="wb") as f: + async for chunk in reader: + f.write(chunk) + + f.close() + + @room.on("participant_connected") + def on_participant_connected(participant: rtc.RemoteParticipant): + logger.info( + "participant connected: %s %s", participant.sid, participant.identity + ) + asyncio.create_task(greetParticipant(participant.identity)) + + room.set_text_stream_handler( + lambda reader, participant_identity: asyncio.create_task( + on_chat_message_received(reader, participant_identity) + ), + "chat", + ) + + room.set_byte_stream_handler( + lambda reader, participant_identity: asyncio.create_task( + on_welcome_image_received(reader, participant_identity) + ), + "welcome", + ) + + # By default, autosubscribe is enabled. The participant will be subscribed to + # all published tracks in the room + await room.connect(URL, TOKEN) + logger.info("connected to room %s", room.name) + + for identity, participant in room.remote_participants.items(): + logger.info("Sending a welcome message to %s", identity) + await greetParticipant(participant.identity) + + +if __name__ == "__main__": + logging.basicConfig( + level=logging.INFO, + handlers=[ + logging.FileHandler("data_stream_example.log"), + logging.StreamHandler(), + ], + ) + + loop = asyncio.get_event_loop() + room = rtc.Room(loop=loop) + + async def cleanup(): + await room.disconnect() + loop.stop() + + asyncio.ensure_future(main(room)) + for signal in [SIGINT, SIGTERM]: + loop.add_signal_handler(signal, lambda: asyncio.ensure_future(cleanup())) + + try: + loop.run_forever() + finally: + loop.close() diff --git a/examples/data-streams/green_tree_python.jpg b/examples/data-streams/green_tree_python.jpg new file mode 100644 index 00000000..9c49df47 --- /dev/null +++ b/examples/data-streams/green_tree_python.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a27eb74910a778fa47ae2c5ac9b0fda51b3c9f7dd26762f071b75f92da0efd3d +size 2627889 diff --git a/livekit-rtc/livekit/rtc/__init__.py b/livekit-rtc/livekit/rtc/__init__.py index b6784af7..7aadbb4f 100644 --- a/livekit-rtc/livekit/rtc/__init__.py +++ b/livekit-rtc/livekit/rtc/__init__.py @@ -74,6 +74,15 @@ from .utils import combine_audio_frames from .rpc import RpcError, RpcInvocationData from .synchronizer import AVSynchronizer +from .data_stream import ( + TextStreamInfo, + TextStreamUpdate, + ByteStreamInfo, + TextStreamReader, + TextStreamWriter, + ByteStreamWriter, + ByteStreamReader, +) __all__ = [ "ConnectionQuality", @@ -140,5 +149,12 @@ "EventEmitter", "combine_audio_frames", "AVSynchronizer", + "TextStreamUpdate", + "TextStreamInfo", + "ByteStreamInfo", + "TextStreamReader", + "TextStreamWriter", + "ByteStreamReader", + "ByteStreamWriter", "__version__", ] diff --git a/livekit-rtc/livekit/rtc/_proto/ffi_pb2.py b/livekit-rtc/livekit/rtc/_proto/ffi_pb2.py index 5cc9e307..02b0fd70 100644 --- a/livekit-rtc/livekit/rtc/_proto/ffi_pb2.py +++ b/livekit-rtc/livekit/rtc/_proto/ffi_pb2.py @@ -21,7 +21,7 @@ from . import rpc_pb2 as rpc__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tffi.proto\x12\rlivekit.proto\x1a\ne2ee.proto\x1a\x0btrack.proto\x1a\x17track_publication.proto\x1a\nroom.proto\x1a\x11video_frame.proto\x1a\x11\x61udio_frame.proto\x1a\trpc.proto\"\xf7\x16\n\nFfiRequest\x12\x30\n\x07\x64ispose\x18\x02 \x01(\x0b\x32\x1d.livekit.proto.DisposeRequestH\x00\x12\x30\n\x07\x63onnect\x18\x03 \x01(\x0b\x32\x1d.livekit.proto.ConnectRequestH\x00\x12\x36\n\ndisconnect\x18\x04 \x01(\x0b\x32 .livekit.proto.DisconnectRequestH\x00\x12;\n\rpublish_track\x18\x05 \x01(\x0b\x32\".livekit.proto.PublishTrackRequestH\x00\x12?\n\x0funpublish_track\x18\x06 \x01(\x0b\x32$.livekit.proto.UnpublishTrackRequestH\x00\x12\x39\n\x0cpublish_data\x18\x07 \x01(\x0b\x32!.livekit.proto.PublishDataRequestH\x00\x12=\n\x0eset_subscribed\x18\x08 \x01(\x0b\x32#.livekit.proto.SetSubscribedRequestH\x00\x12\x44\n\x12set_local_metadata\x18\t \x01(\x0b\x32&.livekit.proto.SetLocalMetadataRequestH\x00\x12<\n\x0eset_local_name\x18\n \x01(\x0b\x32\".livekit.proto.SetLocalNameRequestH\x00\x12H\n\x14set_local_attributes\x18\x0b \x01(\x0b\x32(.livekit.proto.SetLocalAttributesRequestH\x00\x12\x42\n\x11get_session_stats\x18\x0c \x01(\x0b\x32%.livekit.proto.GetSessionStatsRequestH\x00\x12K\n\x15publish_transcription\x18\r \x01(\x0b\x32*.livekit.proto.PublishTranscriptionRequestH\x00\x12@\n\x10publish_sip_dtmf\x18\x0e \x01(\x0b\x32$.livekit.proto.PublishSipDtmfRequestH\x00\x12\x44\n\x12\x63reate_video_track\x18\x0f \x01(\x0b\x32&.livekit.proto.CreateVideoTrackRequestH\x00\x12\x44\n\x12\x63reate_audio_track\x18\x10 \x01(\x0b\x32&.livekit.proto.CreateAudioTrackRequestH\x00\x12@\n\x10local_track_mute\x18\x11 \x01(\x0b\x32$.livekit.proto.LocalTrackMuteRequestH\x00\x12\x46\n\x13\x65nable_remote_track\x18\x12 \x01(\x0b\x32\'.livekit.proto.EnableRemoteTrackRequestH\x00\x12\x33\n\tget_stats\x18\x13 \x01(\x0b\x32\x1e.livekit.proto.GetStatsRequestH\x00\x12@\n\x10new_video_stream\x18\x14 \x01(\x0b\x32$.livekit.proto.NewVideoStreamRequestH\x00\x12@\n\x10new_video_source\x18\x15 \x01(\x0b\x32$.livekit.proto.NewVideoSourceRequestH\x00\x12\x46\n\x13\x63\x61pture_video_frame\x18\x16 \x01(\x0b\x32\'.livekit.proto.CaptureVideoFrameRequestH\x00\x12;\n\rvideo_convert\x18\x17 \x01(\x0b\x32\".livekit.proto.VideoConvertRequestH\x00\x12Y\n\x1dvideo_stream_from_participant\x18\x18 \x01(\x0b\x32\x30.livekit.proto.VideoStreamFromParticipantRequestH\x00\x12@\n\x10new_audio_stream\x18\x19 \x01(\x0b\x32$.livekit.proto.NewAudioStreamRequestH\x00\x12@\n\x10new_audio_source\x18\x1a \x01(\x0b\x32$.livekit.proto.NewAudioSourceRequestH\x00\x12\x46\n\x13\x63\x61pture_audio_frame\x18\x1b \x01(\x0b\x32\'.livekit.proto.CaptureAudioFrameRequestH\x00\x12\x44\n\x12\x63lear_audio_buffer\x18\x1c \x01(\x0b\x32&.livekit.proto.ClearAudioBufferRequestH\x00\x12\x46\n\x13new_audio_resampler\x18\x1d \x01(\x0b\x32\'.livekit.proto.NewAudioResamplerRequestH\x00\x12\x44\n\x12remix_and_resample\x18\x1e \x01(\x0b\x32&.livekit.proto.RemixAndResampleRequestH\x00\x12*\n\x04\x65\x32\x65\x65\x18\x1f \x01(\x0b\x32\x1a.livekit.proto.E2eeRequestH\x00\x12Y\n\x1d\x61udio_stream_from_participant\x18 \x01(\x0b\x32\x30.livekit.proto.AudioStreamFromParticipantRequestH\x00\x12\x42\n\x11new_sox_resampler\x18! \x01(\x0b\x32%.livekit.proto.NewSoxResamplerRequestH\x00\x12\x44\n\x12push_sox_resampler\x18\" \x01(\x0b\x32&.livekit.proto.PushSoxResamplerRequestH\x00\x12\x46\n\x13\x66lush_sox_resampler\x18# \x01(\x0b\x32\'.livekit.proto.FlushSoxResamplerRequestH\x00\x12\x42\n\x11send_chat_message\x18$ \x01(\x0b\x32%.livekit.proto.SendChatMessageRequestH\x00\x12\x42\n\x11\x65\x64it_chat_message\x18% \x01(\x0b\x32%.livekit.proto.EditChatMessageRequestH\x00\x12\x37\n\x0bperform_rpc\x18& \x01(\x0b\x32 .livekit.proto.PerformRpcRequestH\x00\x12\x46\n\x13register_rpc_method\x18\' \x01(\x0b\x32\'.livekit.proto.RegisterRpcMethodRequestH\x00\x12J\n\x15unregister_rpc_method\x18( \x01(\x0b\x32).livekit.proto.UnregisterRpcMethodRequestH\x00\x12[\n\x1erpc_method_invocation_response\x18) \x01(\x0b\x32\x31.livekit.proto.RpcMethodInvocationResponseRequestH\x00\x12]\n\x1f\x65nable_remote_track_publication\x18* \x01(\x0b\x32\x32.livekit.proto.EnableRemoteTrackPublicationRequestH\x00\x12p\n)update_remote_track_publication_dimension\x18+ \x01(\x0b\x32;.livekit.proto.UpdateRemoteTrackPublicationDimensionRequestH\x00\x42\t\n\x07message\"\xdd\x16\n\x0b\x46\x66iResponse\x12\x31\n\x07\x64ispose\x18\x02 \x01(\x0b\x32\x1e.livekit.proto.DisposeResponseH\x00\x12\x31\n\x07\x63onnect\x18\x03 \x01(\x0b\x32\x1e.livekit.proto.ConnectResponseH\x00\x12\x37\n\ndisconnect\x18\x04 \x01(\x0b\x32!.livekit.proto.DisconnectResponseH\x00\x12<\n\rpublish_track\x18\x05 \x01(\x0b\x32#.livekit.proto.PublishTrackResponseH\x00\x12@\n\x0funpublish_track\x18\x06 \x01(\x0b\x32%.livekit.proto.UnpublishTrackResponseH\x00\x12:\n\x0cpublish_data\x18\x07 \x01(\x0b\x32\".livekit.proto.PublishDataResponseH\x00\x12>\n\x0eset_subscribed\x18\x08 \x01(\x0b\x32$.livekit.proto.SetSubscribedResponseH\x00\x12\x45\n\x12set_local_metadata\x18\t \x01(\x0b\x32\'.livekit.proto.SetLocalMetadataResponseH\x00\x12=\n\x0eset_local_name\x18\n \x01(\x0b\x32#.livekit.proto.SetLocalNameResponseH\x00\x12I\n\x14set_local_attributes\x18\x0b \x01(\x0b\x32).livekit.proto.SetLocalAttributesResponseH\x00\x12\x43\n\x11get_session_stats\x18\x0c \x01(\x0b\x32&.livekit.proto.GetSessionStatsResponseH\x00\x12L\n\x15publish_transcription\x18\r \x01(\x0b\x32+.livekit.proto.PublishTranscriptionResponseH\x00\x12\x41\n\x10publish_sip_dtmf\x18\x0e \x01(\x0b\x32%.livekit.proto.PublishSipDtmfResponseH\x00\x12\x45\n\x12\x63reate_video_track\x18\x0f \x01(\x0b\x32\'.livekit.proto.CreateVideoTrackResponseH\x00\x12\x45\n\x12\x63reate_audio_track\x18\x10 \x01(\x0b\x32\'.livekit.proto.CreateAudioTrackResponseH\x00\x12\x41\n\x10local_track_mute\x18\x11 \x01(\x0b\x32%.livekit.proto.LocalTrackMuteResponseH\x00\x12G\n\x13\x65nable_remote_track\x18\x12 \x01(\x0b\x32(.livekit.proto.EnableRemoteTrackResponseH\x00\x12\x34\n\tget_stats\x18\x13 \x01(\x0b\x32\x1f.livekit.proto.GetStatsResponseH\x00\x12\x41\n\x10new_video_stream\x18\x14 \x01(\x0b\x32%.livekit.proto.NewVideoStreamResponseH\x00\x12\x41\n\x10new_video_source\x18\x15 \x01(\x0b\x32%.livekit.proto.NewVideoSourceResponseH\x00\x12G\n\x13\x63\x61pture_video_frame\x18\x16 \x01(\x0b\x32(.livekit.proto.CaptureVideoFrameResponseH\x00\x12<\n\rvideo_convert\x18\x17 \x01(\x0b\x32#.livekit.proto.VideoConvertResponseH\x00\x12Z\n\x1dvideo_stream_from_participant\x18\x18 \x01(\x0b\x32\x31.livekit.proto.VideoStreamFromParticipantResponseH\x00\x12\x41\n\x10new_audio_stream\x18\x19 \x01(\x0b\x32%.livekit.proto.NewAudioStreamResponseH\x00\x12\x41\n\x10new_audio_source\x18\x1a \x01(\x0b\x32%.livekit.proto.NewAudioSourceResponseH\x00\x12G\n\x13\x63\x61pture_audio_frame\x18\x1b \x01(\x0b\x32(.livekit.proto.CaptureAudioFrameResponseH\x00\x12\x45\n\x12\x63lear_audio_buffer\x18\x1c \x01(\x0b\x32\'.livekit.proto.ClearAudioBufferResponseH\x00\x12G\n\x13new_audio_resampler\x18\x1d \x01(\x0b\x32(.livekit.proto.NewAudioResamplerResponseH\x00\x12\x45\n\x12remix_and_resample\x18\x1e \x01(\x0b\x32\'.livekit.proto.RemixAndResampleResponseH\x00\x12Z\n\x1d\x61udio_stream_from_participant\x18\x1f \x01(\x0b\x32\x31.livekit.proto.AudioStreamFromParticipantResponseH\x00\x12+\n\x04\x65\x32\x65\x65\x18 \x01(\x0b\x32\x1b.livekit.proto.E2eeResponseH\x00\x12\x43\n\x11new_sox_resampler\x18! \x01(\x0b\x32&.livekit.proto.NewSoxResamplerResponseH\x00\x12\x45\n\x12push_sox_resampler\x18\" \x01(\x0b\x32\'.livekit.proto.PushSoxResamplerResponseH\x00\x12G\n\x13\x66lush_sox_resampler\x18# \x01(\x0b\x32(.livekit.proto.FlushSoxResamplerResponseH\x00\x12\x43\n\x11send_chat_message\x18$ \x01(\x0b\x32&.livekit.proto.SendChatMessageResponseH\x00\x12\x38\n\x0bperform_rpc\x18% \x01(\x0b\x32!.livekit.proto.PerformRpcResponseH\x00\x12G\n\x13register_rpc_method\x18& \x01(\x0b\x32(.livekit.proto.RegisterRpcMethodResponseH\x00\x12K\n\x15unregister_rpc_method\x18\' \x01(\x0b\x32*.livekit.proto.UnregisterRpcMethodResponseH\x00\x12\\\n\x1erpc_method_invocation_response\x18( \x01(\x0b\x32\x32.livekit.proto.RpcMethodInvocationResponseResponseH\x00\x12^\n\x1f\x65nable_remote_track_publication\x18) \x01(\x0b\x32\x33.livekit.proto.EnableRemoteTrackPublicationResponseH\x00\x12q\n)update_remote_track_publication_dimension\x18* \x01(\x0b\x32<.livekit.proto.UpdateRemoteTrackPublicationDimensionResponseH\x00\x42\t\n\x07message\"\x8a\x0b\n\x08\x46\x66iEvent\x12.\n\nroom_event\x18\x01 \x01(\x0b\x32\x18.livekit.proto.RoomEventH\x00\x12\x30\n\x0btrack_event\x18\x02 \x01(\x0b\x32\x19.livekit.proto.TrackEventH\x00\x12=\n\x12video_stream_event\x18\x03 \x01(\x0b\x32\x1f.livekit.proto.VideoStreamEventH\x00\x12=\n\x12\x61udio_stream_event\x18\x04 \x01(\x0b\x32\x1f.livekit.proto.AudioStreamEventH\x00\x12\x31\n\x07\x63onnect\x18\x05 \x01(\x0b\x32\x1e.livekit.proto.ConnectCallbackH\x00\x12\x37\n\ndisconnect\x18\x07 \x01(\x0b\x32!.livekit.proto.DisconnectCallbackH\x00\x12\x31\n\x07\x64ispose\x18\x08 \x01(\x0b\x32\x1e.livekit.proto.DisposeCallbackH\x00\x12<\n\rpublish_track\x18\t \x01(\x0b\x32#.livekit.proto.PublishTrackCallbackH\x00\x12@\n\x0funpublish_track\x18\n \x01(\x0b\x32%.livekit.proto.UnpublishTrackCallbackH\x00\x12:\n\x0cpublish_data\x18\x0b \x01(\x0b\x32\".livekit.proto.PublishDataCallbackH\x00\x12L\n\x15publish_transcription\x18\x0c \x01(\x0b\x32+.livekit.proto.PublishTranscriptionCallbackH\x00\x12G\n\x13\x63\x61pture_audio_frame\x18\r \x01(\x0b\x32(.livekit.proto.CaptureAudioFrameCallbackH\x00\x12\x45\n\x12set_local_metadata\x18\x0e \x01(\x0b\x32\'.livekit.proto.SetLocalMetadataCallbackH\x00\x12=\n\x0eset_local_name\x18\x0f \x01(\x0b\x32#.livekit.proto.SetLocalNameCallbackH\x00\x12I\n\x14set_local_attributes\x18\x10 \x01(\x0b\x32).livekit.proto.SetLocalAttributesCallbackH\x00\x12\x34\n\tget_stats\x18\x11 \x01(\x0b\x32\x1f.livekit.proto.GetStatsCallbackH\x00\x12\'\n\x04logs\x18\x12 \x01(\x0b\x32\x17.livekit.proto.LogBatchH\x00\x12\x43\n\x11get_session_stats\x18\x13 \x01(\x0b\x32&.livekit.proto.GetSessionStatsCallbackH\x00\x12%\n\x05panic\x18\x14 \x01(\x0b\x32\x14.livekit.proto.PanicH\x00\x12\x41\n\x10publish_sip_dtmf\x18\x15 \x01(\x0b\x32%.livekit.proto.PublishSipDtmfCallbackH\x00\x12>\n\x0c\x63hat_message\x18\x16 \x01(\x0b\x32&.livekit.proto.SendChatMessageCallbackH\x00\x12\x38\n\x0bperform_rpc\x18\x17 \x01(\x0b\x32!.livekit.proto.PerformRpcCallbackH\x00\x12H\n\x15rpc_method_invocation\x18\x18 \x01(\x0b\x32\'.livekit.proto.RpcMethodInvocationEventH\x00\x42\t\n\x07message\"\x1f\n\x0e\x44isposeRequest\x12\r\n\x05\x61sync\x18\x01 \x02(\x08\"#\n\x0f\x44isposeResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x01(\x04\"#\n\x0f\x44isposeCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\x85\x01\n\tLogRecord\x12&\n\x05level\x18\x01 \x02(\x0e\x32\x17.livekit.proto.LogLevel\x12\x0e\n\x06target\x18\x02 \x02(\t\x12\x13\n\x0bmodule_path\x18\x03 \x01(\t\x12\x0c\n\x04\x66ile\x18\x04 \x01(\t\x12\x0c\n\x04line\x18\x05 \x01(\r\x12\x0f\n\x07message\x18\x06 \x02(\t\"5\n\x08LogBatch\x12)\n\x07records\x18\x01 \x03(\x0b\x32\x18.livekit.proto.LogRecord\"\x18\n\x05Panic\x12\x0f\n\x07message\x18\x01 \x02(\t*S\n\x08LogLevel\x12\r\n\tLOG_ERROR\x10\x00\x12\x0c\n\x08LOG_WARN\x10\x01\x12\x0c\n\x08LOG_INFO\x10\x02\x12\r\n\tLOG_DEBUG\x10\x03\x12\r\n\tLOG_TRACE\x10\x04\x42\x10\xaa\x02\rLiveKit.Proto') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tffi.proto\x12\rlivekit.proto\x1a\ne2ee.proto\x1a\x0btrack.proto\x1a\x17track_publication.proto\x1a\nroom.proto\x1a\x11video_frame.proto\x1a\x11\x61udio_frame.proto\x1a\trpc.proto\"\xc3\x19\n\nFfiRequest\x12\x30\n\x07\x64ispose\x18\x02 \x01(\x0b\x32\x1d.livekit.proto.DisposeRequestH\x00\x12\x30\n\x07\x63onnect\x18\x03 \x01(\x0b\x32\x1d.livekit.proto.ConnectRequestH\x00\x12\x36\n\ndisconnect\x18\x04 \x01(\x0b\x32 .livekit.proto.DisconnectRequestH\x00\x12;\n\rpublish_track\x18\x05 \x01(\x0b\x32\".livekit.proto.PublishTrackRequestH\x00\x12?\n\x0funpublish_track\x18\x06 \x01(\x0b\x32$.livekit.proto.UnpublishTrackRequestH\x00\x12\x39\n\x0cpublish_data\x18\x07 \x01(\x0b\x32!.livekit.proto.PublishDataRequestH\x00\x12=\n\x0eset_subscribed\x18\x08 \x01(\x0b\x32#.livekit.proto.SetSubscribedRequestH\x00\x12\x44\n\x12set_local_metadata\x18\t \x01(\x0b\x32&.livekit.proto.SetLocalMetadataRequestH\x00\x12<\n\x0eset_local_name\x18\n \x01(\x0b\x32\".livekit.proto.SetLocalNameRequestH\x00\x12H\n\x14set_local_attributes\x18\x0b \x01(\x0b\x32(.livekit.proto.SetLocalAttributesRequestH\x00\x12\x42\n\x11get_session_stats\x18\x0c \x01(\x0b\x32%.livekit.proto.GetSessionStatsRequestH\x00\x12K\n\x15publish_transcription\x18\r \x01(\x0b\x32*.livekit.proto.PublishTranscriptionRequestH\x00\x12@\n\x10publish_sip_dtmf\x18\x0e \x01(\x0b\x32$.livekit.proto.PublishSipDtmfRequestH\x00\x12\x44\n\x12\x63reate_video_track\x18\x0f \x01(\x0b\x32&.livekit.proto.CreateVideoTrackRequestH\x00\x12\x44\n\x12\x63reate_audio_track\x18\x10 \x01(\x0b\x32&.livekit.proto.CreateAudioTrackRequestH\x00\x12@\n\x10local_track_mute\x18\x11 \x01(\x0b\x32$.livekit.proto.LocalTrackMuteRequestH\x00\x12\x46\n\x13\x65nable_remote_track\x18\x12 \x01(\x0b\x32\'.livekit.proto.EnableRemoteTrackRequestH\x00\x12\x33\n\tget_stats\x18\x13 \x01(\x0b\x32\x1e.livekit.proto.GetStatsRequestH\x00\x12@\n\x10new_video_stream\x18\x14 \x01(\x0b\x32$.livekit.proto.NewVideoStreamRequestH\x00\x12@\n\x10new_video_source\x18\x15 \x01(\x0b\x32$.livekit.proto.NewVideoSourceRequestH\x00\x12\x46\n\x13\x63\x61pture_video_frame\x18\x16 \x01(\x0b\x32\'.livekit.proto.CaptureVideoFrameRequestH\x00\x12;\n\rvideo_convert\x18\x17 \x01(\x0b\x32\".livekit.proto.VideoConvertRequestH\x00\x12Y\n\x1dvideo_stream_from_participant\x18\x18 \x01(\x0b\x32\x30.livekit.proto.VideoStreamFromParticipantRequestH\x00\x12@\n\x10new_audio_stream\x18\x19 \x01(\x0b\x32$.livekit.proto.NewAudioStreamRequestH\x00\x12@\n\x10new_audio_source\x18\x1a \x01(\x0b\x32$.livekit.proto.NewAudioSourceRequestH\x00\x12\x46\n\x13\x63\x61pture_audio_frame\x18\x1b \x01(\x0b\x32\'.livekit.proto.CaptureAudioFrameRequestH\x00\x12\x44\n\x12\x63lear_audio_buffer\x18\x1c \x01(\x0b\x32&.livekit.proto.ClearAudioBufferRequestH\x00\x12\x46\n\x13new_audio_resampler\x18\x1d \x01(\x0b\x32\'.livekit.proto.NewAudioResamplerRequestH\x00\x12\x44\n\x12remix_and_resample\x18\x1e \x01(\x0b\x32&.livekit.proto.RemixAndResampleRequestH\x00\x12*\n\x04\x65\x32\x65\x65\x18\x1f \x01(\x0b\x32\x1a.livekit.proto.E2eeRequestH\x00\x12Y\n\x1d\x61udio_stream_from_participant\x18 \x01(\x0b\x32\x30.livekit.proto.AudioStreamFromParticipantRequestH\x00\x12\x42\n\x11new_sox_resampler\x18! \x01(\x0b\x32%.livekit.proto.NewSoxResamplerRequestH\x00\x12\x44\n\x12push_sox_resampler\x18\" \x01(\x0b\x32&.livekit.proto.PushSoxResamplerRequestH\x00\x12\x46\n\x13\x66lush_sox_resampler\x18# \x01(\x0b\x32\'.livekit.proto.FlushSoxResamplerRequestH\x00\x12\x42\n\x11send_chat_message\x18$ \x01(\x0b\x32%.livekit.proto.SendChatMessageRequestH\x00\x12\x42\n\x11\x65\x64it_chat_message\x18% \x01(\x0b\x32%.livekit.proto.EditChatMessageRequestH\x00\x12\x37\n\x0bperform_rpc\x18& \x01(\x0b\x32 .livekit.proto.PerformRpcRequestH\x00\x12\x46\n\x13register_rpc_method\x18\' \x01(\x0b\x32\'.livekit.proto.RegisterRpcMethodRequestH\x00\x12J\n\x15unregister_rpc_method\x18( \x01(\x0b\x32).livekit.proto.UnregisterRpcMethodRequestH\x00\x12[\n\x1erpc_method_invocation_response\x18) \x01(\x0b\x32\x31.livekit.proto.RpcMethodInvocationResponseRequestH\x00\x12]\n\x1f\x65nable_remote_track_publication\x18* \x01(\x0b\x32\x32.livekit.proto.EnableRemoteTrackPublicationRequestH\x00\x12p\n)update_remote_track_publication_dimension\x18+ \x01(\x0b\x32;.livekit.proto.UpdateRemoteTrackPublicationDimensionRequestH\x00\x12\x44\n\x12send_stream_header\x18, \x01(\x0b\x32&.livekit.proto.SendStreamHeaderRequestH\x00\x12\x42\n\x11send_stream_chunk\x18- \x01(\x0b\x32%.livekit.proto.SendStreamChunkRequestH\x00\x12\x46\n\x13send_stream_trailer\x18. \x01(\x0b\x32\'.livekit.proto.SendStreamTrailerRequestH\x00\x12x\n.set_data_channel_buffered_amount_low_threshold\x18/ \x01(\x0b\x32>.livekit.proto.SetDataChannelBufferedAmountLowThresholdRequestH\x00\x42\t\n\x07message\"\xad\x19\n\x0b\x46\x66iResponse\x12\x31\n\x07\x64ispose\x18\x02 \x01(\x0b\x32\x1e.livekit.proto.DisposeResponseH\x00\x12\x31\n\x07\x63onnect\x18\x03 \x01(\x0b\x32\x1e.livekit.proto.ConnectResponseH\x00\x12\x37\n\ndisconnect\x18\x04 \x01(\x0b\x32!.livekit.proto.DisconnectResponseH\x00\x12<\n\rpublish_track\x18\x05 \x01(\x0b\x32#.livekit.proto.PublishTrackResponseH\x00\x12@\n\x0funpublish_track\x18\x06 \x01(\x0b\x32%.livekit.proto.UnpublishTrackResponseH\x00\x12:\n\x0cpublish_data\x18\x07 \x01(\x0b\x32\".livekit.proto.PublishDataResponseH\x00\x12>\n\x0eset_subscribed\x18\x08 \x01(\x0b\x32$.livekit.proto.SetSubscribedResponseH\x00\x12\x45\n\x12set_local_metadata\x18\t \x01(\x0b\x32\'.livekit.proto.SetLocalMetadataResponseH\x00\x12=\n\x0eset_local_name\x18\n \x01(\x0b\x32#.livekit.proto.SetLocalNameResponseH\x00\x12I\n\x14set_local_attributes\x18\x0b \x01(\x0b\x32).livekit.proto.SetLocalAttributesResponseH\x00\x12\x43\n\x11get_session_stats\x18\x0c \x01(\x0b\x32&.livekit.proto.GetSessionStatsResponseH\x00\x12L\n\x15publish_transcription\x18\r \x01(\x0b\x32+.livekit.proto.PublishTranscriptionResponseH\x00\x12\x41\n\x10publish_sip_dtmf\x18\x0e \x01(\x0b\x32%.livekit.proto.PublishSipDtmfResponseH\x00\x12\x45\n\x12\x63reate_video_track\x18\x0f \x01(\x0b\x32\'.livekit.proto.CreateVideoTrackResponseH\x00\x12\x45\n\x12\x63reate_audio_track\x18\x10 \x01(\x0b\x32\'.livekit.proto.CreateAudioTrackResponseH\x00\x12\x41\n\x10local_track_mute\x18\x11 \x01(\x0b\x32%.livekit.proto.LocalTrackMuteResponseH\x00\x12G\n\x13\x65nable_remote_track\x18\x12 \x01(\x0b\x32(.livekit.proto.EnableRemoteTrackResponseH\x00\x12\x34\n\tget_stats\x18\x13 \x01(\x0b\x32\x1f.livekit.proto.GetStatsResponseH\x00\x12\x41\n\x10new_video_stream\x18\x14 \x01(\x0b\x32%.livekit.proto.NewVideoStreamResponseH\x00\x12\x41\n\x10new_video_source\x18\x15 \x01(\x0b\x32%.livekit.proto.NewVideoSourceResponseH\x00\x12G\n\x13\x63\x61pture_video_frame\x18\x16 \x01(\x0b\x32(.livekit.proto.CaptureVideoFrameResponseH\x00\x12<\n\rvideo_convert\x18\x17 \x01(\x0b\x32#.livekit.proto.VideoConvertResponseH\x00\x12Z\n\x1dvideo_stream_from_participant\x18\x18 \x01(\x0b\x32\x31.livekit.proto.VideoStreamFromParticipantResponseH\x00\x12\x41\n\x10new_audio_stream\x18\x19 \x01(\x0b\x32%.livekit.proto.NewAudioStreamResponseH\x00\x12\x41\n\x10new_audio_source\x18\x1a \x01(\x0b\x32%.livekit.proto.NewAudioSourceResponseH\x00\x12G\n\x13\x63\x61pture_audio_frame\x18\x1b \x01(\x0b\x32(.livekit.proto.CaptureAudioFrameResponseH\x00\x12\x45\n\x12\x63lear_audio_buffer\x18\x1c \x01(\x0b\x32\'.livekit.proto.ClearAudioBufferResponseH\x00\x12G\n\x13new_audio_resampler\x18\x1d \x01(\x0b\x32(.livekit.proto.NewAudioResamplerResponseH\x00\x12\x45\n\x12remix_and_resample\x18\x1e \x01(\x0b\x32\'.livekit.proto.RemixAndResampleResponseH\x00\x12Z\n\x1d\x61udio_stream_from_participant\x18\x1f \x01(\x0b\x32\x31.livekit.proto.AudioStreamFromParticipantResponseH\x00\x12+\n\x04\x65\x32\x65\x65\x18 \x01(\x0b\x32\x1b.livekit.proto.E2eeResponseH\x00\x12\x43\n\x11new_sox_resampler\x18! \x01(\x0b\x32&.livekit.proto.NewSoxResamplerResponseH\x00\x12\x45\n\x12push_sox_resampler\x18\" \x01(\x0b\x32\'.livekit.proto.PushSoxResamplerResponseH\x00\x12G\n\x13\x66lush_sox_resampler\x18# \x01(\x0b\x32(.livekit.proto.FlushSoxResamplerResponseH\x00\x12\x43\n\x11send_chat_message\x18$ \x01(\x0b\x32&.livekit.proto.SendChatMessageResponseH\x00\x12\x38\n\x0bperform_rpc\x18% \x01(\x0b\x32!.livekit.proto.PerformRpcResponseH\x00\x12G\n\x13register_rpc_method\x18& \x01(\x0b\x32(.livekit.proto.RegisterRpcMethodResponseH\x00\x12K\n\x15unregister_rpc_method\x18\' \x01(\x0b\x32*.livekit.proto.UnregisterRpcMethodResponseH\x00\x12\\\n\x1erpc_method_invocation_response\x18( \x01(\x0b\x32\x32.livekit.proto.RpcMethodInvocationResponseResponseH\x00\x12^\n\x1f\x65nable_remote_track_publication\x18) \x01(\x0b\x32\x33.livekit.proto.EnableRemoteTrackPublicationResponseH\x00\x12q\n)update_remote_track_publication_dimension\x18* \x01(\x0b\x32<.livekit.proto.UpdateRemoteTrackPublicationDimensionResponseH\x00\x12\x45\n\x12send_stream_header\x18+ \x01(\x0b\x32\'.livekit.proto.SendStreamHeaderResponseH\x00\x12\x43\n\x11send_stream_chunk\x18, \x01(\x0b\x32&.livekit.proto.SendStreamChunkResponseH\x00\x12G\n\x13send_stream_trailer\x18- \x01(\x0b\x32(.livekit.proto.SendStreamTrailerResponseH\x00\x12y\n.set_data_channel_buffered_amount_low_threshold\x18. \x01(\x0b\x32?.livekit.proto.SetDataChannelBufferedAmountLowThresholdResponseH\x00\x42\t\n\x07message\"\xdf\x0c\n\x08\x46\x66iEvent\x12.\n\nroom_event\x18\x01 \x01(\x0b\x32\x18.livekit.proto.RoomEventH\x00\x12\x30\n\x0btrack_event\x18\x02 \x01(\x0b\x32\x19.livekit.proto.TrackEventH\x00\x12=\n\x12video_stream_event\x18\x03 \x01(\x0b\x32\x1f.livekit.proto.VideoStreamEventH\x00\x12=\n\x12\x61udio_stream_event\x18\x04 \x01(\x0b\x32\x1f.livekit.proto.AudioStreamEventH\x00\x12\x31\n\x07\x63onnect\x18\x05 \x01(\x0b\x32\x1e.livekit.proto.ConnectCallbackH\x00\x12\x37\n\ndisconnect\x18\x07 \x01(\x0b\x32!.livekit.proto.DisconnectCallbackH\x00\x12\x31\n\x07\x64ispose\x18\x08 \x01(\x0b\x32\x1e.livekit.proto.DisposeCallbackH\x00\x12<\n\rpublish_track\x18\t \x01(\x0b\x32#.livekit.proto.PublishTrackCallbackH\x00\x12@\n\x0funpublish_track\x18\n \x01(\x0b\x32%.livekit.proto.UnpublishTrackCallbackH\x00\x12:\n\x0cpublish_data\x18\x0b \x01(\x0b\x32\".livekit.proto.PublishDataCallbackH\x00\x12L\n\x15publish_transcription\x18\x0c \x01(\x0b\x32+.livekit.proto.PublishTranscriptionCallbackH\x00\x12G\n\x13\x63\x61pture_audio_frame\x18\r \x01(\x0b\x32(.livekit.proto.CaptureAudioFrameCallbackH\x00\x12\x45\n\x12set_local_metadata\x18\x0e \x01(\x0b\x32\'.livekit.proto.SetLocalMetadataCallbackH\x00\x12=\n\x0eset_local_name\x18\x0f \x01(\x0b\x32#.livekit.proto.SetLocalNameCallbackH\x00\x12I\n\x14set_local_attributes\x18\x10 \x01(\x0b\x32).livekit.proto.SetLocalAttributesCallbackH\x00\x12\x34\n\tget_stats\x18\x11 \x01(\x0b\x32\x1f.livekit.proto.GetStatsCallbackH\x00\x12\'\n\x04logs\x18\x12 \x01(\x0b\x32\x17.livekit.proto.LogBatchH\x00\x12\x43\n\x11get_session_stats\x18\x13 \x01(\x0b\x32&.livekit.proto.GetSessionStatsCallbackH\x00\x12%\n\x05panic\x18\x14 \x01(\x0b\x32\x14.livekit.proto.PanicH\x00\x12\x41\n\x10publish_sip_dtmf\x18\x15 \x01(\x0b\x32%.livekit.proto.PublishSipDtmfCallbackH\x00\x12>\n\x0c\x63hat_message\x18\x16 \x01(\x0b\x32&.livekit.proto.SendChatMessageCallbackH\x00\x12\x38\n\x0bperform_rpc\x18\x17 \x01(\x0b\x32!.livekit.proto.PerformRpcCallbackH\x00\x12H\n\x15rpc_method_invocation\x18\x18 \x01(\x0b\x32\'.livekit.proto.RpcMethodInvocationEventH\x00\x12\x45\n\x12send_stream_header\x18\x19 \x01(\x0b\x32\'.livekit.proto.SendStreamHeaderCallbackH\x00\x12\x43\n\x11send_stream_chunk\x18\x1a \x01(\x0b\x32&.livekit.proto.SendStreamChunkCallbackH\x00\x12G\n\x13send_stream_trailer\x18\x1b \x01(\x0b\x32(.livekit.proto.SendStreamTrailerCallbackH\x00\x42\t\n\x07message\"\x1f\n\x0e\x44isposeRequest\x12\r\n\x05\x61sync\x18\x01 \x02(\x08\"#\n\x0f\x44isposeResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x01(\x04\"#\n\x0f\x44isposeCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\x85\x01\n\tLogRecord\x12&\n\x05level\x18\x01 \x02(\x0e\x32\x17.livekit.proto.LogLevel\x12\x0e\n\x06target\x18\x02 \x02(\t\x12\x13\n\x0bmodule_path\x18\x03 \x01(\t\x12\x0c\n\x04\x66ile\x18\x04 \x01(\t\x12\x0c\n\x04line\x18\x05 \x01(\r\x12\x0f\n\x07message\x18\x06 \x02(\t\"5\n\x08LogBatch\x12)\n\x07records\x18\x01 \x03(\x0b\x32\x18.livekit.proto.LogRecord\"\x18\n\x05Panic\x12\x0f\n\x07message\x18\x01 \x02(\t*S\n\x08LogLevel\x12\r\n\tLOG_ERROR\x10\x00\x12\x0c\n\x08LOG_WARN\x10\x01\x12\x0c\n\x08LOG_INFO\x10\x02\x12\r\n\tLOG_DEBUG\x10\x03\x12\r\n\tLOG_TRACE\x10\x04\x42\x10\xaa\x02\rLiveKit.Proto') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -29,24 +29,24 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\252\002\rLiveKit.Proto' - _globals['_LOGLEVEL']._serialized_start=7734 - _globals['_LOGLEVEL']._serialized_end=7817 + _globals['_LOGLEVEL']._serialized_start=8615 + _globals['_LOGLEVEL']._serialized_end=8698 _globals['_FFIREQUEST']._serialized_start=140 - _globals['_FFIREQUEST']._serialized_end=3075 - _globals['_FFIRESPONSE']._serialized_start=3078 - _globals['_FFIRESPONSE']._serialized_end=5987 - _globals['_FFIEVENT']._serialized_start=5990 - _globals['_FFIEVENT']._serialized_end=7408 - _globals['_DISPOSEREQUEST']._serialized_start=7410 - _globals['_DISPOSEREQUEST']._serialized_end=7441 - _globals['_DISPOSERESPONSE']._serialized_start=7443 - _globals['_DISPOSERESPONSE']._serialized_end=7478 - _globals['_DISPOSECALLBACK']._serialized_start=7480 - _globals['_DISPOSECALLBACK']._serialized_end=7515 - _globals['_LOGRECORD']._serialized_start=7518 - _globals['_LOGRECORD']._serialized_end=7651 - _globals['_LOGBATCH']._serialized_start=7653 - _globals['_LOGBATCH']._serialized_end=7706 - _globals['_PANIC']._serialized_start=7708 - _globals['_PANIC']._serialized_end=7732 + _globals['_FFIREQUEST']._serialized_end=3407 + _globals['_FFIRESPONSE']._serialized_start=3410 + _globals['_FFIRESPONSE']._serialized_end=6655 + _globals['_FFIEVENT']._serialized_start=6658 + _globals['_FFIEVENT']._serialized_end=8289 + _globals['_DISPOSEREQUEST']._serialized_start=8291 + _globals['_DISPOSEREQUEST']._serialized_end=8322 + _globals['_DISPOSERESPONSE']._serialized_start=8324 + _globals['_DISPOSERESPONSE']._serialized_end=8359 + _globals['_DISPOSECALLBACK']._serialized_start=8361 + _globals['_DISPOSECALLBACK']._serialized_end=8396 + _globals['_LOGRECORD']._serialized_start=8399 + _globals['_LOGRECORD']._serialized_end=8532 + _globals['_LOGBATCH']._serialized_start=8534 + _globals['_LOGBATCH']._serialized_end=8587 + _globals['_PANIC']._serialized_start=8589 + _globals['_PANIC']._serialized_end=8613 # @@protoc_insertion_point(module_scope) diff --git a/livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi index 45c2e073..ed138f41 100644 --- a/livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi +++ b/livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi @@ -136,6 +136,10 @@ class FfiRequest(google.protobuf.message.Message): RPC_METHOD_INVOCATION_RESPONSE_FIELD_NUMBER: builtins.int ENABLE_REMOTE_TRACK_PUBLICATION_FIELD_NUMBER: builtins.int UPDATE_REMOTE_TRACK_PUBLICATION_DIMENSION_FIELD_NUMBER: builtins.int + SEND_STREAM_HEADER_FIELD_NUMBER: builtins.int + SEND_STREAM_CHUNK_FIELD_NUMBER: builtins.int + SEND_STREAM_TRAILER_FIELD_NUMBER: builtins.int + SET_DATA_CHANNEL_BUFFERED_AMOUNT_LOW_THRESHOLD_FIELD_NUMBER: builtins.int @property def dispose(self) -> global___DisposeRequest: ... @property @@ -232,6 +236,18 @@ class FfiRequest(google.protobuf.message.Message): @property def update_remote_track_publication_dimension(self) -> track_publication_pb2.UpdateRemoteTrackPublicationDimensionRequest: ... + @property + def send_stream_header(self) -> room_pb2.SendStreamHeaderRequest: + """Data Streams""" + + @property + def send_stream_chunk(self) -> room_pb2.SendStreamChunkRequest: ... + @property + def send_stream_trailer(self) -> room_pb2.SendStreamTrailerRequest: ... + @property + def set_data_channel_buffered_amount_low_threshold(self) -> room_pb2.SetDataChannelBufferedAmountLowThresholdRequest: + """Data Channel""" + def __init__( self, *, @@ -277,10 +293,14 @@ class FfiRequest(google.protobuf.message.Message): rpc_method_invocation_response: rpc_pb2.RpcMethodInvocationResponseRequest | None = ..., enable_remote_track_publication: track_publication_pb2.EnableRemoteTrackPublicationRequest | None = ..., update_remote_track_publication_dimension: track_publication_pb2.UpdateRemoteTrackPublicationDimensionRequest | None = ..., + send_stream_header: room_pb2.SendStreamHeaderRequest | None = ..., + send_stream_chunk: room_pb2.SendStreamChunkRequest | None = ..., + send_stream_trailer: room_pb2.SendStreamTrailerRequest | None = ..., + set_data_channel_buffered_amount_low_threshold: room_pb2.SetDataChannelBufferedAmountLowThresholdRequest | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "edit_chat_message", b"edit_chat_message", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "edit_chat_message", b"edit_chat_message", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> None: ... - def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["dispose", "connect", "disconnect", "publish_track", "unpublish_track", "publish_data", "set_subscribed", "set_local_metadata", "set_local_name", "set_local_attributes", "get_session_stats", "publish_transcription", "publish_sip_dtmf", "create_video_track", "create_audio_track", "local_track_mute", "enable_remote_track", "get_stats", "new_video_stream", "new_video_source", "capture_video_frame", "video_convert", "video_stream_from_participant", "new_audio_stream", "new_audio_source", "capture_audio_frame", "clear_audio_buffer", "new_audio_resampler", "remix_and_resample", "e2ee", "audio_stream_from_participant", "new_sox_resampler", "push_sox_resampler", "flush_sox_resampler", "send_chat_message", "edit_chat_message", "perform_rpc", "register_rpc_method", "unregister_rpc_method", "rpc_method_invocation_response", "enable_remote_track_publication", "update_remote_track_publication_dimension"] | None: ... + def HasField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "edit_chat_message", b"edit_chat_message", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "send_stream_chunk", b"send_stream_chunk", "send_stream_header", b"send_stream_header", "send_stream_trailer", b"send_stream_trailer", "set_data_channel_buffered_amount_low_threshold", b"set_data_channel_buffered_amount_low_threshold", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "edit_chat_message", b"edit_chat_message", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "send_stream_chunk", b"send_stream_chunk", "send_stream_header", b"send_stream_header", "send_stream_trailer", b"send_stream_trailer", "set_data_channel_buffered_amount_low_threshold", b"set_data_channel_buffered_amount_low_threshold", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["dispose", "connect", "disconnect", "publish_track", "unpublish_track", "publish_data", "set_subscribed", "set_local_metadata", "set_local_name", "set_local_attributes", "get_session_stats", "publish_transcription", "publish_sip_dtmf", "create_video_track", "create_audio_track", "local_track_mute", "enable_remote_track", "get_stats", "new_video_stream", "new_video_source", "capture_video_frame", "video_convert", "video_stream_from_participant", "new_audio_stream", "new_audio_source", "capture_audio_frame", "clear_audio_buffer", "new_audio_resampler", "remix_and_resample", "e2ee", "audio_stream_from_participant", "new_sox_resampler", "push_sox_resampler", "flush_sox_resampler", "send_chat_message", "edit_chat_message", "perform_rpc", "register_rpc_method", "unregister_rpc_method", "rpc_method_invocation_response", "enable_remote_track_publication", "update_remote_track_publication_dimension", "send_stream_header", "send_stream_chunk", "send_stream_trailer", "set_data_channel_buffered_amount_low_threshold"] | None: ... global___FfiRequest = FfiRequest @@ -331,6 +351,10 @@ class FfiResponse(google.protobuf.message.Message): RPC_METHOD_INVOCATION_RESPONSE_FIELD_NUMBER: builtins.int ENABLE_REMOTE_TRACK_PUBLICATION_FIELD_NUMBER: builtins.int UPDATE_REMOTE_TRACK_PUBLICATION_DIMENSION_FIELD_NUMBER: builtins.int + SEND_STREAM_HEADER_FIELD_NUMBER: builtins.int + SEND_STREAM_CHUNK_FIELD_NUMBER: builtins.int + SEND_STREAM_TRAILER_FIELD_NUMBER: builtins.int + SET_DATA_CHANNEL_BUFFERED_AMOUNT_LOW_THRESHOLD_FIELD_NUMBER: builtins.int @property def dispose(self) -> global___DisposeResponse: ... @property @@ -425,6 +449,18 @@ class FfiResponse(google.protobuf.message.Message): @property def update_remote_track_publication_dimension(self) -> track_publication_pb2.UpdateRemoteTrackPublicationDimensionResponse: ... + @property + def send_stream_header(self) -> room_pb2.SendStreamHeaderResponse: + """Data Streams""" + + @property + def send_stream_chunk(self) -> room_pb2.SendStreamChunkResponse: ... + @property + def send_stream_trailer(self) -> room_pb2.SendStreamTrailerResponse: ... + @property + def set_data_channel_buffered_amount_low_threshold(self) -> room_pb2.SetDataChannelBufferedAmountLowThresholdResponse: + """Data Channel""" + def __init__( self, *, @@ -469,10 +505,14 @@ class FfiResponse(google.protobuf.message.Message): rpc_method_invocation_response: rpc_pb2.RpcMethodInvocationResponseResponse | None = ..., enable_remote_track_publication: track_publication_pb2.EnableRemoteTrackPublicationResponse | None = ..., update_remote_track_publication_dimension: track_publication_pb2.UpdateRemoteTrackPublicationDimensionResponse | None = ..., + send_stream_header: room_pb2.SendStreamHeaderResponse | None = ..., + send_stream_chunk: room_pb2.SendStreamChunkResponse | None = ..., + send_stream_trailer: room_pb2.SendStreamTrailerResponse | None = ..., + set_data_channel_buffered_amount_low_threshold: room_pb2.SetDataChannelBufferedAmountLowThresholdResponse | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> None: ... - def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["dispose", "connect", "disconnect", "publish_track", "unpublish_track", "publish_data", "set_subscribed", "set_local_metadata", "set_local_name", "set_local_attributes", "get_session_stats", "publish_transcription", "publish_sip_dtmf", "create_video_track", "create_audio_track", "local_track_mute", "enable_remote_track", "get_stats", "new_video_stream", "new_video_source", "capture_video_frame", "video_convert", "video_stream_from_participant", "new_audio_stream", "new_audio_source", "capture_audio_frame", "clear_audio_buffer", "new_audio_resampler", "remix_and_resample", "audio_stream_from_participant", "e2ee", "new_sox_resampler", "push_sox_resampler", "flush_sox_resampler", "send_chat_message", "perform_rpc", "register_rpc_method", "unregister_rpc_method", "rpc_method_invocation_response", "enable_remote_track_publication", "update_remote_track_publication_dimension"] | None: ... + def HasField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "send_stream_chunk", b"send_stream_chunk", "send_stream_header", b"send_stream_header", "send_stream_trailer", b"send_stream_trailer", "set_data_channel_buffered_amount_low_threshold", b"set_data_channel_buffered_amount_low_threshold", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["audio_stream_from_participant", b"audio_stream_from_participant", "capture_audio_frame", b"capture_audio_frame", "capture_video_frame", b"capture_video_frame", "clear_audio_buffer", b"clear_audio_buffer", "connect", b"connect", "create_audio_track", b"create_audio_track", "create_video_track", b"create_video_track", "disconnect", b"disconnect", "dispose", b"dispose", "e2ee", b"e2ee", "enable_remote_track", b"enable_remote_track", "enable_remote_track_publication", b"enable_remote_track_publication", "flush_sox_resampler", b"flush_sox_resampler", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "local_track_mute", b"local_track_mute", "message", b"message", "new_audio_resampler", b"new_audio_resampler", "new_audio_source", b"new_audio_source", "new_audio_stream", b"new_audio_stream", "new_sox_resampler", b"new_sox_resampler", "new_video_source", b"new_video_source", "new_video_stream", b"new_video_stream", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "push_sox_resampler", b"push_sox_resampler", "register_rpc_method", b"register_rpc_method", "remix_and_resample", b"remix_and_resample", "rpc_method_invocation_response", b"rpc_method_invocation_response", "send_chat_message", b"send_chat_message", "send_stream_chunk", b"send_stream_chunk", "send_stream_header", b"send_stream_header", "send_stream_trailer", b"send_stream_trailer", "set_data_channel_buffered_amount_low_threshold", b"set_data_channel_buffered_amount_low_threshold", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "set_subscribed", b"set_subscribed", "unpublish_track", b"unpublish_track", "unregister_rpc_method", b"unregister_rpc_method", "update_remote_track_publication_dimension", b"update_remote_track_publication_dimension", "video_convert", b"video_convert", "video_stream_from_participant", b"video_stream_from_participant"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["dispose", "connect", "disconnect", "publish_track", "unpublish_track", "publish_data", "set_subscribed", "set_local_metadata", "set_local_name", "set_local_attributes", "get_session_stats", "publish_transcription", "publish_sip_dtmf", "create_video_track", "create_audio_track", "local_track_mute", "enable_remote_track", "get_stats", "new_video_stream", "new_video_source", "capture_video_frame", "video_convert", "video_stream_from_participant", "new_audio_stream", "new_audio_source", "capture_audio_frame", "clear_audio_buffer", "new_audio_resampler", "remix_and_resample", "audio_stream_from_participant", "e2ee", "new_sox_resampler", "push_sox_resampler", "flush_sox_resampler", "send_chat_message", "perform_rpc", "register_rpc_method", "unregister_rpc_method", "rpc_method_invocation_response", "enable_remote_track_publication", "update_remote_track_publication_dimension", "send_stream_header", "send_stream_chunk", "send_stream_trailer", "set_data_channel_buffered_amount_low_threshold"] | None: ... global___FfiResponse = FfiResponse @@ -508,6 +548,9 @@ class FfiEvent(google.protobuf.message.Message): CHAT_MESSAGE_FIELD_NUMBER: builtins.int PERFORM_RPC_FIELD_NUMBER: builtins.int RPC_METHOD_INVOCATION_FIELD_NUMBER: builtins.int + SEND_STREAM_HEADER_FIELD_NUMBER: builtins.int + SEND_STREAM_CHUNK_FIELD_NUMBER: builtins.int + SEND_STREAM_TRAILER_FIELD_NUMBER: builtins.int @property def room_event(self) -> room_pb2.RoomEvent: ... @property @@ -554,6 +597,12 @@ class FfiEvent(google.protobuf.message.Message): def perform_rpc(self) -> rpc_pb2.PerformRpcCallback: ... @property def rpc_method_invocation(self) -> rpc_pb2.RpcMethodInvocationEvent: ... + @property + def send_stream_header(self) -> room_pb2.SendStreamHeaderCallback: ... + @property + def send_stream_chunk(self) -> room_pb2.SendStreamChunkCallback: ... + @property + def send_stream_trailer(self) -> room_pb2.SendStreamTrailerCallback: ... def __init__( self, *, @@ -580,10 +629,13 @@ class FfiEvent(google.protobuf.message.Message): chat_message: room_pb2.SendChatMessageCallback | None = ..., perform_rpc: rpc_pb2.PerformRpcCallback | None = ..., rpc_method_invocation: rpc_pb2.RpcMethodInvocationEvent | None = ..., + send_stream_header: room_pb2.SendStreamHeaderCallback | None = ..., + send_stream_chunk: room_pb2.SendStreamChunkCallback | None = ..., + send_stream_trailer: room_pb2.SendStreamTrailerCallback | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["audio_stream_event", b"audio_stream_event", "capture_audio_frame", b"capture_audio_frame", "chat_message", b"chat_message", "connect", b"connect", "disconnect", b"disconnect", "dispose", b"dispose", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "logs", b"logs", "message", b"message", "panic", b"panic", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "room_event", b"room_event", "rpc_method_invocation", b"rpc_method_invocation", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "track_event", b"track_event", "unpublish_track", b"unpublish_track", "video_stream_event", b"video_stream_event"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["audio_stream_event", b"audio_stream_event", "capture_audio_frame", b"capture_audio_frame", "chat_message", b"chat_message", "connect", b"connect", "disconnect", b"disconnect", "dispose", b"dispose", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "logs", b"logs", "message", b"message", "panic", b"panic", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "room_event", b"room_event", "rpc_method_invocation", b"rpc_method_invocation", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "track_event", b"track_event", "unpublish_track", b"unpublish_track", "video_stream_event", b"video_stream_event"]) -> None: ... - def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["room_event", "track_event", "video_stream_event", "audio_stream_event", "connect", "disconnect", "dispose", "publish_track", "unpublish_track", "publish_data", "publish_transcription", "capture_audio_frame", "set_local_metadata", "set_local_name", "set_local_attributes", "get_stats", "logs", "get_session_stats", "panic", "publish_sip_dtmf", "chat_message", "perform_rpc", "rpc_method_invocation"] | None: ... + def HasField(self, field_name: typing.Literal["audio_stream_event", b"audio_stream_event", "capture_audio_frame", b"capture_audio_frame", "chat_message", b"chat_message", "connect", b"connect", "disconnect", b"disconnect", "dispose", b"dispose", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "logs", b"logs", "message", b"message", "panic", b"panic", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "room_event", b"room_event", "rpc_method_invocation", b"rpc_method_invocation", "send_stream_chunk", b"send_stream_chunk", "send_stream_header", b"send_stream_header", "send_stream_trailer", b"send_stream_trailer", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "track_event", b"track_event", "unpublish_track", b"unpublish_track", "video_stream_event", b"video_stream_event"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["audio_stream_event", b"audio_stream_event", "capture_audio_frame", b"capture_audio_frame", "chat_message", b"chat_message", "connect", b"connect", "disconnect", b"disconnect", "dispose", b"dispose", "get_session_stats", b"get_session_stats", "get_stats", b"get_stats", "logs", b"logs", "message", b"message", "panic", b"panic", "perform_rpc", b"perform_rpc", "publish_data", b"publish_data", "publish_sip_dtmf", b"publish_sip_dtmf", "publish_track", b"publish_track", "publish_transcription", b"publish_transcription", "room_event", b"room_event", "rpc_method_invocation", b"rpc_method_invocation", "send_stream_chunk", b"send_stream_chunk", "send_stream_header", b"send_stream_header", "send_stream_trailer", b"send_stream_trailer", "set_local_attributes", b"set_local_attributes", "set_local_metadata", b"set_local_metadata", "set_local_name", b"set_local_name", "track_event", b"track_event", "unpublish_track", b"unpublish_track", "video_stream_event", b"video_stream_event"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["room_event", "track_event", "video_stream_event", "audio_stream_event", "connect", "disconnect", "dispose", "publish_track", "unpublish_track", "publish_data", "publish_transcription", "capture_audio_frame", "set_local_metadata", "set_local_name", "set_local_attributes", "get_stats", "logs", "get_session_stats", "panic", "publish_sip_dtmf", "chat_message", "perform_rpc", "rpc_method_invocation", "send_stream_header", "send_stream_chunk", "send_stream_trailer"] | None: ... global___FfiEvent = FfiEvent diff --git a/livekit-rtc/livekit/rtc/_proto/room_pb2.py b/livekit-rtc/livekit/rtc/_proto/room_pb2.py index b1462331..fac776ec 100644 --- a/livekit-rtc/livekit/rtc/_proto/room_pb2.py +++ b/livekit-rtc/livekit/rtc/_proto/room_pb2.py @@ -20,7 +20,7 @@ from . import stats_pb2 as stats__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nroom.proto\x12\rlivekit.proto\x1a\ne2ee.proto\x1a\x0chandle.proto\x1a\x11participant.proto\x1a\x0btrack.proto\x1a\x11video_frame.proto\x1a\x0bstats.proto\"Y\n\x0e\x43onnectRequest\x12\x0b\n\x03url\x18\x01 \x02(\t\x12\r\n\x05token\x18\x02 \x02(\t\x12+\n\x07options\x18\x03 \x02(\x0b\x32\x1a.livekit.proto.RoomOptions\"#\n\x0f\x43onnectResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\xbf\x03\n\x0f\x43onnectCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12\x37\n\x06result\x18\x03 \x01(\x0b\x32%.livekit.proto.ConnectCallback.ResultH\x00\x1a\x89\x01\n\x15ParticipantWithTracks\x12\x34\n\x0bparticipant\x18\x01 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\x12:\n\x0cpublications\x18\x02 \x03(\x0b\x32$.livekit.proto.OwnedTrackPublication\x1a\xb8\x01\n\x06Result\x12&\n\x04room\x18\x01 \x02(\x0b\x32\x18.livekit.proto.OwnedRoom\x12:\n\x11local_participant\x18\x02 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\x12J\n\x0cparticipants\x18\x03 \x03(\x0b\x32\x34.livekit.proto.ConnectCallback.ParticipantWithTracksB\t\n\x07message\"(\n\x11\x44isconnectRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\"&\n\x12\x44isconnectResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"&\n\x12\x44isconnectCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\x82\x01\n\x13PublishTrackRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x14\n\x0ctrack_handle\x18\x02 \x02(\x04\x12\x33\n\x07options\x18\x03 \x02(\x0b\x32\".livekit.proto.TrackPublishOptions\"(\n\x14PublishTrackResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\x81\x01\n\x14PublishTrackCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12;\n\x0bpublication\x18\x03 \x01(\x0b\x32$.livekit.proto.OwnedTrackPublicationH\x00\x42\t\n\x07message\"g\n\x15UnpublishTrackRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\x12\x19\n\x11stop_on_unpublish\x18\x03 \x02(\x08\"*\n\x16UnpublishTrackResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"9\n\x16UnpublishTrackCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\xb9\x01\n\x12PublishDataRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x10\n\x08\x64\x61ta_ptr\x18\x02 \x02(\x04\x12\x10\n\x08\x64\x61ta_len\x18\x03 \x02(\x04\x12\x10\n\x08reliable\x18\x04 \x02(\x08\x12\x1c\n\x10\x64\x65stination_sids\x18\x05 \x03(\tB\x02\x18\x01\x12\r\n\x05topic\x18\x06 \x01(\t\x12\x1e\n\x16\x64\x65stination_identities\x18\x07 \x03(\t\"\'\n\x13PublishDataResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"6\n\x13PublishDataCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\xa6\x01\n\x1bPublishTranscriptionRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\x12\x10\n\x08track_id\x18\x03 \x02(\t\x12\x35\n\x08segments\x18\x04 \x03(\x0b\x32#.livekit.proto.TranscriptionSegment\"0\n\x1cPublishTranscriptionResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"?\n\x1cPublishTranscriptionCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"v\n\x15PublishSipDtmfRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0c\n\x04\x63ode\x18\x02 \x02(\r\x12\r\n\x05\x64igit\x18\x03 \x02(\t\x12\x1e\n\x16\x64\x65stination_identities\x18\x04 \x03(\t\"*\n\x16PublishSipDtmfResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"9\n\x16PublishSipDtmfCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"M\n\x17SetLocalMetadataRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x10\n\x08metadata\x18\x02 \x02(\t\",\n\x18SetLocalMetadataResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\";\n\x18SetLocalMetadataCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\x84\x01\n\x16SendChatMessageRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0f\n\x07message\x18\x02 \x02(\t\x12\x1e\n\x16\x64\x65stination_identities\x18\x03 \x03(\t\x12\x17\n\x0fsender_identity\x18\x04 \x01(\t\"\xbc\x01\n\x16\x45\x64itChatMessageRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x11\n\tedit_text\x18\x02 \x02(\t\x12\x34\n\x10original_message\x18\x03 \x02(\x0b\x32\x1a.livekit.proto.ChatMessage\x12\x1e\n\x16\x64\x65stination_identities\x18\x04 \x03(\t\x12\x17\n\x0fsender_identity\x18\x05 \x01(\t\"+\n\x17SendChatMessageResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"{\n\x17SendChatMessageCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12\x32\n\x0c\x63hat_message\x18\x03 \x01(\x0b\x32\x1a.livekit.proto.ChatMessageH\x00\x42\t\n\x07message\"q\n\x19SetLocalAttributesRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x32\n\nattributes\x18\x02 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\"-\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x02(\t\".\n\x1aSetLocalAttributesResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"=\n\x1aSetLocalAttributesCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"E\n\x13SetLocalNameRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0c\n\x04name\x18\x02 \x02(\t\"(\n\x14SetLocalNameResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"7\n\x14SetLocalNameCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"E\n\x14SetSubscribedRequest\x12\x11\n\tsubscribe\x18\x01 \x02(\x08\x12\x1a\n\x12publication_handle\x18\x02 \x02(\x04\"\x17\n\x15SetSubscribedResponse\"-\n\x16GetSessionStatsRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\"+\n\x17GetSessionStatsResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\xf7\x01\n\x17GetSessionStatsCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12?\n\x06result\x18\x03 \x01(\x0b\x32-.livekit.proto.GetSessionStatsCallback.ResultH\x00\x1am\n\x06Result\x12\x30\n\x0fpublisher_stats\x18\x01 \x03(\x0b\x32\x17.livekit.proto.RtcStats\x12\x31\n\x10subscriber_stats\x18\x02 \x03(\x0b\x32\x17.livekit.proto.RtcStatsB\t\n\x07message\";\n\rVideoEncoding\x12\x13\n\x0bmax_bitrate\x18\x01 \x02(\x04\x12\x15\n\rmax_framerate\x18\x02 \x02(\x01\"$\n\rAudioEncoding\x12\x13\n\x0bmax_bitrate\x18\x01 \x02(\x04\"\x9a\x02\n\x13TrackPublishOptions\x12\x34\n\x0evideo_encoding\x18\x01 \x01(\x0b\x32\x1c.livekit.proto.VideoEncoding\x12\x34\n\x0e\x61udio_encoding\x18\x02 \x01(\x0b\x32\x1c.livekit.proto.AudioEncoding\x12.\n\x0bvideo_codec\x18\x03 \x01(\x0e\x32\x19.livekit.proto.VideoCodec\x12\x0b\n\x03\x64tx\x18\x04 \x01(\x08\x12\x0b\n\x03red\x18\x05 \x01(\x08\x12\x11\n\tsimulcast\x18\x06 \x01(\x08\x12*\n\x06source\x18\x07 \x01(\x0e\x32\x1a.livekit.proto.TrackSource\x12\x0e\n\x06stream\x18\x08 \x01(\t\"=\n\tIceServer\x12\x0c\n\x04urls\x18\x01 \x03(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x10\n\x08password\x18\x03 \x01(\t\"\xc4\x01\n\tRtcConfig\x12;\n\x12ice_transport_type\x18\x01 \x01(\x0e\x32\x1f.livekit.proto.IceTransportType\x12K\n\x1a\x63ontinual_gathering_policy\x18\x02 \x01(\x0e\x32\'.livekit.proto.ContinualGatheringPolicy\x12-\n\x0bice_servers\x18\x03 \x03(\x0b\x32\x18.livekit.proto.IceServer\"\xbe\x01\n\x0bRoomOptions\x12\x16\n\x0e\x61uto_subscribe\x18\x01 \x01(\x08\x12\x17\n\x0f\x61\x64\x61ptive_stream\x18\x02 \x01(\x08\x12\x10\n\x08\x64ynacast\x18\x03 \x01(\x08\x12(\n\x04\x65\x32\x65\x65\x18\x04 \x01(\x0b\x32\x1a.livekit.proto.E2eeOptions\x12,\n\nrtc_config\x18\x05 \x01(\x0b\x32\x18.livekit.proto.RtcConfig\x12\x14\n\x0cjoin_retries\x18\x06 \x01(\r\"w\n\x14TranscriptionSegment\x12\n\n\x02id\x18\x01 \x02(\t\x12\x0c\n\x04text\x18\x02 \x02(\t\x12\x12\n\nstart_time\x18\x03 \x02(\x04\x12\x10\n\x08\x65nd_time\x18\x04 \x02(\x04\x12\r\n\x05\x66inal\x18\x05 \x02(\x08\x12\x10\n\x08language\x18\x06 \x02(\t\"0\n\nBufferInfo\x12\x10\n\x08\x64\x61ta_ptr\x18\x01 \x02(\x04\x12\x10\n\x08\x64\x61ta_len\x18\x02 \x02(\x04\"e\n\x0bOwnedBuffer\x12-\n\x06handle\x18\x01 \x02(\x0b\x32\x1d.livekit.proto.FfiOwnedHandle\x12\'\n\x04\x64\x61ta\x18\x02 \x02(\x0b\x32\x19.livekit.proto.BufferInfo\"\xd1\x0f\n\tRoomEvent\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x44\n\x15participant_connected\x18\x02 \x01(\x0b\x32#.livekit.proto.ParticipantConnectedH\x00\x12J\n\x18participant_disconnected\x18\x03 \x01(\x0b\x32&.livekit.proto.ParticipantDisconnectedH\x00\x12\x43\n\x15local_track_published\x18\x04 \x01(\x0b\x32\".livekit.proto.LocalTrackPublishedH\x00\x12G\n\x17local_track_unpublished\x18\x05 \x01(\x0b\x32$.livekit.proto.LocalTrackUnpublishedH\x00\x12\x45\n\x16local_track_subscribed\x18\x06 \x01(\x0b\x32#.livekit.proto.LocalTrackSubscribedH\x00\x12\x38\n\x0ftrack_published\x18\x07 \x01(\x0b\x32\x1d.livekit.proto.TrackPublishedH\x00\x12<\n\x11track_unpublished\x18\x08 \x01(\x0b\x32\x1f.livekit.proto.TrackUnpublishedH\x00\x12:\n\x10track_subscribed\x18\t \x01(\x0b\x32\x1e.livekit.proto.TrackSubscribedH\x00\x12>\n\x12track_unsubscribed\x18\n \x01(\x0b\x32 .livekit.proto.TrackUnsubscribedH\x00\x12K\n\x19track_subscription_failed\x18\x0b \x01(\x0b\x32&.livekit.proto.TrackSubscriptionFailedH\x00\x12\x30\n\x0btrack_muted\x18\x0c \x01(\x0b\x32\x19.livekit.proto.TrackMutedH\x00\x12\x34\n\rtrack_unmuted\x18\r \x01(\x0b\x32\x1b.livekit.proto.TrackUnmutedH\x00\x12G\n\x17\x61\x63tive_speakers_changed\x18\x0e \x01(\x0b\x32$.livekit.proto.ActiveSpeakersChangedH\x00\x12\x43\n\x15room_metadata_changed\x18\x0f \x01(\x0b\x32\".livekit.proto.RoomMetadataChangedH\x00\x12\x39\n\x10room_sid_changed\x18\x10 \x01(\x0b\x32\x1d.livekit.proto.RoomSidChangedH\x00\x12Q\n\x1cparticipant_metadata_changed\x18\x11 \x01(\x0b\x32).livekit.proto.ParticipantMetadataChangedH\x00\x12I\n\x18participant_name_changed\x18\x12 \x01(\x0b\x32%.livekit.proto.ParticipantNameChangedH\x00\x12U\n\x1eparticipant_attributes_changed\x18\x13 \x01(\x0b\x32+.livekit.proto.ParticipantAttributesChangedH\x00\x12M\n\x1a\x63onnection_quality_changed\x18\x14 \x01(\x0b\x32\'.livekit.proto.ConnectionQualityChangedH\x00\x12I\n\x18\x63onnection_state_changed\x18\x15 \x01(\x0b\x32%.livekit.proto.ConnectionStateChangedH\x00\x12\x33\n\x0c\x64isconnected\x18\x16 \x01(\x0b\x32\x1b.livekit.proto.DisconnectedH\x00\x12\x33\n\x0creconnecting\x18\x17 \x01(\x0b\x32\x1b.livekit.proto.ReconnectingH\x00\x12\x31\n\x0breconnected\x18\x18 \x01(\x0b\x32\x1a.livekit.proto.ReconnectedH\x00\x12=\n\x12\x65\x32\x65\x65_state_changed\x18\x19 \x01(\x0b\x32\x1f.livekit.proto.E2eeStateChangedH\x00\x12%\n\x03\x65os\x18\x1a \x01(\x0b\x32\x16.livekit.proto.RoomEOSH\x00\x12\x41\n\x14\x64\x61ta_packet_received\x18\x1b \x01(\x0b\x32!.livekit.proto.DataPacketReceivedH\x00\x12\x46\n\x16transcription_received\x18\x1c \x01(\x0b\x32$.livekit.proto.TranscriptionReceivedH\x00\x12:\n\x0c\x63hat_message\x18\x1d \x01(\x0b\x32\".livekit.proto.ChatMessageReceivedH\x00\x12\x39\n\rstream_header\x18\x1e \x01(\x0b\x32 .livekit.proto.DataStream.HeaderH\x00\x12\x37\n\x0cstream_chunk\x18\x1f \x01(\x0b\x32\x1f.livekit.proto.DataStream.ChunkH\x00\x42\t\n\x07message\"7\n\x08RoomInfo\x12\x0b\n\x03sid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x02(\t\x12\x10\n\x08metadata\x18\x03 \x02(\t\"a\n\tOwnedRoom\x12-\n\x06handle\x18\x01 \x02(\x0b\x32\x1d.livekit.proto.FfiOwnedHandle\x12%\n\x04info\x18\x02 \x02(\x0b\x32\x17.livekit.proto.RoomInfo\"E\n\x14ParticipantConnected\x12-\n\x04info\x18\x01 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\"7\n\x17ParticipantDisconnected\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\"(\n\x13LocalTrackPublished\x12\x11\n\ttrack_sid\x18\x01 \x02(\t\"0\n\x15LocalTrackUnpublished\x12\x17\n\x0fpublication_sid\x18\x01 \x02(\t\")\n\x14LocalTrackSubscribed\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"i\n\x0eTrackPublished\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x39\n\x0bpublication\x18\x02 \x02(\x0b\x32$.livekit.proto.OwnedTrackPublication\"I\n\x10TrackUnpublished\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x17\n\x0fpublication_sid\x18\x02 \x02(\t\"Y\n\x0fTrackSubscribed\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12(\n\x05track\x18\x02 \x02(\x0b\x32\x19.livekit.proto.OwnedTrack\"D\n\x11TrackUnsubscribed\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"Y\n\x17TrackSubscriptionFailed\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\x12\r\n\x05\x65rror\x18\x03 \x02(\t\"=\n\nTrackMuted\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"?\n\x0cTrackUnmuted\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"_\n\x10\x45\x32\x65\x65StateChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12-\n\x05state\x18\x02 \x02(\x0e\x32\x1e.livekit.proto.EncryptionState\"7\n\x15\x41\x63tiveSpeakersChanged\x12\x1e\n\x16participant_identities\x18\x01 \x03(\t\"\'\n\x13RoomMetadataChanged\x12\x10\n\x08metadata\x18\x01 \x02(\t\"\x1d\n\x0eRoomSidChanged\x12\x0b\n\x03sid\x18\x01 \x02(\t\"L\n\x1aParticipantMetadataChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x10\n\x08metadata\x18\x02 \x02(\t\"\xac\x01\n\x1cParticipantAttributesChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x32\n\nattributes\x18\x02 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\x12:\n\x12\x63hanged_attributes\x18\x03 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\"D\n\x16ParticipantNameChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x0c\n\x04name\x18\x02 \x02(\t\"k\n\x18\x43onnectionQualityChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x31\n\x07quality\x18\x02 \x02(\x0e\x32 .livekit.proto.ConnectionQuality\"E\n\nUserPacket\x12(\n\x04\x64\x61ta\x18\x01 \x02(\x0b\x32\x1a.livekit.proto.OwnedBuffer\x12\r\n\x05topic\x18\x02 \x01(\t\"y\n\x0b\x43hatMessage\x12\n\n\x02id\x18\x01 \x02(\t\x12\x11\n\ttimestamp\x18\x02 \x02(\x03\x12\x0f\n\x07message\x18\x03 \x02(\t\x12\x16\n\x0e\x65\x64it_timestamp\x18\x04 \x01(\x03\x12\x0f\n\x07\x64\x65leted\x18\x05 \x01(\x08\x12\x11\n\tgenerated\x18\x06 \x01(\x08\"`\n\x13\x43hatMessageReceived\x12+\n\x07message\x18\x01 \x02(\x0b\x32\x1a.livekit.proto.ChatMessage\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\"&\n\x07SipDTMF\x12\x0c\n\x04\x63ode\x18\x01 \x02(\r\x12\r\n\x05\x64igit\x18\x02 \x01(\t\"\xbf\x01\n\x12\x44\x61taPacketReceived\x12+\n\x04kind\x18\x01 \x02(\x0e\x32\x1d.livekit.proto.DataPacketKind\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\x12)\n\x04user\x18\x04 \x01(\x0b\x32\x19.livekit.proto.UserPacketH\x00\x12*\n\x08sip_dtmf\x18\x05 \x01(\x0b\x32\x16.livekit.proto.SipDTMFH\x00\x42\x07\n\x05value\"\x7f\n\x15TranscriptionReceived\x12\x1c\n\x14participant_identity\x18\x01 \x01(\t\x12\x11\n\ttrack_sid\x18\x02 \x01(\t\x12\x35\n\x08segments\x18\x03 \x03(\x0b\x32#.livekit.proto.TranscriptionSegment\"G\n\x16\x43onnectionStateChanged\x12-\n\x05state\x18\x01 \x02(\x0e\x32\x1e.livekit.proto.ConnectionState\"\x0b\n\tConnected\"?\n\x0c\x44isconnected\x12/\n\x06reason\x18\x01 \x02(\x0e\x32\x1f.livekit.proto.DisconnectReason\"\x0e\n\x0cReconnecting\"\r\n\x0bReconnected\"\t\n\x07RoomEOS\"\x92\x06\n\nDataStream\x1a\xaa\x01\n\nTextHeader\x12?\n\x0eoperation_type\x18\x01 \x02(\x0e\x32\'.livekit.proto.DataStream.OperationType\x12\x0f\n\x07version\x18\x02 \x02(\x05\x12\x1a\n\x12reply_to_stream_id\x18\x03 \x02(\t\x12\x1b\n\x13\x61ttached_stream_ids\x18\x04 \x03(\t\x12\x11\n\tgenerated\x18\x05 \x02(\x08\x1a\x1f\n\nFileHeader\x12\x11\n\tfile_name\x18\x01 \x02(\t\x1a\x81\x03\n\x06Header\x12\x11\n\tstream_id\x18\x01 \x02(\t\x12\x11\n\ttimestamp\x18\x02 \x02(\x03\x12\r\n\x05topic\x18\x03 \x02(\t\x12\x11\n\tmime_type\x18\x04 \x02(\t\x12\x14\n\x0ctotal_length\x18\x05 \x01(\x04\x12\x14\n\x0ctotal_chunks\x18\x06 \x01(\x04\x12\x44\n\nextensions\x18\x07 \x03(\x0b\x32\x30.livekit.proto.DataStream.Header.ExtensionsEntry\x12;\n\x0btext_header\x18\x08 \x01(\x0b\x32$.livekit.proto.DataStream.TextHeaderH\x00\x12;\n\x0b\x66ile_header\x18\t \x01(\x0b\x32$.livekit.proto.DataStream.FileHeaderH\x00\x1a\x31\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x10\n\x0e\x63ontent_header\x1ao\n\x05\x43hunk\x12\x11\n\tstream_id\x18\x01 \x02(\t\x12\x13\n\x0b\x63hunk_index\x18\x02 \x02(\x04\x12\x0f\n\x07\x63ontent\x18\x03 \x02(\x0c\x12\x10\n\x08\x63omplete\x18\x04 \x02(\x08\x12\x0f\n\x07version\x18\x05 \x02(\x05\x12\n\n\x02iv\x18\x06 \x01(\x0c\"A\n\rOperationType\x12\n\n\x06\x43REATE\x10\x00\x12\n\n\x06UPDATE\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x12\x0c\n\x08REACTION\x10\x03*P\n\x10IceTransportType\x12\x13\n\x0fTRANSPORT_RELAY\x10\x00\x12\x14\n\x10TRANSPORT_NOHOST\x10\x01\x12\x11\n\rTRANSPORT_ALL\x10\x02*C\n\x18\x43ontinualGatheringPolicy\x12\x0f\n\x0bGATHER_ONCE\x10\x00\x12\x16\n\x12GATHER_CONTINUALLY\x10\x01*`\n\x11\x43onnectionQuality\x12\x10\n\x0cQUALITY_POOR\x10\x00\x12\x10\n\x0cQUALITY_GOOD\x10\x01\x12\x15\n\x11QUALITY_EXCELLENT\x10\x02\x12\x10\n\x0cQUALITY_LOST\x10\x03*S\n\x0f\x43onnectionState\x12\x15\n\x11\x43ONN_DISCONNECTED\x10\x00\x12\x12\n\x0e\x43ONN_CONNECTED\x10\x01\x12\x15\n\x11\x43ONN_RECONNECTING\x10\x02*3\n\x0e\x44\x61taPacketKind\x12\x0e\n\nKIND_LOSSY\x10\x00\x12\x11\n\rKIND_RELIABLE\x10\x01\x42\x10\xaa\x02\rLiveKit.Proto') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nroom.proto\x12\rlivekit.proto\x1a\ne2ee.proto\x1a\x0chandle.proto\x1a\x11participant.proto\x1a\x0btrack.proto\x1a\x11video_frame.proto\x1a\x0bstats.proto\"Y\n\x0e\x43onnectRequest\x12\x0b\n\x03url\x18\x01 \x02(\t\x12\r\n\x05token\x18\x02 \x02(\t\x12+\n\x07options\x18\x03 \x02(\x0b\x32\x1a.livekit.proto.RoomOptions\"#\n\x0f\x43onnectResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\xbf\x03\n\x0f\x43onnectCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12\x37\n\x06result\x18\x03 \x01(\x0b\x32%.livekit.proto.ConnectCallback.ResultH\x00\x1a\x89\x01\n\x15ParticipantWithTracks\x12\x34\n\x0bparticipant\x18\x01 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\x12:\n\x0cpublications\x18\x02 \x03(\x0b\x32$.livekit.proto.OwnedTrackPublication\x1a\xb8\x01\n\x06Result\x12&\n\x04room\x18\x01 \x02(\x0b\x32\x18.livekit.proto.OwnedRoom\x12:\n\x11local_participant\x18\x02 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\x12J\n\x0cparticipants\x18\x03 \x03(\x0b\x32\x34.livekit.proto.ConnectCallback.ParticipantWithTracksB\t\n\x07message\"(\n\x11\x44isconnectRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\"&\n\x12\x44isconnectResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"&\n\x12\x44isconnectCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\x82\x01\n\x13PublishTrackRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x14\n\x0ctrack_handle\x18\x02 \x02(\x04\x12\x33\n\x07options\x18\x03 \x02(\x0b\x32\".livekit.proto.TrackPublishOptions\"(\n\x14PublishTrackResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\x81\x01\n\x14PublishTrackCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12;\n\x0bpublication\x18\x03 \x01(\x0b\x32$.livekit.proto.OwnedTrackPublicationH\x00\x42\t\n\x07message\"g\n\x15UnpublishTrackRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\x12\x19\n\x11stop_on_unpublish\x18\x03 \x02(\x08\"*\n\x16UnpublishTrackResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"9\n\x16UnpublishTrackCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\xb9\x01\n\x12PublishDataRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x10\n\x08\x64\x61ta_ptr\x18\x02 \x02(\x04\x12\x10\n\x08\x64\x61ta_len\x18\x03 \x02(\x04\x12\x10\n\x08reliable\x18\x04 \x02(\x08\x12\x1c\n\x10\x64\x65stination_sids\x18\x05 \x03(\tB\x02\x18\x01\x12\r\n\x05topic\x18\x06 \x01(\t\x12\x1e\n\x16\x64\x65stination_identities\x18\x07 \x03(\t\"\'\n\x13PublishDataResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"6\n\x13PublishDataCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\xa6\x01\n\x1bPublishTranscriptionRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\x12\x10\n\x08track_id\x18\x03 \x02(\t\x12\x35\n\x08segments\x18\x04 \x03(\x0b\x32#.livekit.proto.TranscriptionSegment\"0\n\x1cPublishTranscriptionResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"?\n\x1cPublishTranscriptionCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"v\n\x15PublishSipDtmfRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0c\n\x04\x63ode\x18\x02 \x02(\r\x12\r\n\x05\x64igit\x18\x03 \x02(\t\x12\x1e\n\x16\x64\x65stination_identities\x18\x04 \x03(\t\"*\n\x16PublishSipDtmfResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"9\n\x16PublishSipDtmfCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"M\n\x17SetLocalMetadataRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x10\n\x08metadata\x18\x02 \x02(\t\",\n\x18SetLocalMetadataResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\";\n\x18SetLocalMetadataCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\x84\x01\n\x16SendChatMessageRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0f\n\x07message\x18\x02 \x02(\t\x12\x1e\n\x16\x64\x65stination_identities\x18\x03 \x03(\t\x12\x17\n\x0fsender_identity\x18\x04 \x01(\t\"\xbc\x01\n\x16\x45\x64itChatMessageRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x11\n\tedit_text\x18\x02 \x02(\t\x12\x34\n\x10original_message\x18\x03 \x02(\x0b\x32\x1a.livekit.proto.ChatMessage\x12\x1e\n\x16\x64\x65stination_identities\x18\x04 \x03(\t\x12\x17\n\x0fsender_identity\x18\x05 \x01(\t\"+\n\x17SendChatMessageResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"{\n\x17SendChatMessageCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12\x32\n\x0c\x63hat_message\x18\x03 \x01(\x0b\x32\x1a.livekit.proto.ChatMessageH\x00\x42\t\n\x07message\"q\n\x19SetLocalAttributesRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x32\n\nattributes\x18\x02 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\"-\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x02(\t\".\n\x1aSetLocalAttributesResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"=\n\x1aSetLocalAttributesCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"E\n\x13SetLocalNameRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0c\n\x04name\x18\x02 \x02(\t\"(\n\x14SetLocalNameResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"7\n\x14SetLocalNameCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"E\n\x14SetSubscribedRequest\x12\x11\n\tsubscribe\x18\x01 \x02(\x08\x12\x1a\n\x12publication_handle\x18\x02 \x02(\x04\"\x17\n\x15SetSubscribedResponse\"-\n\x16GetSessionStatsRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\"+\n\x17GetSessionStatsResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\xf7\x01\n\x17GetSessionStatsCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\x0f\n\x05\x65rror\x18\x02 \x01(\tH\x00\x12?\n\x06result\x18\x03 \x01(\x0b\x32-.livekit.proto.GetSessionStatsCallback.ResultH\x00\x1am\n\x06Result\x12\x30\n\x0fpublisher_stats\x18\x01 \x03(\x0b\x32\x17.livekit.proto.RtcStats\x12\x31\n\x10subscriber_stats\x18\x02 \x03(\x0b\x32\x17.livekit.proto.RtcStatsB\t\n\x07message\";\n\rVideoEncoding\x12\x13\n\x0bmax_bitrate\x18\x01 \x02(\x04\x12\x15\n\rmax_framerate\x18\x02 \x02(\x01\"$\n\rAudioEncoding\x12\x13\n\x0bmax_bitrate\x18\x01 \x02(\x04\"\x9a\x02\n\x13TrackPublishOptions\x12\x34\n\x0evideo_encoding\x18\x01 \x01(\x0b\x32\x1c.livekit.proto.VideoEncoding\x12\x34\n\x0e\x61udio_encoding\x18\x02 \x01(\x0b\x32\x1c.livekit.proto.AudioEncoding\x12.\n\x0bvideo_codec\x18\x03 \x01(\x0e\x32\x19.livekit.proto.VideoCodec\x12\x0b\n\x03\x64tx\x18\x04 \x01(\x08\x12\x0b\n\x03red\x18\x05 \x01(\x08\x12\x11\n\tsimulcast\x18\x06 \x01(\x08\x12*\n\x06source\x18\x07 \x01(\x0e\x32\x1a.livekit.proto.TrackSource\x12\x0e\n\x06stream\x18\x08 \x01(\t\"=\n\tIceServer\x12\x0c\n\x04urls\x18\x01 \x03(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x10\n\x08password\x18\x03 \x01(\t\"\xc4\x01\n\tRtcConfig\x12;\n\x12ice_transport_type\x18\x01 \x01(\x0e\x32\x1f.livekit.proto.IceTransportType\x12K\n\x1a\x63ontinual_gathering_policy\x18\x02 \x01(\x0e\x32\'.livekit.proto.ContinualGatheringPolicy\x12-\n\x0bice_servers\x18\x03 \x03(\x0b\x32\x18.livekit.proto.IceServer\"\xbe\x01\n\x0bRoomOptions\x12\x16\n\x0e\x61uto_subscribe\x18\x01 \x01(\x08\x12\x17\n\x0f\x61\x64\x61ptive_stream\x18\x02 \x01(\x08\x12\x10\n\x08\x64ynacast\x18\x03 \x01(\x08\x12(\n\x04\x65\x32\x65\x65\x18\x04 \x01(\x0b\x32\x1a.livekit.proto.E2eeOptions\x12,\n\nrtc_config\x18\x05 \x01(\x0b\x32\x18.livekit.proto.RtcConfig\x12\x14\n\x0cjoin_retries\x18\x06 \x01(\r\"w\n\x14TranscriptionSegment\x12\n\n\x02id\x18\x01 \x02(\t\x12\x0c\n\x04text\x18\x02 \x02(\t\x12\x12\n\nstart_time\x18\x03 \x02(\x04\x12\x10\n\x08\x65nd_time\x18\x04 \x02(\x04\x12\r\n\x05\x66inal\x18\x05 \x02(\x08\x12\x10\n\x08language\x18\x06 \x02(\t\"0\n\nBufferInfo\x12\x10\n\x08\x64\x61ta_ptr\x18\x01 \x02(\x04\x12\x10\n\x08\x64\x61ta_len\x18\x02 \x02(\x04\"e\n\x0bOwnedBuffer\x12-\n\x06handle\x18\x01 \x02(\x0b\x32\x1d.livekit.proto.FfiOwnedHandle\x12\'\n\x04\x64\x61ta\x18\x02 \x02(\x0b\x32\x19.livekit.proto.BufferInfo\"\xa9\x11\n\tRoomEvent\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x44\n\x15participant_connected\x18\x02 \x01(\x0b\x32#.livekit.proto.ParticipantConnectedH\x00\x12J\n\x18participant_disconnected\x18\x03 \x01(\x0b\x32&.livekit.proto.ParticipantDisconnectedH\x00\x12\x43\n\x15local_track_published\x18\x04 \x01(\x0b\x32\".livekit.proto.LocalTrackPublishedH\x00\x12G\n\x17local_track_unpublished\x18\x05 \x01(\x0b\x32$.livekit.proto.LocalTrackUnpublishedH\x00\x12\x45\n\x16local_track_subscribed\x18\x06 \x01(\x0b\x32#.livekit.proto.LocalTrackSubscribedH\x00\x12\x38\n\x0ftrack_published\x18\x07 \x01(\x0b\x32\x1d.livekit.proto.TrackPublishedH\x00\x12<\n\x11track_unpublished\x18\x08 \x01(\x0b\x32\x1f.livekit.proto.TrackUnpublishedH\x00\x12:\n\x10track_subscribed\x18\t \x01(\x0b\x32\x1e.livekit.proto.TrackSubscribedH\x00\x12>\n\x12track_unsubscribed\x18\n \x01(\x0b\x32 .livekit.proto.TrackUnsubscribedH\x00\x12K\n\x19track_subscription_failed\x18\x0b \x01(\x0b\x32&.livekit.proto.TrackSubscriptionFailedH\x00\x12\x30\n\x0btrack_muted\x18\x0c \x01(\x0b\x32\x19.livekit.proto.TrackMutedH\x00\x12\x34\n\rtrack_unmuted\x18\r \x01(\x0b\x32\x1b.livekit.proto.TrackUnmutedH\x00\x12G\n\x17\x61\x63tive_speakers_changed\x18\x0e \x01(\x0b\x32$.livekit.proto.ActiveSpeakersChangedH\x00\x12\x43\n\x15room_metadata_changed\x18\x0f \x01(\x0b\x32\".livekit.proto.RoomMetadataChangedH\x00\x12\x39\n\x10room_sid_changed\x18\x10 \x01(\x0b\x32\x1d.livekit.proto.RoomSidChangedH\x00\x12Q\n\x1cparticipant_metadata_changed\x18\x11 \x01(\x0b\x32).livekit.proto.ParticipantMetadataChangedH\x00\x12I\n\x18participant_name_changed\x18\x12 \x01(\x0b\x32%.livekit.proto.ParticipantNameChangedH\x00\x12U\n\x1eparticipant_attributes_changed\x18\x13 \x01(\x0b\x32+.livekit.proto.ParticipantAttributesChangedH\x00\x12M\n\x1a\x63onnection_quality_changed\x18\x14 \x01(\x0b\x32\'.livekit.proto.ConnectionQualityChangedH\x00\x12I\n\x18\x63onnection_state_changed\x18\x15 \x01(\x0b\x32%.livekit.proto.ConnectionStateChangedH\x00\x12\x33\n\x0c\x64isconnected\x18\x16 \x01(\x0b\x32\x1b.livekit.proto.DisconnectedH\x00\x12\x33\n\x0creconnecting\x18\x17 \x01(\x0b\x32\x1b.livekit.proto.ReconnectingH\x00\x12\x31\n\x0breconnected\x18\x18 \x01(\x0b\x32\x1a.livekit.proto.ReconnectedH\x00\x12=\n\x12\x65\x32\x65\x65_state_changed\x18\x19 \x01(\x0b\x32\x1f.livekit.proto.E2eeStateChangedH\x00\x12%\n\x03\x65os\x18\x1a \x01(\x0b\x32\x16.livekit.proto.RoomEOSH\x00\x12\x41\n\x14\x64\x61ta_packet_received\x18\x1b \x01(\x0b\x32!.livekit.proto.DataPacketReceivedH\x00\x12\x46\n\x16transcription_received\x18\x1c \x01(\x0b\x32$.livekit.proto.TranscriptionReceivedH\x00\x12:\n\x0c\x63hat_message\x18\x1d \x01(\x0b\x32\".livekit.proto.ChatMessageReceivedH\x00\x12I\n\x16stream_header_received\x18\x1e \x01(\x0b\x32\'.livekit.proto.DataStreamHeaderReceivedH\x00\x12G\n\x15stream_chunk_received\x18\x1f \x01(\x0b\x32&.livekit.proto.DataStreamChunkReceivedH\x00\x12K\n\x17stream_trailer_received\x18 \x01(\x0b\x32(.livekit.proto.DataStreamTrailerReceivedH\x00\x12i\n\"data_channel_low_threshold_changed\x18! \x01(\x0b\x32;.livekit.proto.DataChannelBufferedAmountLowThresholdChangedH\x00\x42\t\n\x07message\"\x9a\x01\n\x08RoomInfo\x12\x0b\n\x03sid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x02(\t\x12\x10\n\x08metadata\x18\x03 \x02(\t\x12.\n&lossy_dc_buffered_amount_low_threshold\x18\x04 \x02(\x04\x12\x31\n)reliable_dc_buffered_amount_low_threshold\x18\x05 \x02(\x04\"a\n\tOwnedRoom\x12-\n\x06handle\x18\x01 \x02(\x0b\x32\x1d.livekit.proto.FfiOwnedHandle\x12%\n\x04info\x18\x02 \x02(\x0b\x32\x17.livekit.proto.RoomInfo\"E\n\x14ParticipantConnected\x12-\n\x04info\x18\x01 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\"7\n\x17ParticipantDisconnected\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\"(\n\x13LocalTrackPublished\x12\x11\n\ttrack_sid\x18\x01 \x02(\t\"0\n\x15LocalTrackUnpublished\x12\x17\n\x0fpublication_sid\x18\x01 \x02(\t\")\n\x14LocalTrackSubscribed\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"i\n\x0eTrackPublished\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x39\n\x0bpublication\x18\x02 \x02(\x0b\x32$.livekit.proto.OwnedTrackPublication\"I\n\x10TrackUnpublished\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x17\n\x0fpublication_sid\x18\x02 \x02(\t\"Y\n\x0fTrackSubscribed\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12(\n\x05track\x18\x02 \x02(\x0b\x32\x19.livekit.proto.OwnedTrack\"D\n\x11TrackUnsubscribed\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"Y\n\x17TrackSubscriptionFailed\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\x12\r\n\x05\x65rror\x18\x03 \x02(\t\"=\n\nTrackMuted\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"?\n\x0cTrackUnmuted\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x11\n\ttrack_sid\x18\x02 \x02(\t\"_\n\x10\x45\x32\x65\x65StateChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12-\n\x05state\x18\x02 \x02(\x0e\x32\x1e.livekit.proto.EncryptionState\"7\n\x15\x41\x63tiveSpeakersChanged\x12\x1e\n\x16participant_identities\x18\x01 \x03(\t\"\'\n\x13RoomMetadataChanged\x12\x10\n\x08metadata\x18\x01 \x02(\t\"\x1d\n\x0eRoomSidChanged\x12\x0b\n\x03sid\x18\x01 \x02(\t\"L\n\x1aParticipantMetadataChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x10\n\x08metadata\x18\x02 \x02(\t\"\xac\x01\n\x1cParticipantAttributesChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x32\n\nattributes\x18\x02 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\x12:\n\x12\x63hanged_attributes\x18\x03 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\"D\n\x16ParticipantNameChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x0c\n\x04name\x18\x02 \x02(\t\"k\n\x18\x43onnectionQualityChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x31\n\x07quality\x18\x02 \x02(\x0e\x32 .livekit.proto.ConnectionQuality\"E\n\nUserPacket\x12(\n\x04\x64\x61ta\x18\x01 \x02(\x0b\x32\x1a.livekit.proto.OwnedBuffer\x12\r\n\x05topic\x18\x02 \x01(\t\"y\n\x0b\x43hatMessage\x12\n\n\x02id\x18\x01 \x02(\t\x12\x11\n\ttimestamp\x18\x02 \x02(\x03\x12\x0f\n\x07message\x18\x03 \x02(\t\x12\x16\n\x0e\x65\x64it_timestamp\x18\x04 \x01(\x03\x12\x0f\n\x07\x64\x65leted\x18\x05 \x01(\x08\x12\x11\n\tgenerated\x18\x06 \x01(\x08\"`\n\x13\x43hatMessageReceived\x12+\n\x07message\x18\x01 \x02(\x0b\x32\x1a.livekit.proto.ChatMessage\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\"&\n\x07SipDTMF\x12\x0c\n\x04\x63ode\x18\x01 \x02(\r\x12\r\n\x05\x64igit\x18\x02 \x01(\t\"\xbf\x01\n\x12\x44\x61taPacketReceived\x12+\n\x04kind\x18\x01 \x02(\x0e\x32\x1d.livekit.proto.DataPacketKind\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\x12)\n\x04user\x18\x04 \x01(\x0b\x32\x19.livekit.proto.UserPacketH\x00\x12*\n\x08sip_dtmf\x18\x05 \x01(\x0b\x32\x16.livekit.proto.SipDTMFH\x00\x42\x07\n\x05value\"\x7f\n\x15TranscriptionReceived\x12\x1c\n\x14participant_identity\x18\x01 \x01(\t\x12\x11\n\ttrack_sid\x18\x02 \x01(\t\x12\x35\n\x08segments\x18\x03 \x03(\x0b\x32#.livekit.proto.TranscriptionSegment\"G\n\x16\x43onnectionStateChanged\x12-\n\x05state\x18\x01 \x02(\x0e\x32\x1e.livekit.proto.ConnectionState\"\x0b\n\tConnected\"?\n\x0c\x44isconnected\x12/\n\x06reason\x18\x01 \x02(\x0e\x32\x1f.livekit.proto.DisconnectReason\"\x0e\n\x0cReconnecting\"\r\n\x0bReconnected\"\t\n\x07RoomEOS\"\x8e\x07\n\nDataStream\x1a\xaa\x01\n\nTextHeader\x12?\n\x0eoperation_type\x18\x01 \x02(\x0e\x32\'.livekit.proto.DataStream.OperationType\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12\x1a\n\x12reply_to_stream_id\x18\x03 \x01(\t\x12\x1b\n\x13\x61ttached_stream_ids\x18\x04 \x03(\t\x12\x11\n\tgenerated\x18\x05 \x01(\x08\x1a\x1a\n\nByteHeader\x12\x0c\n\x04name\x18\x01 \x02(\t\x1a\xeb\x02\n\x06Header\x12\x11\n\tstream_id\x18\x01 \x02(\t\x12\x11\n\ttimestamp\x18\x02 \x02(\x03\x12\x11\n\tmime_type\x18\x03 \x02(\t\x12\r\n\x05topic\x18\x04 \x02(\t\x12\x14\n\x0ctotal_length\x18\x05 \x01(\x04\x12\x44\n\nattributes\x18\x06 \x03(\x0b\x32\x30.livekit.proto.DataStream.Header.AttributesEntry\x12;\n\x0btext_header\x18\x07 \x01(\x0b\x32$.livekit.proto.DataStream.TextHeaderH\x00\x12;\n\x0b\x62yte_header\x18\x08 \x01(\x0b\x32$.livekit.proto.DataStream.ByteHeaderH\x00\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x10\n\x0e\x63ontent_header\x1a]\n\x05\x43hunk\x12\x11\n\tstream_id\x18\x01 \x02(\t\x12\x13\n\x0b\x63hunk_index\x18\x02 \x02(\x04\x12\x0f\n\x07\x63ontent\x18\x03 \x02(\x0c\x12\x0f\n\x07version\x18\x04 \x01(\x05\x12\n\n\x02iv\x18\x05 \x01(\x0c\x1a\xa6\x01\n\x07Trailer\x12\x11\n\tstream_id\x18\x01 \x02(\t\x12\x0e\n\x06reason\x18\x02 \x02(\t\x12\x45\n\nattributes\x18\x03 \x03(\x0b\x32\x31.livekit.proto.DataStream.Trailer.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"A\n\rOperationType\x12\n\n\x06\x43REATE\x10\x00\x12\n\n\x06UPDATE\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x12\x0c\n\x08REACTION\x10\x03\"j\n\x18\x44\x61taStreamHeaderReceived\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x30\n\x06header\x18\x02 \x02(\x0b\x32 .livekit.proto.DataStream.Header\"g\n\x17\x44\x61taStreamChunkReceived\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12.\n\x05\x63hunk\x18\x02 \x02(\x0b\x32\x1f.livekit.proto.DataStream.Chunk\"m\n\x19\x44\x61taStreamTrailerReceived\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x32\n\x07trailer\x18\x02 \x02(\x0b\x32!.livekit.proto.DataStream.Trailer\"\xa6\x01\n\x17SendStreamHeaderRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x30\n\x06header\x18\x02 \x02(\x0b\x32 .livekit.proto.DataStream.Header\x12\x1e\n\x16\x64\x65stination_identities\x18\x03 \x03(\t\x12\x17\n\x0fsender_identity\x18\x04 \x02(\t\"\xa3\x01\n\x16SendStreamChunkRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12.\n\x05\x63hunk\x18\x02 \x02(\x0b\x32\x1f.livekit.proto.DataStream.Chunk\x12\x1e\n\x16\x64\x65stination_identities\x18\x03 \x03(\t\x12\x17\n\x0fsender_identity\x18\x04 \x02(\t\"\xa9\x01\n\x18SendStreamTrailerRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x32\n\x07trailer\x18\x02 \x02(\x0b\x32!.livekit.proto.DataStream.Trailer\x12\x1e\n\x16\x64\x65stination_identities\x18\x03 \x03(\t\x12\x17\n\x0fsender_identity\x18\x04 \x02(\t\",\n\x18SendStreamHeaderResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"+\n\x17SendStreamChunkResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"-\n\x19SendStreamTrailerResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\";\n\x18SendStreamHeaderCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\":\n\x17SendStreamChunkCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"<\n\x19SendStreamTrailerCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\x93\x01\n/SetDataChannelBufferedAmountLowThresholdRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x11\n\tthreshold\x18\x02 \x02(\x04\x12+\n\x04kind\x18\x03 \x02(\x0e\x32\x1d.livekit.proto.DataPacketKind\"2\n0SetDataChannelBufferedAmountLowThresholdResponse\"n\n,DataChannelBufferedAmountLowThresholdChanged\x12+\n\x04kind\x18\x01 \x02(\x0e\x32\x1d.livekit.proto.DataPacketKind\x12\x11\n\tthreshold\x18\x02 \x02(\x04*P\n\x10IceTransportType\x12\x13\n\x0fTRANSPORT_RELAY\x10\x00\x12\x14\n\x10TRANSPORT_NOHOST\x10\x01\x12\x11\n\rTRANSPORT_ALL\x10\x02*C\n\x18\x43ontinualGatheringPolicy\x12\x0f\n\x0bGATHER_ONCE\x10\x00\x12\x16\n\x12GATHER_CONTINUALLY\x10\x01*`\n\x11\x43onnectionQuality\x12\x10\n\x0cQUALITY_POOR\x10\x00\x12\x10\n\x0cQUALITY_GOOD\x10\x01\x12\x15\n\x11QUALITY_EXCELLENT\x10\x02\x12\x10\n\x0cQUALITY_LOST\x10\x03*S\n\x0f\x43onnectionState\x12\x15\n\x11\x43ONN_DISCONNECTED\x10\x00\x12\x12\n\x0e\x43ONN_CONNECTED\x10\x01\x12\x15\n\x11\x43ONN_RECONNECTING\x10\x02*3\n\x0e\x44\x61taPacketKind\x12\x0e\n\nKIND_LOSSY\x10\x00\x12\x11\n\rKIND_RELIABLE\x10\x01\x42\x10\xaa\x02\rLiveKit.Proto') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -30,18 +30,20 @@ _globals['DESCRIPTOR']._serialized_options = b'\252\002\rLiveKit.Proto' _globals['_PUBLISHDATAREQUEST'].fields_by_name['destination_sids']._loaded_options = None _globals['_PUBLISHDATAREQUEST'].fields_by_name['destination_sids']._serialized_options = b'\030\001' - _globals['_DATASTREAM_HEADER_EXTENSIONSENTRY']._loaded_options = None - _globals['_DATASTREAM_HEADER_EXTENSIONSENTRY']._serialized_options = b'8\001' - _globals['_ICETRANSPORTTYPE']._serialized_start=10082 - _globals['_ICETRANSPORTTYPE']._serialized_end=10162 - _globals['_CONTINUALGATHERINGPOLICY']._serialized_start=10164 - _globals['_CONTINUALGATHERINGPOLICY']._serialized_end=10231 - _globals['_CONNECTIONQUALITY']._serialized_start=10233 - _globals['_CONNECTIONQUALITY']._serialized_end=10329 - _globals['_CONNECTIONSTATE']._serialized_start=10331 - _globals['_CONNECTIONSTATE']._serialized_end=10414 - _globals['_DATAPACKETKIND']._serialized_start=10416 - _globals['_DATAPACKETKIND']._serialized_end=10467 + _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._loaded_options = None + _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_options = b'8\001' + _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._loaded_options = None + _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_options = b'8\001' + _globals['_ICETRANSPORTTYPE']._serialized_start=11988 + _globals['_ICETRANSPORTTYPE']._serialized_end=12068 + _globals['_CONTINUALGATHERINGPOLICY']._serialized_start=12070 + _globals['_CONTINUALGATHERINGPOLICY']._serialized_end=12137 + _globals['_CONNECTIONQUALITY']._serialized_start=12139 + _globals['_CONNECTIONQUALITY']._serialized_end=12235 + _globals['_CONNECTIONSTATE']._serialized_start=12237 + _globals['_CONNECTIONSTATE']._serialized_end=12320 + _globals['_DATAPACKETKIND']._serialized_start=12322 + _globals['_DATAPACKETKIND']._serialized_end=12373 _globals['_CONNECTREQUEST']._serialized_start=119 _globals['_CONNECTREQUEST']._serialized_end=208 _globals['_CONNECTRESPONSE']._serialized_start=210 @@ -147,87 +149,121 @@ _globals['_OWNEDBUFFER']._serialized_start=4699 _globals['_OWNEDBUFFER']._serialized_end=4800 _globals['_ROOMEVENT']._serialized_start=4803 - _globals['_ROOMEVENT']._serialized_end=6804 - _globals['_ROOMINFO']._serialized_start=6806 - _globals['_ROOMINFO']._serialized_end=6861 - _globals['_OWNEDROOM']._serialized_start=6863 - _globals['_OWNEDROOM']._serialized_end=6960 - _globals['_PARTICIPANTCONNECTED']._serialized_start=6962 - _globals['_PARTICIPANTCONNECTED']._serialized_end=7031 - _globals['_PARTICIPANTDISCONNECTED']._serialized_start=7033 - _globals['_PARTICIPANTDISCONNECTED']._serialized_end=7088 - _globals['_LOCALTRACKPUBLISHED']._serialized_start=7090 - _globals['_LOCALTRACKPUBLISHED']._serialized_end=7130 - _globals['_LOCALTRACKUNPUBLISHED']._serialized_start=7132 - _globals['_LOCALTRACKUNPUBLISHED']._serialized_end=7180 - _globals['_LOCALTRACKSUBSCRIBED']._serialized_start=7182 - _globals['_LOCALTRACKSUBSCRIBED']._serialized_end=7223 - _globals['_TRACKPUBLISHED']._serialized_start=7225 - _globals['_TRACKPUBLISHED']._serialized_end=7330 - _globals['_TRACKUNPUBLISHED']._serialized_start=7332 - _globals['_TRACKUNPUBLISHED']._serialized_end=7405 - _globals['_TRACKSUBSCRIBED']._serialized_start=7407 - _globals['_TRACKSUBSCRIBED']._serialized_end=7496 - _globals['_TRACKUNSUBSCRIBED']._serialized_start=7498 - _globals['_TRACKUNSUBSCRIBED']._serialized_end=7566 - _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_start=7568 - _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_end=7657 - _globals['_TRACKMUTED']._serialized_start=7659 - _globals['_TRACKMUTED']._serialized_end=7720 - _globals['_TRACKUNMUTED']._serialized_start=7722 - _globals['_TRACKUNMUTED']._serialized_end=7785 - _globals['_E2EESTATECHANGED']._serialized_start=7787 - _globals['_E2EESTATECHANGED']._serialized_end=7882 - _globals['_ACTIVESPEAKERSCHANGED']._serialized_start=7884 - _globals['_ACTIVESPEAKERSCHANGED']._serialized_end=7939 - _globals['_ROOMMETADATACHANGED']._serialized_start=7941 - _globals['_ROOMMETADATACHANGED']._serialized_end=7980 - _globals['_ROOMSIDCHANGED']._serialized_start=7982 - _globals['_ROOMSIDCHANGED']._serialized_end=8011 - _globals['_PARTICIPANTMETADATACHANGED']._serialized_start=8013 - _globals['_PARTICIPANTMETADATACHANGED']._serialized_end=8089 - _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_start=8092 - _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_end=8264 - _globals['_PARTICIPANTNAMECHANGED']._serialized_start=8266 - _globals['_PARTICIPANTNAMECHANGED']._serialized_end=8334 - _globals['_CONNECTIONQUALITYCHANGED']._serialized_start=8336 - _globals['_CONNECTIONQUALITYCHANGED']._serialized_end=8443 - _globals['_USERPACKET']._serialized_start=8445 - _globals['_USERPACKET']._serialized_end=8514 - _globals['_CHATMESSAGE']._serialized_start=8516 - _globals['_CHATMESSAGE']._serialized_end=8637 - _globals['_CHATMESSAGERECEIVED']._serialized_start=8639 - _globals['_CHATMESSAGERECEIVED']._serialized_end=8735 - _globals['_SIPDTMF']._serialized_start=8737 - _globals['_SIPDTMF']._serialized_end=8775 - _globals['_DATAPACKETRECEIVED']._serialized_start=8778 - _globals['_DATAPACKETRECEIVED']._serialized_end=8969 - _globals['_TRANSCRIPTIONRECEIVED']._serialized_start=8971 - _globals['_TRANSCRIPTIONRECEIVED']._serialized_end=9098 - _globals['_CONNECTIONSTATECHANGED']._serialized_start=9100 - _globals['_CONNECTIONSTATECHANGED']._serialized_end=9171 - _globals['_CONNECTED']._serialized_start=9173 - _globals['_CONNECTED']._serialized_end=9184 - _globals['_DISCONNECTED']._serialized_start=9186 - _globals['_DISCONNECTED']._serialized_end=9249 - _globals['_RECONNECTING']._serialized_start=9251 - _globals['_RECONNECTING']._serialized_end=9265 - _globals['_RECONNECTED']._serialized_start=9267 - _globals['_RECONNECTED']._serialized_end=9280 - _globals['_ROOMEOS']._serialized_start=9282 - _globals['_ROOMEOS']._serialized_end=9291 - _globals['_DATASTREAM']._serialized_start=9294 - _globals['_DATASTREAM']._serialized_end=10080 - _globals['_DATASTREAM_TEXTHEADER']._serialized_start=9309 - _globals['_DATASTREAM_TEXTHEADER']._serialized_end=9479 - _globals['_DATASTREAM_FILEHEADER']._serialized_start=9481 - _globals['_DATASTREAM_FILEHEADER']._serialized_end=9512 - _globals['_DATASTREAM_HEADER']._serialized_start=9515 - _globals['_DATASTREAM_HEADER']._serialized_end=9900 - _globals['_DATASTREAM_HEADER_EXTENSIONSENTRY']._serialized_start=9833 - _globals['_DATASTREAM_HEADER_EXTENSIONSENTRY']._serialized_end=9882 - _globals['_DATASTREAM_CHUNK']._serialized_start=9902 - _globals['_DATASTREAM_CHUNK']._serialized_end=10013 - _globals['_DATASTREAM_OPERATIONTYPE']._serialized_start=10015 - _globals['_DATASTREAM_OPERATIONTYPE']._serialized_end=10080 + _globals['_ROOMEVENT']._serialized_end=7020 + _globals['_ROOMINFO']._serialized_start=7023 + _globals['_ROOMINFO']._serialized_end=7177 + _globals['_OWNEDROOM']._serialized_start=7179 + _globals['_OWNEDROOM']._serialized_end=7276 + _globals['_PARTICIPANTCONNECTED']._serialized_start=7278 + _globals['_PARTICIPANTCONNECTED']._serialized_end=7347 + _globals['_PARTICIPANTDISCONNECTED']._serialized_start=7349 + _globals['_PARTICIPANTDISCONNECTED']._serialized_end=7404 + _globals['_LOCALTRACKPUBLISHED']._serialized_start=7406 + _globals['_LOCALTRACKPUBLISHED']._serialized_end=7446 + _globals['_LOCALTRACKUNPUBLISHED']._serialized_start=7448 + _globals['_LOCALTRACKUNPUBLISHED']._serialized_end=7496 + _globals['_LOCALTRACKSUBSCRIBED']._serialized_start=7498 + _globals['_LOCALTRACKSUBSCRIBED']._serialized_end=7539 + _globals['_TRACKPUBLISHED']._serialized_start=7541 + _globals['_TRACKPUBLISHED']._serialized_end=7646 + _globals['_TRACKUNPUBLISHED']._serialized_start=7648 + _globals['_TRACKUNPUBLISHED']._serialized_end=7721 + _globals['_TRACKSUBSCRIBED']._serialized_start=7723 + _globals['_TRACKSUBSCRIBED']._serialized_end=7812 + _globals['_TRACKUNSUBSCRIBED']._serialized_start=7814 + _globals['_TRACKUNSUBSCRIBED']._serialized_end=7882 + _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_start=7884 + _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_end=7973 + _globals['_TRACKMUTED']._serialized_start=7975 + _globals['_TRACKMUTED']._serialized_end=8036 + _globals['_TRACKUNMUTED']._serialized_start=8038 + _globals['_TRACKUNMUTED']._serialized_end=8101 + _globals['_E2EESTATECHANGED']._serialized_start=8103 + _globals['_E2EESTATECHANGED']._serialized_end=8198 + _globals['_ACTIVESPEAKERSCHANGED']._serialized_start=8200 + _globals['_ACTIVESPEAKERSCHANGED']._serialized_end=8255 + _globals['_ROOMMETADATACHANGED']._serialized_start=8257 + _globals['_ROOMMETADATACHANGED']._serialized_end=8296 + _globals['_ROOMSIDCHANGED']._serialized_start=8298 + _globals['_ROOMSIDCHANGED']._serialized_end=8327 + _globals['_PARTICIPANTMETADATACHANGED']._serialized_start=8329 + _globals['_PARTICIPANTMETADATACHANGED']._serialized_end=8405 + _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_start=8408 + _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_end=8580 + _globals['_PARTICIPANTNAMECHANGED']._serialized_start=8582 + _globals['_PARTICIPANTNAMECHANGED']._serialized_end=8650 + _globals['_CONNECTIONQUALITYCHANGED']._serialized_start=8652 + _globals['_CONNECTIONQUALITYCHANGED']._serialized_end=8759 + _globals['_USERPACKET']._serialized_start=8761 + _globals['_USERPACKET']._serialized_end=8830 + _globals['_CHATMESSAGE']._serialized_start=8832 + _globals['_CHATMESSAGE']._serialized_end=8953 + _globals['_CHATMESSAGERECEIVED']._serialized_start=8955 + _globals['_CHATMESSAGERECEIVED']._serialized_end=9051 + _globals['_SIPDTMF']._serialized_start=9053 + _globals['_SIPDTMF']._serialized_end=9091 + _globals['_DATAPACKETRECEIVED']._serialized_start=9094 + _globals['_DATAPACKETRECEIVED']._serialized_end=9285 + _globals['_TRANSCRIPTIONRECEIVED']._serialized_start=9287 + _globals['_TRANSCRIPTIONRECEIVED']._serialized_end=9414 + _globals['_CONNECTIONSTATECHANGED']._serialized_start=9416 + _globals['_CONNECTIONSTATECHANGED']._serialized_end=9487 + _globals['_CONNECTED']._serialized_start=9489 + _globals['_CONNECTED']._serialized_end=9500 + _globals['_DISCONNECTED']._serialized_start=9502 + _globals['_DISCONNECTED']._serialized_end=9565 + _globals['_RECONNECTING']._serialized_start=9567 + _globals['_RECONNECTING']._serialized_end=9581 + _globals['_RECONNECTED']._serialized_start=9583 + _globals['_RECONNECTED']._serialized_end=9596 + _globals['_ROOMEOS']._serialized_start=9598 + _globals['_ROOMEOS']._serialized_end=9607 + _globals['_DATASTREAM']._serialized_start=9610 + _globals['_DATASTREAM']._serialized_end=10520 + _globals['_DATASTREAM_TEXTHEADER']._serialized_start=9625 + _globals['_DATASTREAM_TEXTHEADER']._serialized_end=9795 + _globals['_DATASTREAM_BYTEHEADER']._serialized_start=9797 + _globals['_DATASTREAM_BYTEHEADER']._serialized_end=9823 + _globals['_DATASTREAM_HEADER']._serialized_start=9826 + _globals['_DATASTREAM_HEADER']._serialized_end=10189 + _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_start=10122 + _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_end=10171 + _globals['_DATASTREAM_CHUNK']._serialized_start=10191 + _globals['_DATASTREAM_CHUNK']._serialized_end=10284 + _globals['_DATASTREAM_TRAILER']._serialized_start=10287 + _globals['_DATASTREAM_TRAILER']._serialized_end=10453 + _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_start=10122 + _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_end=10171 + _globals['_DATASTREAM_OPERATIONTYPE']._serialized_start=10455 + _globals['_DATASTREAM_OPERATIONTYPE']._serialized_end=10520 + _globals['_DATASTREAMHEADERRECEIVED']._serialized_start=10522 + _globals['_DATASTREAMHEADERRECEIVED']._serialized_end=10628 + _globals['_DATASTREAMCHUNKRECEIVED']._serialized_start=10630 + _globals['_DATASTREAMCHUNKRECEIVED']._serialized_end=10733 + _globals['_DATASTREAMTRAILERRECEIVED']._serialized_start=10735 + _globals['_DATASTREAMTRAILERRECEIVED']._serialized_end=10844 + _globals['_SENDSTREAMHEADERREQUEST']._serialized_start=10847 + _globals['_SENDSTREAMHEADERREQUEST']._serialized_end=11013 + _globals['_SENDSTREAMCHUNKREQUEST']._serialized_start=11016 + _globals['_SENDSTREAMCHUNKREQUEST']._serialized_end=11179 + _globals['_SENDSTREAMTRAILERREQUEST']._serialized_start=11182 + _globals['_SENDSTREAMTRAILERREQUEST']._serialized_end=11351 + _globals['_SENDSTREAMHEADERRESPONSE']._serialized_start=11353 + _globals['_SENDSTREAMHEADERRESPONSE']._serialized_end=11397 + _globals['_SENDSTREAMCHUNKRESPONSE']._serialized_start=11399 + _globals['_SENDSTREAMCHUNKRESPONSE']._serialized_end=11442 + _globals['_SENDSTREAMTRAILERRESPONSE']._serialized_start=11444 + _globals['_SENDSTREAMTRAILERRESPONSE']._serialized_end=11489 + _globals['_SENDSTREAMHEADERCALLBACK']._serialized_start=11491 + _globals['_SENDSTREAMHEADERCALLBACK']._serialized_end=11550 + _globals['_SENDSTREAMCHUNKCALLBACK']._serialized_start=11552 + _globals['_SENDSTREAMCHUNKCALLBACK']._serialized_end=11610 + _globals['_SENDSTREAMTRAILERCALLBACK']._serialized_start=11612 + _globals['_SENDSTREAMTRAILERCALLBACK']._serialized_end=11672 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDREQUEST']._serialized_start=11675 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDREQUEST']._serialized_end=11822 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDRESPONSE']._serialized_start=11824 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDRESPONSE']._serialized_end=11874 + _globals['_DATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDCHANGED']._serialized_start=11876 + _globals['_DATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDCHANGED']._serialized_end=11986 # @@protoc_insertion_point(module_scope) diff --git a/livekit-rtc/livekit/rtc/_proto/room_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/room_pb2.pyi index f78a2403..9607bfb0 100644 --- a/livekit-rtc/livekit/rtc/_proto/room_pb2.pyi +++ b/livekit-rtc/livekit/rtc/_proto/room_pb2.pyi @@ -1264,8 +1264,10 @@ class RoomEvent(google.protobuf.message.Message): DATA_PACKET_RECEIVED_FIELD_NUMBER: builtins.int TRANSCRIPTION_RECEIVED_FIELD_NUMBER: builtins.int CHAT_MESSAGE_FIELD_NUMBER: builtins.int - STREAM_HEADER_FIELD_NUMBER: builtins.int - STREAM_CHUNK_FIELD_NUMBER: builtins.int + STREAM_HEADER_RECEIVED_FIELD_NUMBER: builtins.int + STREAM_CHUNK_RECEIVED_FIELD_NUMBER: builtins.int + STREAM_TRAILER_RECEIVED_FIELD_NUMBER: builtins.int + DATA_CHANNEL_LOW_THRESHOLD_CHANGED_FIELD_NUMBER: builtins.int room_handle: builtins.int @property def participant_connected(self) -> global___ParticipantConnected: ... @@ -1328,9 +1330,13 @@ class RoomEvent(google.protobuf.message.Message): @property def chat_message(self) -> global___ChatMessageReceived: ... @property - def stream_header(self) -> global___DataStream.Header: ... + def stream_header_received(self) -> global___DataStreamHeaderReceived: ... @property - def stream_chunk(self) -> global___DataStream.Chunk: ... + def stream_chunk_received(self) -> global___DataStreamChunkReceived: ... + @property + def stream_trailer_received(self) -> global___DataStreamTrailerReceived: ... + @property + def data_channel_low_threshold_changed(self) -> global___DataChannelBufferedAmountLowThresholdChanged: ... def __init__( self, *, @@ -1363,12 +1369,14 @@ class RoomEvent(google.protobuf.message.Message): data_packet_received: global___DataPacketReceived | None = ..., transcription_received: global___TranscriptionReceived | None = ..., chat_message: global___ChatMessageReceived | None = ..., - stream_header: global___DataStream.Header | None = ..., - stream_chunk: global___DataStream.Chunk | None = ..., + stream_header_received: global___DataStreamHeaderReceived | None = ..., + stream_chunk_received: global___DataStreamChunkReceived | None = ..., + stream_trailer_received: global___DataStreamTrailerReceived | None = ..., + data_channel_low_threshold_changed: global___DataChannelBufferedAmountLowThresholdChanged | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["active_speakers_changed", b"active_speakers_changed", "chat_message", b"chat_message", "connection_quality_changed", b"connection_quality_changed", "connection_state_changed", b"connection_state_changed", "data_packet_received", b"data_packet_received", "disconnected", b"disconnected", "e2ee_state_changed", b"e2ee_state_changed", "eos", b"eos", "local_track_published", b"local_track_published", "local_track_subscribed", b"local_track_subscribed", "local_track_unpublished", b"local_track_unpublished", "message", b"message", "participant_attributes_changed", b"participant_attributes_changed", "participant_connected", b"participant_connected", "participant_disconnected", b"participant_disconnected", "participant_metadata_changed", b"participant_metadata_changed", "participant_name_changed", b"participant_name_changed", "reconnected", b"reconnected", "reconnecting", b"reconnecting", "room_handle", b"room_handle", "room_metadata_changed", b"room_metadata_changed", "room_sid_changed", b"room_sid_changed", "stream_chunk", b"stream_chunk", "stream_header", b"stream_header", "track_muted", b"track_muted", "track_published", b"track_published", "track_subscribed", b"track_subscribed", "track_subscription_failed", b"track_subscription_failed", "track_unmuted", b"track_unmuted", "track_unpublished", b"track_unpublished", "track_unsubscribed", b"track_unsubscribed", "transcription_received", b"transcription_received"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["active_speakers_changed", b"active_speakers_changed", "chat_message", b"chat_message", "connection_quality_changed", b"connection_quality_changed", "connection_state_changed", b"connection_state_changed", "data_packet_received", b"data_packet_received", "disconnected", b"disconnected", "e2ee_state_changed", b"e2ee_state_changed", "eos", b"eos", "local_track_published", b"local_track_published", "local_track_subscribed", b"local_track_subscribed", "local_track_unpublished", b"local_track_unpublished", "message", b"message", "participant_attributes_changed", b"participant_attributes_changed", "participant_connected", b"participant_connected", "participant_disconnected", b"participant_disconnected", "participant_metadata_changed", b"participant_metadata_changed", "participant_name_changed", b"participant_name_changed", "reconnected", b"reconnected", "reconnecting", b"reconnecting", "room_handle", b"room_handle", "room_metadata_changed", b"room_metadata_changed", "room_sid_changed", b"room_sid_changed", "stream_chunk", b"stream_chunk", "stream_header", b"stream_header", "track_muted", b"track_muted", "track_published", b"track_published", "track_subscribed", b"track_subscribed", "track_subscription_failed", b"track_subscription_failed", "track_unmuted", b"track_unmuted", "track_unpublished", b"track_unpublished", "track_unsubscribed", b"track_unsubscribed", "transcription_received", b"transcription_received"]) -> None: ... - def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["participant_connected", "participant_disconnected", "local_track_published", "local_track_unpublished", "local_track_subscribed", "track_published", "track_unpublished", "track_subscribed", "track_unsubscribed", "track_subscription_failed", "track_muted", "track_unmuted", "active_speakers_changed", "room_metadata_changed", "room_sid_changed", "participant_metadata_changed", "participant_name_changed", "participant_attributes_changed", "connection_quality_changed", "connection_state_changed", "disconnected", "reconnecting", "reconnected", "e2ee_state_changed", "eos", "data_packet_received", "transcription_received", "chat_message", "stream_header", "stream_chunk"] | None: ... + def HasField(self, field_name: typing.Literal["active_speakers_changed", b"active_speakers_changed", "chat_message", b"chat_message", "connection_quality_changed", b"connection_quality_changed", "connection_state_changed", b"connection_state_changed", "data_channel_low_threshold_changed", b"data_channel_low_threshold_changed", "data_packet_received", b"data_packet_received", "disconnected", b"disconnected", "e2ee_state_changed", b"e2ee_state_changed", "eos", b"eos", "local_track_published", b"local_track_published", "local_track_subscribed", b"local_track_subscribed", "local_track_unpublished", b"local_track_unpublished", "message", b"message", "participant_attributes_changed", b"participant_attributes_changed", "participant_connected", b"participant_connected", "participant_disconnected", b"participant_disconnected", "participant_metadata_changed", b"participant_metadata_changed", "participant_name_changed", b"participant_name_changed", "reconnected", b"reconnected", "reconnecting", b"reconnecting", "room_handle", b"room_handle", "room_metadata_changed", b"room_metadata_changed", "room_sid_changed", b"room_sid_changed", "stream_chunk_received", b"stream_chunk_received", "stream_header_received", b"stream_header_received", "stream_trailer_received", b"stream_trailer_received", "track_muted", b"track_muted", "track_published", b"track_published", "track_subscribed", b"track_subscribed", "track_subscription_failed", b"track_subscription_failed", "track_unmuted", b"track_unmuted", "track_unpublished", b"track_unpublished", "track_unsubscribed", b"track_unsubscribed", "transcription_received", b"transcription_received"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["active_speakers_changed", b"active_speakers_changed", "chat_message", b"chat_message", "connection_quality_changed", b"connection_quality_changed", "connection_state_changed", b"connection_state_changed", "data_channel_low_threshold_changed", b"data_channel_low_threshold_changed", "data_packet_received", b"data_packet_received", "disconnected", b"disconnected", "e2ee_state_changed", b"e2ee_state_changed", "eos", b"eos", "local_track_published", b"local_track_published", "local_track_subscribed", b"local_track_subscribed", "local_track_unpublished", b"local_track_unpublished", "message", b"message", "participant_attributes_changed", b"participant_attributes_changed", "participant_connected", b"participant_connected", "participant_disconnected", b"participant_disconnected", "participant_metadata_changed", b"participant_metadata_changed", "participant_name_changed", b"participant_name_changed", "reconnected", b"reconnected", "reconnecting", b"reconnecting", "room_handle", b"room_handle", "room_metadata_changed", b"room_metadata_changed", "room_sid_changed", b"room_sid_changed", "stream_chunk_received", b"stream_chunk_received", "stream_header_received", b"stream_header_received", "stream_trailer_received", b"stream_trailer_received", "track_muted", b"track_muted", "track_published", b"track_published", "track_subscribed", b"track_subscribed", "track_subscription_failed", b"track_subscription_failed", "track_unmuted", b"track_unmuted", "track_unpublished", b"track_unpublished", "track_unsubscribed", b"track_unsubscribed", "transcription_received", b"transcription_received"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["participant_connected", "participant_disconnected", "local_track_published", "local_track_unpublished", "local_track_subscribed", "track_published", "track_unpublished", "track_subscribed", "track_unsubscribed", "track_subscription_failed", "track_muted", "track_unmuted", "active_speakers_changed", "room_metadata_changed", "room_sid_changed", "participant_metadata_changed", "participant_name_changed", "participant_attributes_changed", "connection_quality_changed", "connection_state_changed", "disconnected", "reconnecting", "reconnected", "e2ee_state_changed", "eos", "data_packet_received", "transcription_received", "chat_message", "stream_header_received", "stream_chunk_received", "stream_trailer_received", "data_channel_low_threshold_changed"] | None: ... global___RoomEvent = RoomEvent @@ -1379,18 +1387,24 @@ class RoomInfo(google.protobuf.message.Message): SID_FIELD_NUMBER: builtins.int NAME_FIELD_NUMBER: builtins.int METADATA_FIELD_NUMBER: builtins.int + LOSSY_DC_BUFFERED_AMOUNT_LOW_THRESHOLD_FIELD_NUMBER: builtins.int + RELIABLE_DC_BUFFERED_AMOUNT_LOW_THRESHOLD_FIELD_NUMBER: builtins.int sid: builtins.str name: builtins.str metadata: builtins.str + lossy_dc_buffered_amount_low_threshold: builtins.int + reliable_dc_buffered_amount_low_threshold: builtins.int def __init__( self, *, sid: builtins.str | None = ..., name: builtins.str | None = ..., metadata: builtins.str | None = ..., + lossy_dc_buffered_amount_low_threshold: builtins.int | None = ..., + reliable_dc_buffered_amount_low_threshold: builtins.int | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["metadata", b"metadata", "name", b"name", "sid", b"sid"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["metadata", b"metadata", "name", b"name", "sid", b"sid"]) -> None: ... + def HasField(self, field_name: typing.Literal["lossy_dc_buffered_amount_low_threshold", b"lossy_dc_buffered_amount_low_threshold", "metadata", b"metadata", "name", b"name", "reliable_dc_buffered_amount_low_threshold", b"reliable_dc_buffered_amount_low_threshold", "sid", b"sid"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["lossy_dc_buffered_amount_low_threshold", b"lossy_dc_buffered_amount_low_threshold", "metadata", b"metadata", "name", b"name", "reliable_dc_buffered_amount_low_threshold", b"reliable_dc_buffered_amount_low_threshold", "sid", b"sid"]) -> None: ... global___RoomInfo = RoomInfo @@ -2063,21 +2077,20 @@ class DataStream(google.protobuf.message.Message): def ClearField(self, field_name: typing.Literal["attached_stream_ids", b"attached_stream_ids", "generated", b"generated", "operation_type", b"operation_type", "reply_to_stream_id", b"reply_to_stream_id", "version", b"version"]) -> None: ... @typing.final - class FileHeader(google.protobuf.message.Message): - """header properties specific to file or image streams""" + class ByteHeader(google.protobuf.message.Message): + """header properties specific to byte or file streams""" DESCRIPTOR: google.protobuf.descriptor.Descriptor - FILE_NAME_FIELD_NUMBER: builtins.int - file_name: builtins.str - """name of the file""" + NAME_FIELD_NUMBER: builtins.int + name: builtins.str def __init__( self, *, - file_name: builtins.str | None = ..., + name: builtins.str | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["file_name", b"file_name"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["file_name", b"file_name"]) -> None: ... + def HasField(self, field_name: typing.Literal["name", b"name"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... @typing.final class Header(google.protobuf.message.Message): @@ -2086,7 +2099,7 @@ class DataStream(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final - class ExtensionsEntry(google.protobuf.message.Message): + class AttributesEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor KEY_FIELD_NUMBER: builtins.int @@ -2104,47 +2117,43 @@ class DataStream(google.protobuf.message.Message): STREAM_ID_FIELD_NUMBER: builtins.int TIMESTAMP_FIELD_NUMBER: builtins.int - TOPIC_FIELD_NUMBER: builtins.int MIME_TYPE_FIELD_NUMBER: builtins.int + TOPIC_FIELD_NUMBER: builtins.int TOTAL_LENGTH_FIELD_NUMBER: builtins.int - TOTAL_CHUNKS_FIELD_NUMBER: builtins.int - EXTENSIONS_FIELD_NUMBER: builtins.int + ATTRIBUTES_FIELD_NUMBER: builtins.int TEXT_HEADER_FIELD_NUMBER: builtins.int - FILE_HEADER_FIELD_NUMBER: builtins.int + BYTE_HEADER_FIELD_NUMBER: builtins.int stream_id: builtins.str """unique identifier for this data stream""" timestamp: builtins.int """using int64 for Unix timestamp""" - topic: builtins.str mime_type: builtins.str + topic: builtins.str total_length: builtins.int """only populated for finite streams, if it's a stream of unknown size this stays empty""" - total_chunks: builtins.int - """only populated for finite streams, if it's a stream of unknown size this stays empty""" @property - def extensions(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: - """user defined extensions map that can carry additional info""" + def attributes(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: + """user defined attributes map that can carry additional info""" @property def text_header(self) -> global___DataStream.TextHeader: ... @property - def file_header(self) -> global___DataStream.FileHeader: ... + def byte_header(self) -> global___DataStream.ByteHeader: ... def __init__( self, *, stream_id: builtins.str | None = ..., timestamp: builtins.int | None = ..., - topic: builtins.str | None = ..., mime_type: builtins.str | None = ..., + topic: builtins.str | None = ..., total_length: builtins.int | None = ..., - total_chunks: builtins.int | None = ..., - extensions: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., + attributes: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., text_header: global___DataStream.TextHeader | None = ..., - file_header: global___DataStream.FileHeader | None = ..., + byte_header: global___DataStream.ByteHeader | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["content_header", b"content_header", "file_header", b"file_header", "mime_type", b"mime_type", "stream_id", b"stream_id", "text_header", b"text_header", "timestamp", b"timestamp", "topic", b"topic", "total_chunks", b"total_chunks", "total_length", b"total_length"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["content_header", b"content_header", "extensions", b"extensions", "file_header", b"file_header", "mime_type", b"mime_type", "stream_id", b"stream_id", "text_header", b"text_header", "timestamp", b"timestamp", "topic", b"topic", "total_chunks", b"total_chunks", "total_length", b"total_length"]) -> None: ... - def WhichOneof(self, oneof_group: typing.Literal["content_header", b"content_header"]) -> typing.Literal["text_header", "file_header"] | None: ... + def HasField(self, field_name: typing.Literal["byte_header", b"byte_header", "content_header", b"content_header", "mime_type", b"mime_type", "stream_id", b"stream_id", "text_header", b"text_header", "timestamp", b"timestamp", "topic", b"topic", "total_length", b"total_length"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["attributes", b"attributes", "byte_header", b"byte_header", "content_header", b"content_header", "mime_type", b"mime_type", "stream_id", b"stream_id", "text_header", b"text_header", "timestamp", b"timestamp", "topic", b"topic", "total_length", b"total_length"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["content_header", b"content_header"]) -> typing.Literal["text_header", "byte_header"] | None: ... @typing.final class Chunk(google.protobuf.message.Message): @@ -2153,7 +2162,6 @@ class DataStream(google.protobuf.message.Message): STREAM_ID_FIELD_NUMBER: builtins.int CHUNK_INDEX_FIELD_NUMBER: builtins.int CONTENT_FIELD_NUMBER: builtins.int - COMPLETE_FIELD_NUMBER: builtins.int VERSION_FIELD_NUMBER: builtins.int IV_FIELD_NUMBER: builtins.int stream_id: builtins.str @@ -2161,8 +2169,6 @@ class DataStream(google.protobuf.message.Message): chunk_index: builtins.int content: builtins.bytes """content as binary (bytes)""" - complete: builtins.bool - """true only if this is the last chunk of this stream - can also be sent with empty content""" version: builtins.int """a version indicating that this chunk_index has been retroactively modified and the original one needs to be replaced""" iv: builtins.bytes @@ -2173,15 +2179,353 @@ class DataStream(google.protobuf.message.Message): stream_id: builtins.str | None = ..., chunk_index: builtins.int | None = ..., content: builtins.bytes | None = ..., - complete: builtins.bool | None = ..., version: builtins.int | None = ..., iv: builtins.bytes | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["chunk_index", b"chunk_index", "complete", b"complete", "content", b"content", "iv", b"iv", "stream_id", b"stream_id", "version", b"version"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["chunk_index", b"chunk_index", "complete", b"complete", "content", b"content", "iv", b"iv", "stream_id", b"stream_id", "version", b"version"]) -> None: ... + def HasField(self, field_name: typing.Literal["chunk_index", b"chunk_index", "content", b"content", "iv", b"iv", "stream_id", b"stream_id", "version", b"version"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["chunk_index", b"chunk_index", "content", b"content", "iv", b"iv", "stream_id", b"stream_id", "version", b"version"]) -> None: ... + + @typing.final + class Trailer(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final + class AttributesEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: builtins.str + value: builtins.str + def __init__( + self, + *, + key: builtins.str | None = ..., + value: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... + + STREAM_ID_FIELD_NUMBER: builtins.int + REASON_FIELD_NUMBER: builtins.int + ATTRIBUTES_FIELD_NUMBER: builtins.int + stream_id: builtins.str + """unique identifier for this data stream""" + reason: builtins.str + """reason why the stream was closed (could contain "error" / "interrupted" / empty for expected end)""" + @property + def attributes(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: + """finalizing updates for the stream, can also include additional insights for errors or endTime for transcription""" + + def __init__( + self, + *, + stream_id: builtins.str | None = ..., + reason: builtins.str | None = ..., + attributes: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["reason", b"reason", "stream_id", b"stream_id"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["attributes", b"attributes", "reason", b"reason", "stream_id", b"stream_id"]) -> None: ... def __init__( self, ) -> None: ... global___DataStream = DataStream + +@typing.final +class DataStreamHeaderReceived(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARTICIPANT_IDENTITY_FIELD_NUMBER: builtins.int + HEADER_FIELD_NUMBER: builtins.int + participant_identity: builtins.str + @property + def header(self) -> global___DataStream.Header: ... + def __init__( + self, + *, + participant_identity: builtins.str | None = ..., + header: global___DataStream.Header | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["header", b"header", "participant_identity", b"participant_identity"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["header", b"header", "participant_identity", b"participant_identity"]) -> None: ... + +global___DataStreamHeaderReceived = DataStreamHeaderReceived + +@typing.final +class DataStreamChunkReceived(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARTICIPANT_IDENTITY_FIELD_NUMBER: builtins.int + CHUNK_FIELD_NUMBER: builtins.int + participant_identity: builtins.str + @property + def chunk(self) -> global___DataStream.Chunk: ... + def __init__( + self, + *, + participant_identity: builtins.str | None = ..., + chunk: global___DataStream.Chunk | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["chunk", b"chunk", "participant_identity", b"participant_identity"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["chunk", b"chunk", "participant_identity", b"participant_identity"]) -> None: ... + +global___DataStreamChunkReceived = DataStreamChunkReceived + +@typing.final +class DataStreamTrailerReceived(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARTICIPANT_IDENTITY_FIELD_NUMBER: builtins.int + TRAILER_FIELD_NUMBER: builtins.int + participant_identity: builtins.str + @property + def trailer(self) -> global___DataStream.Trailer: ... + def __init__( + self, + *, + participant_identity: builtins.str | None = ..., + trailer: global___DataStream.Trailer | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["participant_identity", b"participant_identity", "trailer", b"trailer"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["participant_identity", b"participant_identity", "trailer", b"trailer"]) -> None: ... + +global___DataStreamTrailerReceived = DataStreamTrailerReceived + +@typing.final +class SendStreamHeaderRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + LOCAL_PARTICIPANT_HANDLE_FIELD_NUMBER: builtins.int + HEADER_FIELD_NUMBER: builtins.int + DESTINATION_IDENTITIES_FIELD_NUMBER: builtins.int + SENDER_IDENTITY_FIELD_NUMBER: builtins.int + local_participant_handle: builtins.int + sender_identity: builtins.str + @property + def header(self) -> global___DataStream.Header: ... + @property + def destination_identities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, + *, + local_participant_handle: builtins.int | None = ..., + header: global___DataStream.Header | None = ..., + destination_identities: collections.abc.Iterable[builtins.str] | None = ..., + sender_identity: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["header", b"header", "local_participant_handle", b"local_participant_handle", "sender_identity", b"sender_identity"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["destination_identities", b"destination_identities", "header", b"header", "local_participant_handle", b"local_participant_handle", "sender_identity", b"sender_identity"]) -> None: ... + +global___SendStreamHeaderRequest = SendStreamHeaderRequest + +@typing.final +class SendStreamChunkRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + LOCAL_PARTICIPANT_HANDLE_FIELD_NUMBER: builtins.int + CHUNK_FIELD_NUMBER: builtins.int + DESTINATION_IDENTITIES_FIELD_NUMBER: builtins.int + SENDER_IDENTITY_FIELD_NUMBER: builtins.int + local_participant_handle: builtins.int + sender_identity: builtins.str + @property + def chunk(self) -> global___DataStream.Chunk: ... + @property + def destination_identities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, + *, + local_participant_handle: builtins.int | None = ..., + chunk: global___DataStream.Chunk | None = ..., + destination_identities: collections.abc.Iterable[builtins.str] | None = ..., + sender_identity: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["chunk", b"chunk", "local_participant_handle", b"local_participant_handle", "sender_identity", b"sender_identity"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["chunk", b"chunk", "destination_identities", b"destination_identities", "local_participant_handle", b"local_participant_handle", "sender_identity", b"sender_identity"]) -> None: ... + +global___SendStreamChunkRequest = SendStreamChunkRequest + +@typing.final +class SendStreamTrailerRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + LOCAL_PARTICIPANT_HANDLE_FIELD_NUMBER: builtins.int + TRAILER_FIELD_NUMBER: builtins.int + DESTINATION_IDENTITIES_FIELD_NUMBER: builtins.int + SENDER_IDENTITY_FIELD_NUMBER: builtins.int + local_participant_handle: builtins.int + sender_identity: builtins.str + @property + def trailer(self) -> global___DataStream.Trailer: ... + @property + def destination_identities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, + *, + local_participant_handle: builtins.int | None = ..., + trailer: global___DataStream.Trailer | None = ..., + destination_identities: collections.abc.Iterable[builtins.str] | None = ..., + sender_identity: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["local_participant_handle", b"local_participant_handle", "sender_identity", b"sender_identity", "trailer", b"trailer"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["destination_identities", b"destination_identities", "local_participant_handle", b"local_participant_handle", "sender_identity", b"sender_identity", "trailer", b"trailer"]) -> None: ... + +global___SendStreamTrailerRequest = SendStreamTrailerRequest + +@typing.final +class SendStreamHeaderResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ASYNC_ID_FIELD_NUMBER: builtins.int + async_id: builtins.int + def __init__( + self, + *, + async_id: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["async_id", b"async_id"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["async_id", b"async_id"]) -> None: ... + +global___SendStreamHeaderResponse = SendStreamHeaderResponse + +@typing.final +class SendStreamChunkResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ASYNC_ID_FIELD_NUMBER: builtins.int + async_id: builtins.int + def __init__( + self, + *, + async_id: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["async_id", b"async_id"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["async_id", b"async_id"]) -> None: ... + +global___SendStreamChunkResponse = SendStreamChunkResponse + +@typing.final +class SendStreamTrailerResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ASYNC_ID_FIELD_NUMBER: builtins.int + async_id: builtins.int + def __init__( + self, + *, + async_id: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["async_id", b"async_id"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["async_id", b"async_id"]) -> None: ... + +global___SendStreamTrailerResponse = SendStreamTrailerResponse + +@typing.final +class SendStreamHeaderCallback(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ASYNC_ID_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + async_id: builtins.int + error: builtins.str + def __init__( + self, + *, + async_id: builtins.int | None = ..., + error: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["async_id", b"async_id", "error", b"error"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["async_id", b"async_id", "error", b"error"]) -> None: ... + +global___SendStreamHeaderCallback = SendStreamHeaderCallback + +@typing.final +class SendStreamChunkCallback(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ASYNC_ID_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + async_id: builtins.int + error: builtins.str + def __init__( + self, + *, + async_id: builtins.int | None = ..., + error: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["async_id", b"async_id", "error", b"error"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["async_id", b"async_id", "error", b"error"]) -> None: ... + +global___SendStreamChunkCallback = SendStreamChunkCallback + +@typing.final +class SendStreamTrailerCallback(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ASYNC_ID_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + async_id: builtins.int + error: builtins.str + def __init__( + self, + *, + async_id: builtins.int | None = ..., + error: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["async_id", b"async_id", "error", b"error"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["async_id", b"async_id", "error", b"error"]) -> None: ... + +global___SendStreamTrailerCallback = SendStreamTrailerCallback + +@typing.final +class SetDataChannelBufferedAmountLowThresholdRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + LOCAL_PARTICIPANT_HANDLE_FIELD_NUMBER: builtins.int + THRESHOLD_FIELD_NUMBER: builtins.int + KIND_FIELD_NUMBER: builtins.int + local_participant_handle: builtins.int + threshold: builtins.int + kind: global___DataPacketKind.ValueType + def __init__( + self, + *, + local_participant_handle: builtins.int | None = ..., + threshold: builtins.int | None = ..., + kind: global___DataPacketKind.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kind", b"kind", "local_participant_handle", b"local_participant_handle", "threshold", b"threshold"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kind", b"kind", "local_participant_handle", b"local_participant_handle", "threshold", b"threshold"]) -> None: ... + +global___SetDataChannelBufferedAmountLowThresholdRequest = SetDataChannelBufferedAmountLowThresholdRequest + +@typing.final +class SetDataChannelBufferedAmountLowThresholdResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + def __init__( + self, + ) -> None: ... + +global___SetDataChannelBufferedAmountLowThresholdResponse = SetDataChannelBufferedAmountLowThresholdResponse + +@typing.final +class DataChannelBufferedAmountLowThresholdChanged(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KIND_FIELD_NUMBER: builtins.int + THRESHOLD_FIELD_NUMBER: builtins.int + kind: global___DataPacketKind.ValueType + threshold: builtins.int + def __init__( + self, + *, + kind: global___DataPacketKind.ValueType | None = ..., + threshold: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kind", b"kind", "threshold", b"threshold"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kind", b"kind", "threshold", b"threshold"]) -> None: ... + +global___DataChannelBufferedAmountLowThresholdChanged = DataChannelBufferedAmountLowThresholdChanged diff --git a/livekit-rtc/livekit/rtc/_proto/video_frame_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/video_frame_pb2.pyi index 313cb77d..08ee8597 100644 --- a/livekit-rtc/livekit/rtc/_proto/video_frame_pb2.pyi +++ b/livekit-rtc/livekit/rtc/_proto/video_frame_pb2.pyi @@ -90,7 +90,10 @@ class _VideoBufferTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper I010: _VideoBufferType.ValueType # 9 NV12: _VideoBufferType.ValueType # 10 -class VideoBufferType(_VideoBufferType, metaclass=_VideoBufferTypeEnumTypeWrapper): ... +class VideoBufferType(_VideoBufferType, metaclass=_VideoBufferTypeEnumTypeWrapper): + """Values of this enum must not be changed + It is used to serialize a rtc.VideoFrame on Python + """ RGBA: VideoBufferType.ValueType # 0 ABGR: VideoBufferType.ValueType # 1 diff --git a/livekit-rtc/livekit/rtc/_utils.py b/livekit-rtc/livekit/rtc/_utils.py index a5231e71..c7fbc092 100644 --- a/livekit-rtc/livekit/rtc/_utils.py +++ b/livekit-rtc/livekit/rtc/_utils.py @@ -130,3 +130,15 @@ def generate_random_base62(length=12): """ global _base62_characters return "".join(random.choice(_base62_characters) for _ in range(length)) + + +# adapted from https://stackoverflow.com/a/6043797 +def split_utf8(s: str, n: int): + """Split UTF-8 s into chunks of maximum length n.""" + while len(s) > n: + k = n + while (ord(s[k]) & 0xC0) == 0x80: + k -= 1 + yield s[:k] + s = s[k:] + yield s diff --git a/livekit-rtc/livekit/rtc/data_stream.py b/livekit-rtc/livekit/rtc/data_stream.py new file mode 100644 index 00000000..ed2c0ad2 --- /dev/null +++ b/livekit-rtc/livekit/rtc/data_stream.py @@ -0,0 +1,365 @@ +# Copyright 2023 LiveKit, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import annotations + +import asyncio +import uuid +import datetime +from collections.abc import Callable +from dataclasses import dataclass +from typing import AsyncIterator, Optional, TypedDict, Dict, List +from ._proto.room_pb2 import DataStream as proto_DataStream +from ._proto import ffi_pb2 as proto_ffi +from ._proto import room_pb2 as proto_room +from ._ffi_client import FfiClient + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .participant import LocalParticipant + + +STREAM_CHUNK_SIZE = 15_000 + + +@dataclass +class BaseStreamInfo(TypedDict): + stream_id: str + mime_type: str + topic: str + timestamp: int + size: Optional[int] + attributes: Optional[Dict[str, str]] # Optional for the extensions dictionary + + +@dataclass +class TextStreamInfo(BaseStreamInfo): + attachments: List[str] + pass + + +@dataclass +class TextStreamUpdate: + current: str + index: int + collected: str + + +class TextStreamReader: + def __init__( + self, + header: proto_DataStream.Header, + ) -> None: + self._header = header + self._info = TextStreamInfo( + stream_id=header.stream_id, + mime_type=header.mime_type, + topic=header.topic, + timestamp=header.timestamp, + size=header.total_length, + attributes=dict(header.attributes), + attachments=list(header.text_header.attached_stream_ids), + ) + self._queue: asyncio.Queue[proto_DataStream.Chunk | None] = asyncio.Queue() + self._chunks: Dict[int, proto_DataStream.Chunk] = {} + + async def _on_chunk_update(self, chunk: proto_DataStream.Chunk): + await self._queue.put(chunk) + + async def _on_stream_close(self, trailer: proto_DataStream.Trailer): + await self._queue.put(None) + + def __aiter__(self) -> AsyncIterator[TextStreamUpdate]: + return self + + async def __anext__(self) -> TextStreamUpdate: + item = await self._queue.get() + if item is None: + raise StopAsyncIteration + decodedStr = item.content.decode() + + self._chunks[item.chunk_index] = item + chunk_list = list(self._chunks.values()) + chunk_list.sort(key=lambda chunk: chunk.chunk_index) + collected: str = "".join(map(lambda chunk: chunk.content.decode(), chunk_list)) + return TextStreamUpdate( + current=decodedStr, index=item.chunk_index, collected=collected + ) + + @property + def info(self) -> TextStreamInfo: + return self._info + + async def read_all(self) -> str: + final_string = "" + async for update in self: + final_string = update.collected + return final_string + + +@dataclass +class ByteStreamInfo(BaseStreamInfo): + name: str + + +class ByteStreamReader: + def __init__(self, header: proto_DataStream.Header, capacity: int = 0) -> None: + self._header = header + self._info = ByteStreamInfo( + stream_id=header.stream_id, + mime_type=header.mime_type, + topic=header.topic, + timestamp=header.timestamp, + size=header.total_length, + attributes=dict(header.attributes), + name=header.byte_header.name, + ) + self._queue: asyncio.Queue[proto_DataStream.Chunk | None] = asyncio.Queue( + capacity + ) + + async def _on_chunk_update(self, chunk: proto_DataStream.Chunk): + await self._queue.put(chunk) + + async def _on_stream_close(self, trailer: proto_DataStream.Trailer): + await self._queue.put(None) + + def __aiter__(self) -> AsyncIterator[bytes]: + return self + + async def __anext__(self) -> bytes: + item = await self._queue.get() + if item is None: + raise StopAsyncIteration + + return item.content + + @property + def info(self) -> ByteStreamInfo: + return self._info + + +class BaseStreamWriter: + def __init__( + self, + local_participant: LocalParticipant, + topic: str = "", + attributes: Optional[Dict[str, str]] = {}, + stream_id: str | None = None, + total_size: int | None = None, + mime_type: str = "", + destination_identities: Optional[List[str]] = None, + ): + self._local_participant = local_participant + if stream_id is None: + stream_id = str(uuid.uuid4()) + timestamp = int(datetime.datetime.now().timestamp() * 1000) + self._header = proto_DataStream.Header( + stream_id=stream_id, + timestamp=timestamp, + mime_type=mime_type, + topic=topic, + attributes=attributes, + total_length=total_size, + ) + self._next_chunk_index: int = 0 + self._destination_identities = destination_identities + + async def _send_header(self): + req = proto_ffi.FfiRequest( + send_stream_header=proto_room.SendStreamHeaderRequest( + header=self._header, + local_participant_handle=self._local_participant._ffi_handle.handle, + destination_identities=self._destination_identities, + sender_identity=self._local_participant.identity, + ) + ) + + queue = FfiClient.instance.queue.subscribe() + try: + resp = FfiClient.instance.request(req) + cb: proto_ffi.FfiEvent = await queue.wait_for( + lambda e: e.send_stream_header.async_id + == resp.send_stream_header.async_id + ) + finally: + FfiClient.instance.queue.unsubscribe(queue) + + if cb.send_stream_header.error: + raise ConnectionError(cb.send_stream_header.error) + + async def _send_chunk(self, chunk: proto_DataStream.Chunk): + req = proto_ffi.FfiRequest( + send_stream_chunk=proto_room.SendStreamChunkRequest( + chunk=chunk, + local_participant_handle=self._local_participant._ffi_handle.handle, + sender_identity=self._local_participant.identity, + destination_identities=self._destination_identities, + ) + ) + + queue = FfiClient.instance.queue.subscribe() + try: + resp = FfiClient.instance.request(req) + cb: proto_ffi.FfiEvent = await queue.wait_for( + lambda e: e.send_stream_chunk.async_id + == resp.send_stream_chunk.async_id + ) + finally: + FfiClient.instance.queue.unsubscribe(queue) + + if cb.send_stream_chunk.error: + raise ConnectionError(cb.send_stream_chunk.error) + + async def _send_trailer(self, trailer: proto_DataStream.Trailer): + req = proto_ffi.FfiRequest( + send_stream_trailer=proto_room.SendStreamTrailerRequest( + trailer=trailer, + local_participant_handle=self._local_participant._ffi_handle.handle, + sender_identity=self._local_participant.identity, + ) + ) + + queue = FfiClient.instance.queue.subscribe() + try: + resp = FfiClient.instance.request(req) + cb: proto_ffi.FfiEvent = await queue.wait_for( + lambda e: e.send_stream_trailer.async_id + == resp.send_stream_trailer.async_id + ) + finally: + FfiClient.instance.queue.unsubscribe(queue) + + if cb.send_stream_chunk.error: + raise ConnectionError(cb.send_stream_trailer.error) + + async def aclose(self): + await self._send_trailer( + trailer=proto_DataStream.Trailer( + stream_id=self._header.stream_id, reason="" + ) + ) + + +class TextStreamWriter(BaseStreamWriter): + def __init__( + self, + local_participant: LocalParticipant, + *, + topic: str = "", + extensions: Optional[Dict[str, str]] = {}, + stream_id: str | None = None, + total_size: int | None = None, + reply_to_id: str | None = None, + destination_identities: Optional[List[str]] = None, + ) -> None: + super().__init__( + local_participant, + topic, + extensions, + stream_id, + total_size, + mime_type="text/plain", + destination_identities=destination_identities, + ) + self._header.text_header.operation_type = proto_DataStream.OperationType.CREATE + if reply_to_id: + self._header.text_header.reply_to_stream_id = reply_to_id + self._info = TextStreamInfo( + stream_id=self._header.stream_id, + mime_type=self._header.mime_type, + topic=self._header.topic, + timestamp=self._header.timestamp, + size=self._header.total_length, + attributes=dict(self._header.attributes), + attachments=list(self._header.text_header.attached_stream_ids), + ) + + async def write(self, text: str, chunk_index: int | None = None): + content = text.encode() + if len(content) > STREAM_CHUNK_SIZE: + raise ValueError("maximum chunk size exceeded") + if chunk_index is None: + chunk_index = self._next_chunk_index + self._next_chunk_index += 1 + chunk_msg = proto_DataStream.Chunk( + stream_id=self._header.stream_id, + chunk_index=chunk_index, + content=content, + ) + await self._send_chunk(chunk_msg) + + @property + def info(self) -> TextStreamInfo: + return self._info + + +class ByteStreamWriter(BaseStreamWriter): + def __init__( + self, + local_participant: LocalParticipant, + *, + name: str, + topic: str = "", + extensions: Optional[Dict[str, str]] = None, + stream_id: str | None = None, + total_size: int | None = None, + mime_type: str = "application/octet-stream", + destination_identities: Optional[List[str]] = None, + ) -> None: + super().__init__( + local_participant, + topic, + extensions, + stream_id, + total_size, + mime_type=mime_type, + destination_identities=destination_identities, + ) + self._header.byte_header.name = name + self._info = ByteStreamInfo( + stream_id=self._header.stream_id, + mime_type=self._header.mime_type, + topic=self._header.topic, + timestamp=self._header.timestamp, + size=self._header.total_length, + attributes=dict(self._header.attributes), + name=self._header.byte_header.name, + ) + self._write_lock = asyncio.Lock() + + async def write(self, data: bytes): + async with self._write_lock: + chunked_data = [ + data[i : i + STREAM_CHUNK_SIZE] + for i in range(0, len(data), STREAM_CHUNK_SIZE) + ] + + for chunk in chunked_data: + self._next_chunk_index += 1 + chunk_msg = proto_DataStream.Chunk( + stream_id=self._header.stream_id, + chunk_index=self._next_chunk_index, + content=chunk, + ) + await self._send_chunk(chunk_msg) + + @property + def info(self) -> ByteStreamInfo: + return self._info + + +TextStreamHandler = Callable[[TextStreamReader, str], None] +ByteStreamHandler = Callable[[ByteStreamReader, str], None] diff --git a/livekit-rtc/livekit/rtc/participant.py b/livekit-rtc/livekit/rtc/participant.py index 96976857..c31b120f 100644 --- a/livekit-rtc/livekit/rtc/participant.py +++ b/livekit-rtc/livekit/rtc/participant.py @@ -15,9 +15,14 @@ from __future__ import annotations import ctypes +import asyncio +import os +import mimetypes +import aiofiles from typing import List, Union, Callable, Dict, Awaitable, Optional, Mapping, cast from abc import abstractmethod, ABC + from ._ffi_client import FfiClient, FfiHandle from ._proto import ffi_pb2 as proto_ffi from ._proto import participant_pb2 as proto_participant @@ -27,7 +32,7 @@ from ._proto.room_pb2 import ( TranscriptionSegment as ProtoTranscriptionSegment, ) -from ._utils import BroadcastQueue +from ._utils import BroadcastQueue, split_utf8 from .track import LocalTrack from .track_publication import ( LocalTrackPublication, @@ -38,9 +43,14 @@ from .rpc import RpcError from ._proto.rpc_pb2 import RpcMethodInvocationResponseRequest from .log import logger -import asyncio from .rpc import RpcInvocationData +from .data_stream import ( + TextStreamWriter, + ByteStreamWriter, + ByteStreamInfo, + STREAM_CHUNK_SIZE, +) class PublishTrackError(Exception): @@ -539,6 +549,119 @@ async def set_attributes(self, attributes: dict[str, str]) -> None: finally: FfiClient.instance.queue.unsubscribe(queue) + async def stream_text( + self, + *, + destination_identities: List[str] = [], + topic: str = "", + extensions: Dict[str, str] = {}, + reply_to_id: str | None = None, + total_size: int | None = None, + ) -> TextStreamWriter: + """ + Returns a TextStreamWriter that allows to write individual chunks of text to a text stream. + In most cases where you want to simply send a text message use send_text() instead. + """ + writer = TextStreamWriter( + self, + topic=topic, + extensions=extensions, + reply_to_id=reply_to_id, + destination_identities=destination_identities, + total_size=total_size, + ) + + await writer._send_header() + + return writer + + async def send_text( + self, + text: str, + *, + destination_identities: List[str] = [], + topic: str = "", + extensions: Dict[str, str] = {}, + reply_to_id: str | None = None, + ): + total_size = len(text.encode()) + writer = await self.stream_text( + destination_identities=destination_identities, + topic=topic, + extensions=extensions, + reply_to_id=reply_to_id, + total_size=total_size, + ) + + for chunk in split_utf8(text, STREAM_CHUNK_SIZE): + await writer.write(chunk) + await writer.aclose() + + return writer.info + + async def stream_bytes( + self, + name: str, + *, + total_size: int | None = None, + mime_type: str = "application/octet-stream", + extensions: Optional[Dict[str, str]] = None, + stream_id: str | None = None, + destination_identities: Optional[List[str]] = None, + topic: str = "", + ) -> ByteStreamWriter: + """ + Returns a ByteStreamWriter that allows to write individual chunks of bytes to a byte stream. + In cases where you want to simply send a file from the file system use send_file() instead. + """ + writer = ByteStreamWriter( + self, + name=name, + extensions=extensions, + total_size=total_size, + stream_id=stream_id, + mime_type=mime_type, + destination_identities=destination_identities, + topic=topic, + ) + + await writer._send_header() + + return writer + + async def send_file( + self, + file_path: str, + topic: str = "", + destination_identities: Optional[List[str]] = None, + attributes: Optional[Dict[str, str]] = None, + stream_id: str | None = None, + ) -> ByteStreamInfo: + file_size = os.path.getsize(file_path) + file_name = os.path.basename(file_path) + mime_type, _ = mimetypes.guess_type(file_path) + if mime_type is None: + mime_type = ( + "application/octet-stream" # Fallback MIME type for unknown files + ) + + writer: ByteStreamWriter = await self.stream_bytes( + name=file_name, + total_size=file_size, + mime_type=mime_type, + extensions=attributes, + stream_id=stream_id, + destination_identities=destination_identities, + topic=topic, + ) + + async with aiofiles.open(file_path, "rb") as f: + while bytes := await f.read(STREAM_CHUNK_SIZE): + await writer.write(bytes) + await writer.aclose() + + return writer.info + async def publish_track( self, track: LocalTrack, options: TrackPublishOptions = TrackPublishOptions() ) -> LocalTrackPublication: diff --git a/livekit-rtc/livekit/rtc/room.py b/livekit-rtc/livekit/rtc/room.py index e35d2bbc..78386083 100644 --- a/livekit-rtc/livekit/rtc/room.py +++ b/livekit-rtc/livekit/rtc/room.py @@ -33,6 +33,12 @@ from .track import RemoteAudioTrack, RemoteVideoTrack from .track_publication import RemoteTrackPublication, TrackPublication from .transcription import TranscriptionSegment +from .data_stream import ( + TextStreamReader, + ByteStreamReader, + TextStreamHandler, + ByteStreamHandler, +) EventTypes = Literal[ "participant_connected", @@ -137,6 +143,10 @@ def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None: self._connection_state = ConnectionState.CONN_DISCONNECTED self._first_sid_future = asyncio.Future[str]() self._local_participant: LocalParticipant | None = None + self._text_stream_readers: Dict[str, TextStreamReader] = {} + self._byte_stream_readers: Dict[str, ByteStreamReader] = {} + self._text_stream_handlers: Dict[str, TextStreamHandler] = {} + self._byte_stream_handlers: Dict[str, ByteStreamHandler] = {} def __del__(self) -> None: if self._ffi_handle is not None: @@ -416,6 +426,28 @@ async def disconnect(self) -> None: await self._task FfiClient.instance.queue.unsubscribe(self._ffi_queue) + def set_byte_stream_handler(self, handler: ByteStreamHandler, topic: str = ""): + existing_handler = self._byte_stream_handlers.get(topic) + if existing_handler is None: + self._byte_stream_handlers[topic] = handler + else: + raise TypeError("byte stream handler for topic '%s' already set" % topic) + + def remove_byte_stream_handler(self, topic: str = ""): + if self._byte_stream_handlers.get(topic): + self._byte_stream_handlers.pop(topic) + + def set_text_stream_handler(self, handler: TextStreamHandler, topic: str = ""): + existing_handler = self._text_stream_handlers.get(topic) + if existing_handler is None: + self._text_stream_handlers[topic] = handler + else: + raise TypeError("text stream handler for topic '%s' already set" % topic) + + def remove_text_stream_handler(self, topic: str = ""): + if self._text_stream_handlers.get(topic): + self._text_stream_handlers.pop(topic) + async def _listen_task(self) -> None: # listen to incoming room events while True: @@ -709,6 +741,17 @@ def _on_room_event(self, event: proto_room.RoomEvent): self.emit("reconnecting") elif which == "reconnected": self.emit("reconnected") + elif which == "stream_header_received": + self._handle_stream_header( + event.stream_header_received.header, + event.stream_header_received.participant_identity, + ) + elif which == "stream_chunk_received": + asyncio.gather(self._handle_stream_chunk(event.stream_chunk_received.chunk)) + elif which == "stream_trailer_received": + asyncio.gather( + self._handle_stream_trailer(event.stream_trailer_received.trailer) + ) async def _drain_rpc_invocation_tasks(self) -> None: if self._rpc_invocation_tasks: @@ -739,6 +782,59 @@ def _create_remote_participant( self._remote_participants[participant.identity] = participant return participant + def _handle_stream_header( + self, header: proto_room.DataStream.Header, participant_identity: str + ): + stream_type = header.WhichOneof("content_header") + if stream_type == "text_header": + text_stream_handler = self._text_stream_handlers.get(header.topic) + if text_stream_handler is None: + logging.info( + "ignoring text stream with topic '%s', no callback attached", + header.topic, + ) + return + + text_reader = TextStreamReader(header) + self._text_stream_readers[header.stream_id] = text_reader + text_stream_handler(text_reader, participant_identity) + elif stream_type == "byte_header": + logging.warning("received byte header, %s", header.stream_id) + byte_stream_handler = self._byte_stream_handlers.get(header.topic) + if byte_stream_handler is None: + logging.info( + "ignoring byte stream with topic '%s', no callback attached", + header.topic, + ) + return + + byte_reader = ByteStreamReader(header) + self._byte_stream_readers[header.stream_id] = byte_reader + byte_stream_handler(byte_reader, participant_identity) + else: + logging.warning("received unknown header type, %s", stream_type) + pass + + async def _handle_stream_chunk(self, chunk: proto_room.DataStream.Chunk): + text_reader = self._text_stream_readers.get(chunk.stream_id) + file_reader = self._byte_stream_readers.get(chunk.stream_id) + + if text_reader: + await text_reader._on_chunk_update(chunk) + elif file_reader: + await file_reader._on_chunk_update(chunk) + + async def _handle_stream_trailer(self, trailer: proto_room.DataStream.Trailer): + text_reader = self._text_stream_readers.get(trailer.stream_id) + file_reader = self._byte_stream_readers.get(trailer.stream_id) + + if text_reader: + await text_reader._on_stream_close(trailer) + self._text_stream_readers.pop(trailer.stream_id) + elif file_reader: + await file_reader._on_stream_close(trailer) + self._byte_stream_readers.pop(trailer.stream_id) + def __repr__(self) -> str: sid = "unknown" if self._first_sid_future.done(): diff --git a/livekit-rtc/rust-sdks b/livekit-rtc/rust-sdks index c6132e86..df4d7536 160000 --- a/livekit-rtc/rust-sdks +++ b/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit c6132e864d33bd1def502693aa758eb157bdd7fc +Subproject commit df4d753663bb6e4be4198833b4923cef3924278d diff --git a/livekit-rtc/setup.py b/livekit-rtc/setup.py index 20bbb1b8..71ec85f4 100644 --- a/livekit-rtc/setup.py +++ b/livekit-rtc/setup.py @@ -58,7 +58,7 @@ def finalize_options(self): license="Apache-2.0", packages=setuptools.find_namespace_packages(include=["livekit.*"]), python_requires=">=3.9.0", - install_requires=["protobuf>=5.26.1", "types-protobuf>=3"], + install_requires=["protobuf>=5.26.1", "types-protobuf>=3", "aiofiles>=24"], package_data={ "livekit.rtc": ["_proto/*.py", "py.typed", "*.pyi", "**/*.pyi"], "livekit.rtc.resources": ["*.so", "*.dylib", "*.dll", "LICENSE.md", "*.h"],