diff --git a/livekit-rtc/README.md b/livekit-rtc/README.md index 91494d75d..30a9b0407 100644 --- a/livekit-rtc/README.md +++ b/livekit-rtc/README.md @@ -4,6 +4,42 @@ Python SDK to integrate LiveKit's real-time video, audio, and data capabilities See https://docs.livekit.io/ for more information. +## Publishing prepared tracks during connection + +Describe the audio source and complete publication options when connecting. Rust +creates the native track on its blocking pool inside the asynchronous connection +task, keeping cold native initialization off the Python event loop. Audio generation +can run concurrently; no PCM or capture device is needed to prepare the publication. + +```python +from livekit import rtc + +source = rtc.AudioSource(sample_rate=24000, num_channels=1) +audio = rtc.AudioTrackToPublish( + source=source, + name="agent_audio", + options=rtc.TrackPublishOptions(source=rtc.TrackSource.SOURCE_MICROPHONE), +) +await room.connect(url, token, rtc.RoomOptions(publish_audio_tracks=[audio])) +track = audio.track # Created by Rust and returned after successful connection. +publication = next(p for p in room.local_participant.track_publications.values() + if p.track is track) +# Push generated audio later with await source.capture_frame(frame). +# At shutdown: +await room.local_participant.unpublish_track(publication.sid) +await source.aclose() +``` + +If a local track already exists, use `RoomOptions(publish_tracks=[(track, options)])` +instead. Both paths preserve full publication options. Single-PC connections can +bundle these publications into JOIN on supporting servers; other configurations +use ordinary publication. Do not publish these tracks again after connect. + +This requires the matching native FFI build. Keep each audio descriptor within one +connection attempt at a time and do not modify it while connecting. Cancellation +waits for the native connection attempt to finish and cleans up any unclaimed room, +publication and newly created track. The caller retains ownership of the source. + ## Publishing pre-encoded video Use `EncodedVideoSource` when an upstream encoder already provides compressed diff --git a/livekit-rtc/livekit/rtc/__init__.py b/livekit-rtc/livekit/rtc/__init__.py index 4be4c1247..e9f55ec04 100644 --- a/livekit-rtc/livekit/rtc/__init__.py +++ b/livekit-rtc/livekit/rtc/__init__.py @@ -71,6 +71,7 @@ RemoteParticipant, ) from .room import ( + AudioTrackToPublish, ConnectError, DataPacket, DataStreamOptions, @@ -151,6 +152,7 @@ from .frame_processor import FrameProcessor __all__ = [ + "AudioTrackToPublish", "EncodedFrameType", "EncodedVideoFrame", "EncodedVideoSource", diff --git a/livekit-rtc/livekit/rtc/_proto/room_pb2.py b/livekit-rtc/livekit/rtc/_proto/room_pb2.py index 9dc49e8e4..af68d4838 100644 --- a/livekit-rtc/livekit/rtc/_proto/room_pb2.py +++ b/livekit-rtc/livekit/rtc/_proto/room_pb2.py @@ -22,7 +22,7 @@ from . import data_track_pb2 as data__track__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\x1a\x11\x64\x61ta_stream.proto\x1a\x10\x64\x61ta_track.proto\"s\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\x12\x18\n\x10request_async_id\x18\x04 \x01(\x04\"#\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\"s\n\x11\x44isconnectRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x18\n\x10request_async_id\x18\x02 \x01(\x04\x12/\n\x06reason\x18\x03 \x01(\x0e\x32\x1f.livekit.proto.DisconnectReason\"&\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\"\x7f\n\x17SimulateScenarioRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x35\n\x08scenario\x18\x02 \x02(\x0e\x32#.livekit.proto.SimulateScenarioKind\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\",\n\x18SimulateScenarioResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\";\n\x18SimulateScenarioCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\x9c\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\x12\x18\n\x10request_async_id\x18\x04 \x01(\x04\"(\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\"/\n\x18ReadyForRoomEventRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\"\x1b\n\x19ReadyForRoomEventResponse\"\x81\x01\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\x12\x18\n\x10request_async_id\x18\x04 \x01(\x04\"*\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\"\xd3\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\x12\x18\n\x10request_async_id\x18\x08 \x01(\x04\"\'\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\"\xc0\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"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\"\x90\x01\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"*\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\"g\n\x17SetLocalMetadataRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x10\n\x08metadata\x18\x02 \x02(\t\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\",\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\"\x9e\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"\xd6\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\x12\x18\n\x10request_async_id\x18\x06 \x01(\x04\"+\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\"\x8b\x01\n\x19SetLocalAttributesRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x32\n\nattributes\x18\x02 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\"-\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\"_\n\x13SetLocalNameRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0c\n\x04name\x18\x02 \x02(\t\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\"(\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\"G\n\x16GetSessionStatsRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x18\n\x10request_async_id\x18\x02 \x01(\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\"\x96\x04\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\x12\x19\n\x11preconnect_buffer\x18\t \x01(\x08\x12\x44\n\x17\x66rame_metadata_features\x18\n \x03(\x0e\x32#.livekit.proto.FrameMetadataFeature\x12\x18\n\x10scalability_mode\x18\x0b \x01(\t\x12\x39\n\rvideo_encoder\x18\x0c \x01(\x0e\x32\".livekit.proto.VideoEncoderBackend\x12\x44\n\x16\x64\x65gradation_preference\x18\r \x01(\x0e\x32$.livekit.proto.DegradationPreference\"=\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\"b\n\x15RoomDataStreamOptions\x12\x1f\n\x17max_payload_byte_length\x18\x01 \x01(\x04\x12(\n use_legacy_client_implementation\x18\x02 \x01(\x08\"\xfd\x02\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.E2eeOptionsB\x02\x18\x01\x12,\n\nrtc_config\x18\x05 \x01(\x0b\x32\x18.livekit.proto.RtcConfig\x12\x14\n\x0cjoin_retries\x18\x06 \x01(\r\x12.\n\nencryption\x18\x07 \x01(\x0b\x32\x1a.livekit.proto.E2eeOptions\x12\x1e\n\x16single_peer_connection\x18\x08 \x01(\x08\x12\x1a\n\x12\x63onnect_timeout_ms\x18\t \x01(\x04\x12\x39\n\x0b\x64\x61ta_stream\x18\n \x01(\x0b\x32$.livekit.proto.RoomDataStreamOptions\x12\x12\n\nother_sdks\x18\x0b \x01(\t\"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\"\xce\x17\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\x12=\n\x12\x62yte_stream_opened\x18\" \x01(\x0b\x32\x1f.livekit.proto.ByteStreamOpenedH\x00\x12=\n\x12text_stream_opened\x18# \x01(\x0b\x32\x1f.livekit.proto.TextStreamOpenedH\x00\x12/\n\x0croom_updated\x18$ \x01(\x0b\x32\x17.livekit.proto.RoomInfoH\x00\x12(\n\x05moved\x18% \x01(\x0b\x32\x17.livekit.proto.RoomInfoH\x00\x12\x42\n\x14participants_updated\x18& \x01(\x0b\x32\".livekit.proto.ParticipantsUpdatedH\x00\x12\x62\n%participant_encryption_status_changed\x18\' \x01(\x0b\x32\x31.livekit.proto.ParticipantEncryptionStatusChangedH\x00\x12U\n\x1eparticipant_permission_changed\x18) \x01(\x0b\x32+.livekit.proto.ParticipantPermissionChangedH\x00\x12\x38\n\x0ftoken_refreshed\x18( \x01(\x0b\x32\x1d.livekit.proto.TokenRefreshedH\x00\x12>\n\x12participant_active\x18* \x01(\x0b\x32 .livekit.proto.ParticipantActiveH\x00\x12\x41\n\x14\x64\x61ta_track_published\x18+ \x01(\x0b\x32!.livekit.proto.DataTrackPublishedH\x00\x12\x45\n\x16\x64\x61ta_track_unpublished\x18, \x01(\x0b\x32#.livekit.proto.DataTrackUnpublishedH\x00\x12G\n\x17local_track_republished\x18- \x01(\x0b\x32$.livekit.proto.LocalTrackRepublishedH\x00\x42\t\n\x07message\"\xc9\x02\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\x12\x15\n\rempty_timeout\x18\x06 \x02(\r\x12\x19\n\x11\x64\x65parture_timeout\x18\x07 \x02(\r\x12\x18\n\x10max_participants\x18\x08 \x02(\r\x12\x15\n\rcreation_time\x18\t \x02(\x03\x12\x18\n\x10num_participants\x18\n \x02(\r\x12\x16\n\x0enum_publishers\x18\x0b \x02(\r\x12\x18\n\x10\x61\x63tive_recording\x18\x0c \x02(\x08\"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\"K\n\x13ParticipantsUpdated\x12\x34\n\x0cparticipants\x18\x01 \x03(\x0b\x32\x1e.livekit.proto.ParticipantInfo\"E\n\x14ParticipantConnected\x12-\n\x04info\x18\x01 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\"1\n\x11ParticipantActive\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\"s\n\x17ParticipantDisconnected\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12:\n\x11\x64isconnect_reason\x18\x02 \x02(\x0e\x32\x1f.livekit.proto.DisconnectReason\"(\n\x13LocalTrackPublished\x12\x11\n\ttrack_sid\x18\x01 \x02(\t\"0\n\x15LocalTrackUnpublished\x12\x17\n\x0fpublication_sid\x18\x01 \x02(\t\"|\n\x15LocalTrackRepublished\x12\x1a\n\x12publication_handle\x18\x01 \x02(\x04\x12\x14\n\x0cprevious_sid\x18\x02 \x02(\t\x12\x31\n\x04info\x18\x03 \x02(\x0b\x32#.livekit.proto.TrackPublicationInfo\")\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\"X\n\"ParticipantEncryptionStatusChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x14\n\x0cis_encrypted\x18\x02 \x02(\x08\"D\n\x16ParticipantNameChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x0c\n\x04name\x18\x02 \x02(\t\"v\n\x1cParticipantPermissionChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x38\n\npermission\x18\x02 \x01(\x0b\x32$.livekit.proto.ParticipantPermission\"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\"\x1f\n\x0eTokenRefreshed\x12\r\n\x05token\x18\x01 \x02(\t\"\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\"\xc0\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"\xbd\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"\xc3\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\",\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\"f\n\x10\x42yteStreamOpened\x12\x34\n\x06reader\x18\x01 \x02(\x0b\x32$.livekit.proto.OwnedByteStreamReader\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\"f\n\x10TextStreamOpened\x12\x34\n\x06reader\x18\x01 \x02(\x0b\x32$.livekit.proto.OwnedTextStreamReader\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\"H\n\x12\x44\x61taTrackPublished\x12\x32\n\x05track\x18\x01 \x02(\x0b\x32#.livekit.proto.OwnedRemoteDataTrack\"#\n\x14\x44\x61taTrackUnpublished\x12\x0b\n\x03sid\x18\x01 \x02(\t*\x90\x02\n\x14SimulateScenarioKind\x12\x1d\n\x19SIMULATE_SIGNAL_RECONNECT\x10\x00\x12\x14\n\x10SIMULATE_SPEAKER\x10\x01\x12\x19\n\x15SIMULATE_NODE_FAILURE\x10\x02\x12\x19\n\x15SIMULATE_SERVER_LEAVE\x10\x03\x12\x16\n\x12SIMULATE_MIGRATION\x10\x04\x12\x16\n\x12SIMULATE_FORCE_TCP\x10\x05\x12\x16\n\x12SIMULATE_FORCE_TLS\x10\x06\x12\x1b\n\x17SIMULATE_FULL_RECONNECT\x10\x07\x12(\n$SIMULATE_DISCONNECT_SIGNAL_ON_RESUME\x10\x08*\xe4\x01\n\x13VideoEncoderBackend\x12\x18\n\x14\x45NCODER_BACKEND_AUTO\x10\x00\x12\x1c\n\x18\x45NCODER_BACKEND_SOFTWARE\x10\x01\x12\x1c\n\x18\x45NCODER_BACKEND_HARDWARE\x10\x02\x12\x19\n\x15\x45NCODER_BACKEND_NVENC\x10\x03\x12\x19\n\x15\x45NCODER_BACKEND_VAAPI\x10\x04\x12 \n\x1c\x45NCODER_BACKEND_VIDEOTOOLBOX\x10\x05\x12\x1f\n\x1b\x45NCODER_BACKEND_PRE_ENCODED\x10\x06*\xd9\x01\n\x15\x44\x65gradationPreference\x12#\n\x1f\x44\x45GRADATION_PREFERENCE_BALANCED\x10\x00\x12-\n)DEGRADATION_PREFERENCE_MAINTAIN_FRAMERATE\x10\x01\x12.\n*DEGRADATION_PREFERENCE_MAINTAIN_RESOLUTION\x10\x02\x12<\n8DEGRADATION_PREFERENCE_MAINTAIN_FRAMERATE_AND_RESOLUTION\x10\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') +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\x1a\x11\x64\x61ta_stream.proto\x1a\x10\x64\x61ta_track.proto\"Y\n\x0cInitialTrack\x12\x14\n\x0ctrack_handle\x18\x01 \x02(\x04\x12\x33\n\x07options\x18\x02 \x02(\x0b\x32\".livekit.proto.TrackPublishOptions\"m\n\x11InitialAudioTrack\x12\x15\n\rsource_handle\x18\x01 \x02(\x04\x12\x0c\n\x04name\x18\x02 \x02(\t\x12\x33\n\x07options\x18\x03 \x02(\x0b\x32\".livekit.proto.TrackPublishOptions\"\xe8\x01\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\x12\x18\n\x10request_async_id\x18\x04 \x01(\x04\x12\x33\n\x0epublish_tracks\x18\x05 \x03(\x0b\x32\x1b.livekit.proto.InitialTrack\x12>\n\x14publish_audio_tracks\x18\x06 \x03(\x0b\x32 .livekit.proto.InitialAudioTrack\"#\n\x0f\x43onnectResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\"\xbb\x05\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\xaa\x01\n\x12InitialPublication\x12\x14\n\x0ctrack_handle\x18\x01 \x02(\x04\x12\x39\n\x0bpublication\x18\x02 \x02(\x0b\x32$.livekit.proto.OwnedTrackPublication\x12(\n\x05track\x18\x03 \x01(\x0b\x32\x19.livekit.proto.OwnedTrack\x12\x19\n\x11\x61udio_track_index\x18\x04 \x01(\r\x1a\x87\x02\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.ParticipantWithTracks\x12M\n\x12local_publications\x18\x04 \x03(\x0b\x32\x31.livekit.proto.ConnectCallback.InitialPublicationB\t\n\x07message\"s\n\x11\x44isconnectRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x18\n\x10request_async_id\x18\x02 \x01(\x04\x12/\n\x06reason\x18\x03 \x01(\x0e\x32\x1f.livekit.proto.DisconnectReason\"&\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\"\x7f\n\x17SimulateScenarioRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x35\n\x08scenario\x18\x02 \x02(\x0e\x32#.livekit.proto.SimulateScenarioKind\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\",\n\x18SimulateScenarioResponse\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\";\n\x18SimulateScenarioCallback\x12\x10\n\x08\x61sync_id\x18\x01 \x02(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\x9c\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\x12\x18\n\x10request_async_id\x18\x04 \x01(\x04\"(\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\"/\n\x18ReadyForRoomEventRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\"\x1b\n\x19ReadyForRoomEventResponse\"\x81\x01\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\x12\x18\n\x10request_async_id\x18\x04 \x01(\x04\"*\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\"\xd3\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\x12\x18\n\x10request_async_id\x18\x08 \x01(\x04\"\'\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\"\xc0\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"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\"\x90\x01\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"*\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\"g\n\x17SetLocalMetadataRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x10\n\x08metadata\x18\x02 \x02(\t\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\",\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\"\x9e\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"\xd6\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\x12\x18\n\x10request_async_id\x18\x06 \x01(\x04\"+\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\"\x8b\x01\n\x19SetLocalAttributesRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x32\n\nattributes\x18\x02 \x03(\x0b\x32\x1e.livekit.proto.AttributesEntry\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\"-\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\"_\n\x13SetLocalNameRequest\x12 \n\x18local_participant_handle\x18\x01 \x02(\x04\x12\x0c\n\x04name\x18\x02 \x02(\t\x12\x18\n\x10request_async_id\x18\x03 \x01(\x04\"(\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\"G\n\x16GetSessionStatsRequest\x12\x13\n\x0broom_handle\x18\x01 \x02(\x04\x12\x18\n\x10request_async_id\x18\x02 \x01(\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\"\x96\x04\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\x12\x19\n\x11preconnect_buffer\x18\t \x01(\x08\x12\x44\n\x17\x66rame_metadata_features\x18\n \x03(\x0e\x32#.livekit.proto.FrameMetadataFeature\x12\x18\n\x10scalability_mode\x18\x0b \x01(\t\x12\x39\n\rvideo_encoder\x18\x0c \x01(\x0e\x32\".livekit.proto.VideoEncoderBackend\x12\x44\n\x16\x64\x65gradation_preference\x18\r \x01(\x0e\x32$.livekit.proto.DegradationPreference\"=\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\"f\n\x15RoomDataStreamOptions\x12\x1f\n\x17max_payload_byte_length\x18\x01 \x01(\x04\x12,\n use_legacy_client_implementation\x18\x02 \x01(\x08\x42\x02\x18\x01\"\xfd\x02\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.E2eeOptionsB\x02\x18\x01\x12,\n\nrtc_config\x18\x05 \x01(\x0b\x32\x18.livekit.proto.RtcConfig\x12\x14\n\x0cjoin_retries\x18\x06 \x01(\r\x12.\n\nencryption\x18\x07 \x01(\x0b\x32\x1a.livekit.proto.E2eeOptions\x12\x1e\n\x16single_peer_connection\x18\x08 \x01(\x08\x12\x1a\n\x12\x63onnect_timeout_ms\x18\t \x01(\x04\x12\x39\n\x0b\x64\x61ta_stream\x18\n \x01(\x0b\x32$.livekit.proto.RoomDataStreamOptions\x12\x12\n\nother_sdks\x18\x0b \x01(\t\"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\"\xce\x17\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\x12=\n\x12\x62yte_stream_opened\x18\" \x01(\x0b\x32\x1f.livekit.proto.ByteStreamOpenedH\x00\x12=\n\x12text_stream_opened\x18# \x01(\x0b\x32\x1f.livekit.proto.TextStreamOpenedH\x00\x12/\n\x0croom_updated\x18$ \x01(\x0b\x32\x17.livekit.proto.RoomInfoH\x00\x12(\n\x05moved\x18% \x01(\x0b\x32\x17.livekit.proto.RoomInfoH\x00\x12\x42\n\x14participants_updated\x18& \x01(\x0b\x32\".livekit.proto.ParticipantsUpdatedH\x00\x12\x62\n%participant_encryption_status_changed\x18\' \x01(\x0b\x32\x31.livekit.proto.ParticipantEncryptionStatusChangedH\x00\x12U\n\x1eparticipant_permission_changed\x18) \x01(\x0b\x32+.livekit.proto.ParticipantPermissionChangedH\x00\x12\x38\n\x0ftoken_refreshed\x18( \x01(\x0b\x32\x1d.livekit.proto.TokenRefreshedH\x00\x12>\n\x12participant_active\x18* \x01(\x0b\x32 .livekit.proto.ParticipantActiveH\x00\x12\x41\n\x14\x64\x61ta_track_published\x18+ \x01(\x0b\x32!.livekit.proto.DataTrackPublishedH\x00\x12\x45\n\x16\x64\x61ta_track_unpublished\x18, \x01(\x0b\x32#.livekit.proto.DataTrackUnpublishedH\x00\x12G\n\x17local_track_republished\x18- \x01(\x0b\x32$.livekit.proto.LocalTrackRepublishedH\x00\x42\t\n\x07message\"\xc9\x02\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\x12\x15\n\rempty_timeout\x18\x06 \x02(\r\x12\x19\n\x11\x64\x65parture_timeout\x18\x07 \x02(\r\x12\x18\n\x10max_participants\x18\x08 \x02(\r\x12\x15\n\rcreation_time\x18\t \x02(\x03\x12\x18\n\x10num_participants\x18\n \x02(\r\x12\x16\n\x0enum_publishers\x18\x0b \x02(\r\x12\x18\n\x10\x61\x63tive_recording\x18\x0c \x02(\x08\"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\"K\n\x13ParticipantsUpdated\x12\x34\n\x0cparticipants\x18\x01 \x03(\x0b\x32\x1e.livekit.proto.ParticipantInfo\"E\n\x14ParticipantConnected\x12-\n\x04info\x18\x01 \x02(\x0b\x32\x1f.livekit.proto.OwnedParticipant\"1\n\x11ParticipantActive\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\"s\n\x17ParticipantDisconnected\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12:\n\x11\x64isconnect_reason\x18\x02 \x02(\x0e\x32\x1f.livekit.proto.DisconnectReason\"(\n\x13LocalTrackPublished\x12\x11\n\ttrack_sid\x18\x01 \x02(\t\"0\n\x15LocalTrackUnpublished\x12\x17\n\x0fpublication_sid\x18\x01 \x02(\t\"|\n\x15LocalTrackRepublished\x12\x1a\n\x12publication_handle\x18\x01 \x02(\x04\x12\x14\n\x0cprevious_sid\x18\x02 \x02(\t\x12\x31\n\x04info\x18\x03 \x02(\x0b\x32#.livekit.proto.TrackPublicationInfo\")\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\"X\n\"ParticipantEncryptionStatusChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x14\n\x0cis_encrypted\x18\x02 \x02(\x08\"D\n\x16ParticipantNameChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x0c\n\x04name\x18\x02 \x02(\t\"v\n\x1cParticipantPermissionChanged\x12\x1c\n\x14participant_identity\x18\x01 \x02(\t\x12\x38\n\npermission\x18\x02 \x01(\x0b\x32$.livekit.proto.ParticipantPermission\"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\"\x1f\n\x0eTokenRefreshed\x12\r\n\x05token\x18\x01 \x02(\t\"\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\"\xc0\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"\xbd\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\"\xc3\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\x12\x18\n\x10request_async_id\x18\x05 \x01(\x04\",\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\"f\n\x10\x42yteStreamOpened\x12\x34\n\x06reader\x18\x01 \x02(\x0b\x32$.livekit.proto.OwnedByteStreamReader\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\"f\n\x10TextStreamOpened\x12\x34\n\x06reader\x18\x01 \x02(\x0b\x32$.livekit.proto.OwnedTextStreamReader\x12\x1c\n\x14participant_identity\x18\x02 \x02(\t\"H\n\x12\x44\x61taTrackPublished\x12\x32\n\x05track\x18\x01 \x02(\x0b\x32#.livekit.proto.OwnedRemoteDataTrack\"#\n\x14\x44\x61taTrackUnpublished\x12\x0b\n\x03sid\x18\x01 \x02(\t*\x90\x02\n\x14SimulateScenarioKind\x12\x1d\n\x19SIMULATE_SIGNAL_RECONNECT\x10\x00\x12\x14\n\x10SIMULATE_SPEAKER\x10\x01\x12\x19\n\x15SIMULATE_NODE_FAILURE\x10\x02\x12\x19\n\x15SIMULATE_SERVER_LEAVE\x10\x03\x12\x16\n\x12SIMULATE_MIGRATION\x10\x04\x12\x16\n\x12SIMULATE_FORCE_TCP\x10\x05\x12\x16\n\x12SIMULATE_FORCE_TLS\x10\x06\x12\x1b\n\x17SIMULATE_FULL_RECONNECT\x10\x07\x12(\n$SIMULATE_DISCONNECT_SIGNAL_ON_RESUME\x10\x08*\xe4\x01\n\x13VideoEncoderBackend\x12\x18\n\x14\x45NCODER_BACKEND_AUTO\x10\x00\x12\x1c\n\x18\x45NCODER_BACKEND_SOFTWARE\x10\x01\x12\x1c\n\x18\x45NCODER_BACKEND_HARDWARE\x10\x02\x12\x19\n\x15\x45NCODER_BACKEND_NVENC\x10\x03\x12\x19\n\x15\x45NCODER_BACKEND_VAAPI\x10\x04\x12 \n\x1c\x45NCODER_BACKEND_VIDEOTOOLBOX\x10\x05\x12\x1f\n\x1b\x45NCODER_BACKEND_PRE_ENCODED\x10\x06*\xd9\x01\n\x15\x44\x65gradationPreference\x12#\n\x1f\x44\x45GRADATION_PREFERENCE_BALANCED\x10\x00\x12-\n)DEGRADATION_PREFERENCE_MAINTAIN_FRAMERATE\x10\x01\x12.\n*DEGRADATION_PREFERENCE_MAINTAIN_RESOLUTION\x10\x02\x12<\n8DEGRADATION_PREFERENCE_MAINTAIN_FRAMERATE_AND_RESOLUTION\x10\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) @@ -32,280 +32,288 @@ _globals['DESCRIPTOR']._serialized_options = b'\252\002\rLiveKit.Proto' _globals['_PUBLISHDATAREQUEST'].fields_by_name['destination_sids']._options = None _globals['_PUBLISHDATAREQUEST'].fields_by_name['destination_sids']._serialized_options = b'\030\001' + _globals['_ROOMDATASTREAMOPTIONS'].fields_by_name['use_legacy_client_implementation']._options = None + _globals['_ROOMDATASTREAMOPTIONS'].fields_by_name['use_legacy_client_implementation']._serialized_options = b'\030\001' _globals['_ROOMOPTIONS'].fields_by_name['e2ee']._options = None _globals['_ROOMOPTIONS'].fields_by_name['e2ee']._serialized_options = b'\030\001' _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._options = None _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_options = b'8\001' _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._options = None _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_options = b'8\001' - _globals['_SIMULATESCENARIOKIND']._serialized_start=15207 - _globals['_SIMULATESCENARIOKIND']._serialized_end=15479 - _globals['_VIDEOENCODERBACKEND']._serialized_start=15482 - _globals['_VIDEOENCODERBACKEND']._serialized_end=15710 - _globals['_DEGRADATIONPREFERENCE']._serialized_start=15713 - _globals['_DEGRADATIONPREFERENCE']._serialized_end=15930 - _globals['_ICETRANSPORTTYPE']._serialized_start=15932 - _globals['_ICETRANSPORTTYPE']._serialized_end=16012 - _globals['_CONTINUALGATHERINGPOLICY']._serialized_start=16014 - _globals['_CONTINUALGATHERINGPOLICY']._serialized_end=16081 - _globals['_CONNECTIONQUALITY']._serialized_start=16083 - _globals['_CONNECTIONQUALITY']._serialized_end=16179 - _globals['_CONNECTIONSTATE']._serialized_start=16181 - _globals['_CONNECTIONSTATE']._serialized_end=16264 - _globals['_DATAPACKETKIND']._serialized_start=16266 - _globals['_DATAPACKETKIND']._serialized_end=16317 - _globals['_CONNECTREQUEST']._serialized_start=156 - _globals['_CONNECTREQUEST']._serialized_end=271 - _globals['_CONNECTRESPONSE']._serialized_start=273 - _globals['_CONNECTRESPONSE']._serialized_end=308 - _globals['_CONNECTCALLBACK']._serialized_start=311 - _globals['_CONNECTCALLBACK']._serialized_end=758 - _globals['_CONNECTCALLBACK_PARTICIPANTWITHTRACKS']._serialized_start=423 - _globals['_CONNECTCALLBACK_PARTICIPANTWITHTRACKS']._serialized_end=560 - _globals['_CONNECTCALLBACK_RESULT']._serialized_start=563 - _globals['_CONNECTCALLBACK_RESULT']._serialized_end=747 - _globals['_DISCONNECTREQUEST']._serialized_start=760 - _globals['_DISCONNECTREQUEST']._serialized_end=875 - _globals['_DISCONNECTRESPONSE']._serialized_start=877 - _globals['_DISCONNECTRESPONSE']._serialized_end=915 - _globals['_DISCONNECTCALLBACK']._serialized_start=917 - _globals['_DISCONNECTCALLBACK']._serialized_end=955 - _globals['_SIMULATESCENARIOREQUEST']._serialized_start=957 - _globals['_SIMULATESCENARIOREQUEST']._serialized_end=1084 - _globals['_SIMULATESCENARIORESPONSE']._serialized_start=1086 - _globals['_SIMULATESCENARIORESPONSE']._serialized_end=1130 - _globals['_SIMULATESCENARIOCALLBACK']._serialized_start=1132 - _globals['_SIMULATESCENARIOCALLBACK']._serialized_end=1191 - _globals['_PUBLISHTRACKREQUEST']._serialized_start=1194 - _globals['_PUBLISHTRACKREQUEST']._serialized_end=1350 - _globals['_PUBLISHTRACKRESPONSE']._serialized_start=1352 - _globals['_PUBLISHTRACKRESPONSE']._serialized_end=1392 - _globals['_PUBLISHTRACKCALLBACK']._serialized_start=1395 - _globals['_PUBLISHTRACKCALLBACK']._serialized_end=1524 - _globals['_READYFORROOMEVENTREQUEST']._serialized_start=1526 - _globals['_READYFORROOMEVENTREQUEST']._serialized_end=1573 - _globals['_READYFORROOMEVENTRESPONSE']._serialized_start=1575 - _globals['_READYFORROOMEVENTRESPONSE']._serialized_end=1602 - _globals['_UNPUBLISHTRACKREQUEST']._serialized_start=1605 - _globals['_UNPUBLISHTRACKREQUEST']._serialized_end=1734 - _globals['_UNPUBLISHTRACKRESPONSE']._serialized_start=1736 - _globals['_UNPUBLISHTRACKRESPONSE']._serialized_end=1778 - _globals['_UNPUBLISHTRACKCALLBACK']._serialized_start=1780 - _globals['_UNPUBLISHTRACKCALLBACK']._serialized_end=1837 - _globals['_PUBLISHDATAREQUEST']._serialized_start=1840 - _globals['_PUBLISHDATAREQUEST']._serialized_end=2051 - _globals['_PUBLISHDATARESPONSE']._serialized_start=2053 - _globals['_PUBLISHDATARESPONSE']._serialized_end=2092 - _globals['_PUBLISHDATACALLBACK']._serialized_start=2094 - _globals['_PUBLISHDATACALLBACK']._serialized_end=2148 - _globals['_PUBLISHTRANSCRIPTIONREQUEST']._serialized_start=2151 - _globals['_PUBLISHTRANSCRIPTIONREQUEST']._serialized_end=2343 - _globals['_PUBLISHTRANSCRIPTIONRESPONSE']._serialized_start=2345 - _globals['_PUBLISHTRANSCRIPTIONRESPONSE']._serialized_end=2393 - _globals['_PUBLISHTRANSCRIPTIONCALLBACK']._serialized_start=2395 - _globals['_PUBLISHTRANSCRIPTIONCALLBACK']._serialized_end=2458 - _globals['_PUBLISHSIPDTMFREQUEST']._serialized_start=2461 - _globals['_PUBLISHSIPDTMFREQUEST']._serialized_end=2605 - _globals['_PUBLISHSIPDTMFRESPONSE']._serialized_start=2607 - _globals['_PUBLISHSIPDTMFRESPONSE']._serialized_end=2649 - _globals['_PUBLISHSIPDTMFCALLBACK']._serialized_start=2651 - _globals['_PUBLISHSIPDTMFCALLBACK']._serialized_end=2708 - _globals['_SETLOCALMETADATAREQUEST']._serialized_start=2710 - _globals['_SETLOCALMETADATAREQUEST']._serialized_end=2813 - _globals['_SETLOCALMETADATARESPONSE']._serialized_start=2815 - _globals['_SETLOCALMETADATARESPONSE']._serialized_end=2859 - _globals['_SETLOCALMETADATACALLBACK']._serialized_start=2861 - _globals['_SETLOCALMETADATACALLBACK']._serialized_end=2920 - _globals['_SENDCHATMESSAGEREQUEST']._serialized_start=2923 - _globals['_SENDCHATMESSAGEREQUEST']._serialized_end=3081 - _globals['_EDITCHATMESSAGEREQUEST']._serialized_start=3084 - _globals['_EDITCHATMESSAGEREQUEST']._serialized_end=3298 - _globals['_SENDCHATMESSAGERESPONSE']._serialized_start=3300 - _globals['_SENDCHATMESSAGERESPONSE']._serialized_end=3343 - _globals['_SENDCHATMESSAGECALLBACK']._serialized_start=3345 - _globals['_SENDCHATMESSAGECALLBACK']._serialized_end=3468 - _globals['_SETLOCALATTRIBUTESREQUEST']._serialized_start=3471 - _globals['_SETLOCALATTRIBUTESREQUEST']._serialized_end=3610 - _globals['_ATTRIBUTESENTRY']._serialized_start=3612 - _globals['_ATTRIBUTESENTRY']._serialized_end=3657 - _globals['_SETLOCALATTRIBUTESRESPONSE']._serialized_start=3659 - _globals['_SETLOCALATTRIBUTESRESPONSE']._serialized_end=3705 - _globals['_SETLOCALATTRIBUTESCALLBACK']._serialized_start=3707 - _globals['_SETLOCALATTRIBUTESCALLBACK']._serialized_end=3768 - _globals['_SETLOCALNAMEREQUEST']._serialized_start=3770 - _globals['_SETLOCALNAMEREQUEST']._serialized_end=3865 - _globals['_SETLOCALNAMERESPONSE']._serialized_start=3867 - _globals['_SETLOCALNAMERESPONSE']._serialized_end=3907 - _globals['_SETLOCALNAMECALLBACK']._serialized_start=3909 - _globals['_SETLOCALNAMECALLBACK']._serialized_end=3964 - _globals['_SETSUBSCRIBEDREQUEST']._serialized_start=3966 - _globals['_SETSUBSCRIBEDREQUEST']._serialized_end=4035 - _globals['_SETSUBSCRIBEDRESPONSE']._serialized_start=4037 - _globals['_SETSUBSCRIBEDRESPONSE']._serialized_end=4060 - _globals['_GETSESSIONSTATSREQUEST']._serialized_start=4062 - _globals['_GETSESSIONSTATSREQUEST']._serialized_end=4133 - _globals['_GETSESSIONSTATSRESPONSE']._serialized_start=4135 - _globals['_GETSESSIONSTATSRESPONSE']._serialized_end=4178 - _globals['_GETSESSIONSTATSCALLBACK']._serialized_start=4181 - _globals['_GETSESSIONSTATSCALLBACK']._serialized_end=4428 - _globals['_GETSESSIONSTATSCALLBACK_RESULT']._serialized_start=4308 - _globals['_GETSESSIONSTATSCALLBACK_RESULT']._serialized_end=4417 - _globals['_VIDEOENCODING']._serialized_start=4430 - _globals['_VIDEOENCODING']._serialized_end=4489 - _globals['_AUDIOENCODING']._serialized_start=4491 - _globals['_AUDIOENCODING']._serialized_end=4527 - _globals['_TRACKPUBLISHOPTIONS']._serialized_start=4530 - _globals['_TRACKPUBLISHOPTIONS']._serialized_end=5064 - _globals['_ICESERVER']._serialized_start=5066 - _globals['_ICESERVER']._serialized_end=5127 - _globals['_RTCCONFIG']._serialized_start=5130 - _globals['_RTCCONFIG']._serialized_end=5326 - _globals['_ROOMDATASTREAMOPTIONS']._serialized_start=5328 - _globals['_ROOMDATASTREAMOPTIONS']._serialized_end=5426 - _globals['_ROOMOPTIONS']._serialized_start=5429 - _globals['_ROOMOPTIONS']._serialized_end=5810 - _globals['_TRANSCRIPTIONSEGMENT']._serialized_start=5812 - _globals['_TRANSCRIPTIONSEGMENT']._serialized_end=5931 - _globals['_BUFFERINFO']._serialized_start=5933 - _globals['_BUFFERINFO']._serialized_end=5981 - _globals['_OWNEDBUFFER']._serialized_start=5983 - _globals['_OWNEDBUFFER']._serialized_end=6084 - _globals['_ROOMEVENT']._serialized_start=6087 - _globals['_ROOMEVENT']._serialized_end=9109 - _globals['_ROOMINFO']._serialized_start=9112 - _globals['_ROOMINFO']._serialized_end=9441 - _globals['_OWNEDROOM']._serialized_start=9443 - _globals['_OWNEDROOM']._serialized_end=9540 - _globals['_PARTICIPANTSUPDATED']._serialized_start=9542 - _globals['_PARTICIPANTSUPDATED']._serialized_end=9617 - _globals['_PARTICIPANTCONNECTED']._serialized_start=9619 - _globals['_PARTICIPANTCONNECTED']._serialized_end=9688 - _globals['_PARTICIPANTACTIVE']._serialized_start=9690 - _globals['_PARTICIPANTACTIVE']._serialized_end=9739 - _globals['_PARTICIPANTDISCONNECTED']._serialized_start=9741 - _globals['_PARTICIPANTDISCONNECTED']._serialized_end=9856 - _globals['_LOCALTRACKPUBLISHED']._serialized_start=9858 - _globals['_LOCALTRACKPUBLISHED']._serialized_end=9898 - _globals['_LOCALTRACKUNPUBLISHED']._serialized_start=9900 - _globals['_LOCALTRACKUNPUBLISHED']._serialized_end=9948 - _globals['_LOCALTRACKREPUBLISHED']._serialized_start=9950 - _globals['_LOCALTRACKREPUBLISHED']._serialized_end=10074 - _globals['_LOCALTRACKSUBSCRIBED']._serialized_start=10076 - _globals['_LOCALTRACKSUBSCRIBED']._serialized_end=10117 - _globals['_TRACKPUBLISHED']._serialized_start=10119 - _globals['_TRACKPUBLISHED']._serialized_end=10224 - _globals['_TRACKUNPUBLISHED']._serialized_start=10226 - _globals['_TRACKUNPUBLISHED']._serialized_end=10299 - _globals['_TRACKSUBSCRIBED']._serialized_start=10301 - _globals['_TRACKSUBSCRIBED']._serialized_end=10390 - _globals['_TRACKUNSUBSCRIBED']._serialized_start=10392 - _globals['_TRACKUNSUBSCRIBED']._serialized_end=10460 - _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_start=10462 - _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_end=10551 - _globals['_TRACKMUTED']._serialized_start=10553 - _globals['_TRACKMUTED']._serialized_end=10614 - _globals['_TRACKUNMUTED']._serialized_start=10616 - _globals['_TRACKUNMUTED']._serialized_end=10679 - _globals['_E2EESTATECHANGED']._serialized_start=10681 - _globals['_E2EESTATECHANGED']._serialized_end=10776 - _globals['_ACTIVESPEAKERSCHANGED']._serialized_start=10778 - _globals['_ACTIVESPEAKERSCHANGED']._serialized_end=10833 - _globals['_ROOMMETADATACHANGED']._serialized_start=10835 - _globals['_ROOMMETADATACHANGED']._serialized_end=10874 - _globals['_ROOMSIDCHANGED']._serialized_start=10876 - _globals['_ROOMSIDCHANGED']._serialized_end=10905 - _globals['_PARTICIPANTMETADATACHANGED']._serialized_start=10907 - _globals['_PARTICIPANTMETADATACHANGED']._serialized_end=10983 - _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_start=10986 - _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_end=11158 - _globals['_PARTICIPANTENCRYPTIONSTATUSCHANGED']._serialized_start=11160 - _globals['_PARTICIPANTENCRYPTIONSTATUSCHANGED']._serialized_end=11248 - _globals['_PARTICIPANTNAMECHANGED']._serialized_start=11250 - _globals['_PARTICIPANTNAMECHANGED']._serialized_end=11318 - _globals['_PARTICIPANTPERMISSIONCHANGED']._serialized_start=11320 - _globals['_PARTICIPANTPERMISSIONCHANGED']._serialized_end=11438 - _globals['_CONNECTIONQUALITYCHANGED']._serialized_start=11440 - _globals['_CONNECTIONQUALITYCHANGED']._serialized_end=11547 - _globals['_USERPACKET']._serialized_start=11549 - _globals['_USERPACKET']._serialized_end=11618 - _globals['_CHATMESSAGE']._serialized_start=11620 - _globals['_CHATMESSAGE']._serialized_end=11741 - _globals['_CHATMESSAGERECEIVED']._serialized_start=11743 - _globals['_CHATMESSAGERECEIVED']._serialized_end=11839 - _globals['_SIPDTMF']._serialized_start=11841 - _globals['_SIPDTMF']._serialized_end=11879 - _globals['_DATAPACKETRECEIVED']._serialized_start=11882 - _globals['_DATAPACKETRECEIVED']._serialized_end=12073 - _globals['_TRANSCRIPTIONRECEIVED']._serialized_start=12075 - _globals['_TRANSCRIPTIONRECEIVED']._serialized_end=12202 - _globals['_CONNECTIONSTATECHANGED']._serialized_start=12204 - _globals['_CONNECTIONSTATECHANGED']._serialized_end=12275 - _globals['_CONNECTED']._serialized_start=12277 - _globals['_CONNECTED']._serialized_end=12288 - _globals['_DISCONNECTED']._serialized_start=12290 - _globals['_DISCONNECTED']._serialized_end=12353 - _globals['_RECONNECTING']._serialized_start=12355 - _globals['_RECONNECTING']._serialized_end=12369 - _globals['_RECONNECTED']._serialized_start=12371 - _globals['_RECONNECTED']._serialized_end=12384 - _globals['_TOKENREFRESHED']._serialized_start=12386 - _globals['_TOKENREFRESHED']._serialized_end=12417 - _globals['_ROOMEOS']._serialized_start=12419 - _globals['_ROOMEOS']._serialized_end=12428 - _globals['_DATASTREAM']._serialized_start=12431 - _globals['_DATASTREAM']._serialized_end=13341 - _globals['_DATASTREAM_TEXTHEADER']._serialized_start=12446 - _globals['_DATASTREAM_TEXTHEADER']._serialized_end=12616 - _globals['_DATASTREAM_BYTEHEADER']._serialized_start=12618 - _globals['_DATASTREAM_BYTEHEADER']._serialized_end=12644 - _globals['_DATASTREAM_HEADER']._serialized_start=12647 - _globals['_DATASTREAM_HEADER']._serialized_end=13010 - _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_start=12943 - _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_end=12992 - _globals['_DATASTREAM_CHUNK']._serialized_start=13012 - _globals['_DATASTREAM_CHUNK']._serialized_end=13105 - _globals['_DATASTREAM_TRAILER']._serialized_start=13108 - _globals['_DATASTREAM_TRAILER']._serialized_end=13274 - _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_start=12943 - _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_end=12992 - _globals['_DATASTREAM_OPERATIONTYPE']._serialized_start=13276 - _globals['_DATASTREAM_OPERATIONTYPE']._serialized_end=13341 - _globals['_DATASTREAMHEADERRECEIVED']._serialized_start=13343 - _globals['_DATASTREAMHEADERRECEIVED']._serialized_end=13449 - _globals['_DATASTREAMCHUNKRECEIVED']._serialized_start=13451 - _globals['_DATASTREAMCHUNKRECEIVED']._serialized_end=13554 - _globals['_DATASTREAMTRAILERRECEIVED']._serialized_start=13556 - _globals['_DATASTREAMTRAILERRECEIVED']._serialized_end=13665 - _globals['_SENDSTREAMHEADERREQUEST']._serialized_start=13668 - _globals['_SENDSTREAMHEADERREQUEST']._serialized_end=13860 - _globals['_SENDSTREAMCHUNKREQUEST']._serialized_start=13863 - _globals['_SENDSTREAMCHUNKREQUEST']._serialized_end=14052 - _globals['_SENDSTREAMTRAILERREQUEST']._serialized_start=14055 - _globals['_SENDSTREAMTRAILERREQUEST']._serialized_end=14250 - _globals['_SENDSTREAMHEADERRESPONSE']._serialized_start=14252 - _globals['_SENDSTREAMHEADERRESPONSE']._serialized_end=14296 - _globals['_SENDSTREAMCHUNKRESPONSE']._serialized_start=14298 - _globals['_SENDSTREAMCHUNKRESPONSE']._serialized_end=14341 - _globals['_SENDSTREAMTRAILERRESPONSE']._serialized_start=14343 - _globals['_SENDSTREAMTRAILERRESPONSE']._serialized_end=14388 - _globals['_SENDSTREAMHEADERCALLBACK']._serialized_start=14390 - _globals['_SENDSTREAMHEADERCALLBACK']._serialized_end=14449 - _globals['_SENDSTREAMCHUNKCALLBACK']._serialized_start=14451 - _globals['_SENDSTREAMCHUNKCALLBACK']._serialized_end=14509 - _globals['_SENDSTREAMTRAILERCALLBACK']._serialized_start=14511 - _globals['_SENDSTREAMTRAILERCALLBACK']._serialized_end=14571 - _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDREQUEST']._serialized_start=14574 - _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDREQUEST']._serialized_end=14721 - _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDRESPONSE']._serialized_start=14723 - _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDRESPONSE']._serialized_end=14773 - _globals['_DATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDCHANGED']._serialized_start=14775 - _globals['_DATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDCHANGED']._serialized_end=14885 - _globals['_BYTESTREAMOPENED']._serialized_start=14887 - _globals['_BYTESTREAMOPENED']._serialized_end=14989 - _globals['_TEXTSTREAMOPENED']._serialized_start=14991 - _globals['_TEXTSTREAMOPENED']._serialized_end=15093 - _globals['_DATATRACKPUBLISHED']._serialized_start=15095 - _globals['_DATATRACKPUBLISHED']._serialized_end=15167 - _globals['_DATATRACKUNPUBLISHED']._serialized_start=15169 - _globals['_DATATRACKUNPUBLISHED']._serialized_end=15204 + _globals['_SIMULATESCENARIOKIND']._serialized_start=15783 + _globals['_SIMULATESCENARIOKIND']._serialized_end=16055 + _globals['_VIDEOENCODERBACKEND']._serialized_start=16058 + _globals['_VIDEOENCODERBACKEND']._serialized_end=16286 + _globals['_DEGRADATIONPREFERENCE']._serialized_start=16289 + _globals['_DEGRADATIONPREFERENCE']._serialized_end=16506 + _globals['_ICETRANSPORTTYPE']._serialized_start=16508 + _globals['_ICETRANSPORTTYPE']._serialized_end=16588 + _globals['_CONTINUALGATHERINGPOLICY']._serialized_start=16590 + _globals['_CONTINUALGATHERINGPOLICY']._serialized_end=16657 + _globals['_CONNECTIONQUALITY']._serialized_start=16659 + _globals['_CONNECTIONQUALITY']._serialized_end=16755 + _globals['_CONNECTIONSTATE']._serialized_start=16757 + _globals['_CONNECTIONSTATE']._serialized_end=16840 + _globals['_DATAPACKETKIND']._serialized_start=16842 + _globals['_DATAPACKETKIND']._serialized_end=16893 + _globals['_INITIALTRACK']._serialized_start=156 + _globals['_INITIALTRACK']._serialized_end=245 + _globals['_INITIALAUDIOTRACK']._serialized_start=247 + _globals['_INITIALAUDIOTRACK']._serialized_end=356 + _globals['_CONNECTREQUEST']._serialized_start=359 + _globals['_CONNECTREQUEST']._serialized_end=591 + _globals['_CONNECTRESPONSE']._serialized_start=593 + _globals['_CONNECTRESPONSE']._serialized_end=628 + _globals['_CONNECTCALLBACK']._serialized_start=631 + _globals['_CONNECTCALLBACK']._serialized_end=1330 + _globals['_CONNECTCALLBACK_PARTICIPANTWITHTRACKS']._serialized_start=743 + _globals['_CONNECTCALLBACK_PARTICIPANTWITHTRACKS']._serialized_end=880 + _globals['_CONNECTCALLBACK_INITIALPUBLICATION']._serialized_start=883 + _globals['_CONNECTCALLBACK_INITIALPUBLICATION']._serialized_end=1053 + _globals['_CONNECTCALLBACK_RESULT']._serialized_start=1056 + _globals['_CONNECTCALLBACK_RESULT']._serialized_end=1319 + _globals['_DISCONNECTREQUEST']._serialized_start=1332 + _globals['_DISCONNECTREQUEST']._serialized_end=1447 + _globals['_DISCONNECTRESPONSE']._serialized_start=1449 + _globals['_DISCONNECTRESPONSE']._serialized_end=1487 + _globals['_DISCONNECTCALLBACK']._serialized_start=1489 + _globals['_DISCONNECTCALLBACK']._serialized_end=1527 + _globals['_SIMULATESCENARIOREQUEST']._serialized_start=1529 + _globals['_SIMULATESCENARIOREQUEST']._serialized_end=1656 + _globals['_SIMULATESCENARIORESPONSE']._serialized_start=1658 + _globals['_SIMULATESCENARIORESPONSE']._serialized_end=1702 + _globals['_SIMULATESCENARIOCALLBACK']._serialized_start=1704 + _globals['_SIMULATESCENARIOCALLBACK']._serialized_end=1763 + _globals['_PUBLISHTRACKREQUEST']._serialized_start=1766 + _globals['_PUBLISHTRACKREQUEST']._serialized_end=1922 + _globals['_PUBLISHTRACKRESPONSE']._serialized_start=1924 + _globals['_PUBLISHTRACKRESPONSE']._serialized_end=1964 + _globals['_PUBLISHTRACKCALLBACK']._serialized_start=1967 + _globals['_PUBLISHTRACKCALLBACK']._serialized_end=2096 + _globals['_READYFORROOMEVENTREQUEST']._serialized_start=2098 + _globals['_READYFORROOMEVENTREQUEST']._serialized_end=2145 + _globals['_READYFORROOMEVENTRESPONSE']._serialized_start=2147 + _globals['_READYFORROOMEVENTRESPONSE']._serialized_end=2174 + _globals['_UNPUBLISHTRACKREQUEST']._serialized_start=2177 + _globals['_UNPUBLISHTRACKREQUEST']._serialized_end=2306 + _globals['_UNPUBLISHTRACKRESPONSE']._serialized_start=2308 + _globals['_UNPUBLISHTRACKRESPONSE']._serialized_end=2350 + _globals['_UNPUBLISHTRACKCALLBACK']._serialized_start=2352 + _globals['_UNPUBLISHTRACKCALLBACK']._serialized_end=2409 + _globals['_PUBLISHDATAREQUEST']._serialized_start=2412 + _globals['_PUBLISHDATAREQUEST']._serialized_end=2623 + _globals['_PUBLISHDATARESPONSE']._serialized_start=2625 + _globals['_PUBLISHDATARESPONSE']._serialized_end=2664 + _globals['_PUBLISHDATACALLBACK']._serialized_start=2666 + _globals['_PUBLISHDATACALLBACK']._serialized_end=2720 + _globals['_PUBLISHTRANSCRIPTIONREQUEST']._serialized_start=2723 + _globals['_PUBLISHTRANSCRIPTIONREQUEST']._serialized_end=2915 + _globals['_PUBLISHTRANSCRIPTIONRESPONSE']._serialized_start=2917 + _globals['_PUBLISHTRANSCRIPTIONRESPONSE']._serialized_end=2965 + _globals['_PUBLISHTRANSCRIPTIONCALLBACK']._serialized_start=2967 + _globals['_PUBLISHTRANSCRIPTIONCALLBACK']._serialized_end=3030 + _globals['_PUBLISHSIPDTMFREQUEST']._serialized_start=3033 + _globals['_PUBLISHSIPDTMFREQUEST']._serialized_end=3177 + _globals['_PUBLISHSIPDTMFRESPONSE']._serialized_start=3179 + _globals['_PUBLISHSIPDTMFRESPONSE']._serialized_end=3221 + _globals['_PUBLISHSIPDTMFCALLBACK']._serialized_start=3223 + _globals['_PUBLISHSIPDTMFCALLBACK']._serialized_end=3280 + _globals['_SETLOCALMETADATAREQUEST']._serialized_start=3282 + _globals['_SETLOCALMETADATAREQUEST']._serialized_end=3385 + _globals['_SETLOCALMETADATARESPONSE']._serialized_start=3387 + _globals['_SETLOCALMETADATARESPONSE']._serialized_end=3431 + _globals['_SETLOCALMETADATACALLBACK']._serialized_start=3433 + _globals['_SETLOCALMETADATACALLBACK']._serialized_end=3492 + _globals['_SENDCHATMESSAGEREQUEST']._serialized_start=3495 + _globals['_SENDCHATMESSAGEREQUEST']._serialized_end=3653 + _globals['_EDITCHATMESSAGEREQUEST']._serialized_start=3656 + _globals['_EDITCHATMESSAGEREQUEST']._serialized_end=3870 + _globals['_SENDCHATMESSAGERESPONSE']._serialized_start=3872 + _globals['_SENDCHATMESSAGERESPONSE']._serialized_end=3915 + _globals['_SENDCHATMESSAGECALLBACK']._serialized_start=3917 + _globals['_SENDCHATMESSAGECALLBACK']._serialized_end=4040 + _globals['_SETLOCALATTRIBUTESREQUEST']._serialized_start=4043 + _globals['_SETLOCALATTRIBUTESREQUEST']._serialized_end=4182 + _globals['_ATTRIBUTESENTRY']._serialized_start=4184 + _globals['_ATTRIBUTESENTRY']._serialized_end=4229 + _globals['_SETLOCALATTRIBUTESRESPONSE']._serialized_start=4231 + _globals['_SETLOCALATTRIBUTESRESPONSE']._serialized_end=4277 + _globals['_SETLOCALATTRIBUTESCALLBACK']._serialized_start=4279 + _globals['_SETLOCALATTRIBUTESCALLBACK']._serialized_end=4340 + _globals['_SETLOCALNAMEREQUEST']._serialized_start=4342 + _globals['_SETLOCALNAMEREQUEST']._serialized_end=4437 + _globals['_SETLOCALNAMERESPONSE']._serialized_start=4439 + _globals['_SETLOCALNAMERESPONSE']._serialized_end=4479 + _globals['_SETLOCALNAMECALLBACK']._serialized_start=4481 + _globals['_SETLOCALNAMECALLBACK']._serialized_end=4536 + _globals['_SETSUBSCRIBEDREQUEST']._serialized_start=4538 + _globals['_SETSUBSCRIBEDREQUEST']._serialized_end=4607 + _globals['_SETSUBSCRIBEDRESPONSE']._serialized_start=4609 + _globals['_SETSUBSCRIBEDRESPONSE']._serialized_end=4632 + _globals['_GETSESSIONSTATSREQUEST']._serialized_start=4634 + _globals['_GETSESSIONSTATSREQUEST']._serialized_end=4705 + _globals['_GETSESSIONSTATSRESPONSE']._serialized_start=4707 + _globals['_GETSESSIONSTATSRESPONSE']._serialized_end=4750 + _globals['_GETSESSIONSTATSCALLBACK']._serialized_start=4753 + _globals['_GETSESSIONSTATSCALLBACK']._serialized_end=5000 + _globals['_GETSESSIONSTATSCALLBACK_RESULT']._serialized_start=4880 + _globals['_GETSESSIONSTATSCALLBACK_RESULT']._serialized_end=4989 + _globals['_VIDEOENCODING']._serialized_start=5002 + _globals['_VIDEOENCODING']._serialized_end=5061 + _globals['_AUDIOENCODING']._serialized_start=5063 + _globals['_AUDIOENCODING']._serialized_end=5099 + _globals['_TRACKPUBLISHOPTIONS']._serialized_start=5102 + _globals['_TRACKPUBLISHOPTIONS']._serialized_end=5636 + _globals['_ICESERVER']._serialized_start=5638 + _globals['_ICESERVER']._serialized_end=5699 + _globals['_RTCCONFIG']._serialized_start=5702 + _globals['_RTCCONFIG']._serialized_end=5898 + _globals['_ROOMDATASTREAMOPTIONS']._serialized_start=5900 + _globals['_ROOMDATASTREAMOPTIONS']._serialized_end=6002 + _globals['_ROOMOPTIONS']._serialized_start=6005 + _globals['_ROOMOPTIONS']._serialized_end=6386 + _globals['_TRANSCRIPTIONSEGMENT']._serialized_start=6388 + _globals['_TRANSCRIPTIONSEGMENT']._serialized_end=6507 + _globals['_BUFFERINFO']._serialized_start=6509 + _globals['_BUFFERINFO']._serialized_end=6557 + _globals['_OWNEDBUFFER']._serialized_start=6559 + _globals['_OWNEDBUFFER']._serialized_end=6660 + _globals['_ROOMEVENT']._serialized_start=6663 + _globals['_ROOMEVENT']._serialized_end=9685 + _globals['_ROOMINFO']._serialized_start=9688 + _globals['_ROOMINFO']._serialized_end=10017 + _globals['_OWNEDROOM']._serialized_start=10019 + _globals['_OWNEDROOM']._serialized_end=10116 + _globals['_PARTICIPANTSUPDATED']._serialized_start=10118 + _globals['_PARTICIPANTSUPDATED']._serialized_end=10193 + _globals['_PARTICIPANTCONNECTED']._serialized_start=10195 + _globals['_PARTICIPANTCONNECTED']._serialized_end=10264 + _globals['_PARTICIPANTACTIVE']._serialized_start=10266 + _globals['_PARTICIPANTACTIVE']._serialized_end=10315 + _globals['_PARTICIPANTDISCONNECTED']._serialized_start=10317 + _globals['_PARTICIPANTDISCONNECTED']._serialized_end=10432 + _globals['_LOCALTRACKPUBLISHED']._serialized_start=10434 + _globals['_LOCALTRACKPUBLISHED']._serialized_end=10474 + _globals['_LOCALTRACKUNPUBLISHED']._serialized_start=10476 + _globals['_LOCALTRACKUNPUBLISHED']._serialized_end=10524 + _globals['_LOCALTRACKREPUBLISHED']._serialized_start=10526 + _globals['_LOCALTRACKREPUBLISHED']._serialized_end=10650 + _globals['_LOCALTRACKSUBSCRIBED']._serialized_start=10652 + _globals['_LOCALTRACKSUBSCRIBED']._serialized_end=10693 + _globals['_TRACKPUBLISHED']._serialized_start=10695 + _globals['_TRACKPUBLISHED']._serialized_end=10800 + _globals['_TRACKUNPUBLISHED']._serialized_start=10802 + _globals['_TRACKUNPUBLISHED']._serialized_end=10875 + _globals['_TRACKSUBSCRIBED']._serialized_start=10877 + _globals['_TRACKSUBSCRIBED']._serialized_end=10966 + _globals['_TRACKUNSUBSCRIBED']._serialized_start=10968 + _globals['_TRACKUNSUBSCRIBED']._serialized_end=11036 + _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_start=11038 + _globals['_TRACKSUBSCRIPTIONFAILED']._serialized_end=11127 + _globals['_TRACKMUTED']._serialized_start=11129 + _globals['_TRACKMUTED']._serialized_end=11190 + _globals['_TRACKUNMUTED']._serialized_start=11192 + _globals['_TRACKUNMUTED']._serialized_end=11255 + _globals['_E2EESTATECHANGED']._serialized_start=11257 + _globals['_E2EESTATECHANGED']._serialized_end=11352 + _globals['_ACTIVESPEAKERSCHANGED']._serialized_start=11354 + _globals['_ACTIVESPEAKERSCHANGED']._serialized_end=11409 + _globals['_ROOMMETADATACHANGED']._serialized_start=11411 + _globals['_ROOMMETADATACHANGED']._serialized_end=11450 + _globals['_ROOMSIDCHANGED']._serialized_start=11452 + _globals['_ROOMSIDCHANGED']._serialized_end=11481 + _globals['_PARTICIPANTMETADATACHANGED']._serialized_start=11483 + _globals['_PARTICIPANTMETADATACHANGED']._serialized_end=11559 + _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_start=11562 + _globals['_PARTICIPANTATTRIBUTESCHANGED']._serialized_end=11734 + _globals['_PARTICIPANTENCRYPTIONSTATUSCHANGED']._serialized_start=11736 + _globals['_PARTICIPANTENCRYPTIONSTATUSCHANGED']._serialized_end=11824 + _globals['_PARTICIPANTNAMECHANGED']._serialized_start=11826 + _globals['_PARTICIPANTNAMECHANGED']._serialized_end=11894 + _globals['_PARTICIPANTPERMISSIONCHANGED']._serialized_start=11896 + _globals['_PARTICIPANTPERMISSIONCHANGED']._serialized_end=12014 + _globals['_CONNECTIONQUALITYCHANGED']._serialized_start=12016 + _globals['_CONNECTIONQUALITYCHANGED']._serialized_end=12123 + _globals['_USERPACKET']._serialized_start=12125 + _globals['_USERPACKET']._serialized_end=12194 + _globals['_CHATMESSAGE']._serialized_start=12196 + _globals['_CHATMESSAGE']._serialized_end=12317 + _globals['_CHATMESSAGERECEIVED']._serialized_start=12319 + _globals['_CHATMESSAGERECEIVED']._serialized_end=12415 + _globals['_SIPDTMF']._serialized_start=12417 + _globals['_SIPDTMF']._serialized_end=12455 + _globals['_DATAPACKETRECEIVED']._serialized_start=12458 + _globals['_DATAPACKETRECEIVED']._serialized_end=12649 + _globals['_TRANSCRIPTIONRECEIVED']._serialized_start=12651 + _globals['_TRANSCRIPTIONRECEIVED']._serialized_end=12778 + _globals['_CONNECTIONSTATECHANGED']._serialized_start=12780 + _globals['_CONNECTIONSTATECHANGED']._serialized_end=12851 + _globals['_CONNECTED']._serialized_start=12853 + _globals['_CONNECTED']._serialized_end=12864 + _globals['_DISCONNECTED']._serialized_start=12866 + _globals['_DISCONNECTED']._serialized_end=12929 + _globals['_RECONNECTING']._serialized_start=12931 + _globals['_RECONNECTING']._serialized_end=12945 + _globals['_RECONNECTED']._serialized_start=12947 + _globals['_RECONNECTED']._serialized_end=12960 + _globals['_TOKENREFRESHED']._serialized_start=12962 + _globals['_TOKENREFRESHED']._serialized_end=12993 + _globals['_ROOMEOS']._serialized_start=12995 + _globals['_ROOMEOS']._serialized_end=13004 + _globals['_DATASTREAM']._serialized_start=13007 + _globals['_DATASTREAM']._serialized_end=13917 + _globals['_DATASTREAM_TEXTHEADER']._serialized_start=13022 + _globals['_DATASTREAM_TEXTHEADER']._serialized_end=13192 + _globals['_DATASTREAM_BYTEHEADER']._serialized_start=13194 + _globals['_DATASTREAM_BYTEHEADER']._serialized_end=13220 + _globals['_DATASTREAM_HEADER']._serialized_start=13223 + _globals['_DATASTREAM_HEADER']._serialized_end=13586 + _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_start=13519 + _globals['_DATASTREAM_HEADER_ATTRIBUTESENTRY']._serialized_end=13568 + _globals['_DATASTREAM_CHUNK']._serialized_start=13588 + _globals['_DATASTREAM_CHUNK']._serialized_end=13681 + _globals['_DATASTREAM_TRAILER']._serialized_start=13684 + _globals['_DATASTREAM_TRAILER']._serialized_end=13850 + _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_start=13519 + _globals['_DATASTREAM_TRAILER_ATTRIBUTESENTRY']._serialized_end=13568 + _globals['_DATASTREAM_OPERATIONTYPE']._serialized_start=13852 + _globals['_DATASTREAM_OPERATIONTYPE']._serialized_end=13917 + _globals['_DATASTREAMHEADERRECEIVED']._serialized_start=13919 + _globals['_DATASTREAMHEADERRECEIVED']._serialized_end=14025 + _globals['_DATASTREAMCHUNKRECEIVED']._serialized_start=14027 + _globals['_DATASTREAMCHUNKRECEIVED']._serialized_end=14130 + _globals['_DATASTREAMTRAILERRECEIVED']._serialized_start=14132 + _globals['_DATASTREAMTRAILERRECEIVED']._serialized_end=14241 + _globals['_SENDSTREAMHEADERREQUEST']._serialized_start=14244 + _globals['_SENDSTREAMHEADERREQUEST']._serialized_end=14436 + _globals['_SENDSTREAMCHUNKREQUEST']._serialized_start=14439 + _globals['_SENDSTREAMCHUNKREQUEST']._serialized_end=14628 + _globals['_SENDSTREAMTRAILERREQUEST']._serialized_start=14631 + _globals['_SENDSTREAMTRAILERREQUEST']._serialized_end=14826 + _globals['_SENDSTREAMHEADERRESPONSE']._serialized_start=14828 + _globals['_SENDSTREAMHEADERRESPONSE']._serialized_end=14872 + _globals['_SENDSTREAMCHUNKRESPONSE']._serialized_start=14874 + _globals['_SENDSTREAMCHUNKRESPONSE']._serialized_end=14917 + _globals['_SENDSTREAMTRAILERRESPONSE']._serialized_start=14919 + _globals['_SENDSTREAMTRAILERRESPONSE']._serialized_end=14964 + _globals['_SENDSTREAMHEADERCALLBACK']._serialized_start=14966 + _globals['_SENDSTREAMHEADERCALLBACK']._serialized_end=15025 + _globals['_SENDSTREAMCHUNKCALLBACK']._serialized_start=15027 + _globals['_SENDSTREAMCHUNKCALLBACK']._serialized_end=15085 + _globals['_SENDSTREAMTRAILERCALLBACK']._serialized_start=15087 + _globals['_SENDSTREAMTRAILERCALLBACK']._serialized_end=15147 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDREQUEST']._serialized_start=15150 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDREQUEST']._serialized_end=15297 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDRESPONSE']._serialized_start=15299 + _globals['_SETDATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDRESPONSE']._serialized_end=15349 + _globals['_DATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDCHANGED']._serialized_start=15351 + _globals['_DATACHANNELBUFFEREDAMOUNTLOWTHRESHOLDCHANGED']._serialized_end=15461 + _globals['_BYTESTREAMOPENED']._serialized_start=15463 + _globals['_BYTESTREAMOPENED']._serialized_end=15565 + _globals['_TEXTSTREAMOPENED']._serialized_start=15567 + _globals['_TEXTSTREAMOPENED']._serialized_end=15669 + _globals['_DATATRACKPUBLISHED']._serialized_start=15671 + _globals['_DATATRACKPUBLISHED']._serialized_end=15743 + _globals['_DATATRACKUNPUBLISHED']._serialized_start=15745 + _globals['_DATATRACKUNPUBLISHED']._serialized_end=15780 # @@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 68f861d3b..48f3ad58e 100644 --- a/livekit-rtc/livekit/rtc/_proto/room_pb2.pyi +++ b/livekit-rtc/livekit/rtc/_proto/room_pb2.pyi @@ -235,6 +235,55 @@ KIND_LOSSY: DataPacketKind.ValueType # 0 KIND_RELIABLE: DataPacketKind.ValueType # 1 global___DataPacketKind = DataPacketKind +@typing.final +class InitialTrack(google.protobuf.message.Message): + """A local track prepared before connecting. The caller retains ownership of the track handle.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TRACK_HANDLE_FIELD_NUMBER: builtins.int + OPTIONS_FIELD_NUMBER: builtins.int + track_handle: builtins.int + @property + def options(self) -> global___TrackPublishOptions: ... + def __init__( + self, + *, + track_handle: builtins.int | None = ..., + options: global___TrackPublishOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["options", b"options", "track_handle", b"track_handle"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["options", b"options", "track_handle", b"track_handle"]) -> None: ... + +global___InitialTrack = InitialTrack + +@typing.final +class InitialAudioTrack(google.protobuf.message.Message): + """An audio publication described without constructing a native track on the caller thread. + The caller retains ownership of the source handle. Options include all codec/encoding settings. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SOURCE_HANDLE_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + OPTIONS_FIELD_NUMBER: builtins.int + source_handle: builtins.int + name: builtins.str + @property + def options(self) -> global___TrackPublishOptions: ... + def __init__( + self, + *, + source_handle: builtins.int | None = ..., + name: builtins.str | None = ..., + options: global___TrackPublishOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["name", b"name", "options", b"options", "source_handle", b"source_handle"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "options", b"options", "source_handle", b"source_handle"]) -> None: ... + +global___InitialAudioTrack = InitialAudioTrack + @typing.final class ConnectRequest(google.protobuf.message.Message): """Connect to a new LiveKit room""" @@ -245,11 +294,17 @@ class ConnectRequest(google.protobuf.message.Message): TOKEN_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int REQUEST_ASYNC_ID_FIELD_NUMBER: builtins.int + PUBLISH_TRACKS_FIELD_NUMBER: builtins.int + PUBLISH_AUDIO_TRACKS_FIELD_NUMBER: builtins.int url: builtins.str token: builtins.str request_async_id: builtins.int @property def options(self) -> global___RoomOptions: ... + @property + def publish_tracks(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___InitialTrack]: ... + @property + def publish_audio_tracks(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___InitialAudioTrack]: ... def __init__( self, *, @@ -257,9 +312,11 @@ class ConnectRequest(google.protobuf.message.Message): token: builtins.str | None = ..., options: global___RoomOptions | None = ..., request_async_id: builtins.int | None = ..., + publish_tracks: collections.abc.Iterable[global___InitialTrack] | None = ..., + publish_audio_tracks: collections.abc.Iterable[global___InitialAudioTrack] | None = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["options", b"options", "request_async_id", b"request_async_id", "token", b"token", "url", b"url"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["options", b"options", "request_async_id", b"request_async_id", "token", b"token", "url", b"url"]) -> None: ... + def ClearField(self, field_name: typing.Literal["options", b"options", "publish_audio_tracks", b"publish_audio_tracks", "publish_tracks", b"publish_tracks", "request_async_id", b"request_async_id", "token", b"token", "url", b"url"]) -> None: ... global___ConnectRequest = ConnectRequest @@ -306,6 +363,33 @@ class ConnectCallback(google.protobuf.message.Message): def HasField(self, field_name: typing.Literal["participant", b"participant"]) -> builtins.bool: ... def ClearField(self, field_name: typing.Literal["participant", b"participant", "publications", b"publications"]) -> None: ... + @typing.final + class InitialPublication(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TRACK_HANDLE_FIELD_NUMBER: builtins.int + PUBLICATION_FIELD_NUMBER: builtins.int + TRACK_FIELD_NUMBER: builtins.int + AUDIO_TRACK_INDEX_FIELD_NUMBER: builtins.int + track_handle: builtins.int + audio_track_index: builtins.int + @property + def publication(self) -> track_pb2.OwnedTrackPublication: ... + @property + def track(self) -> track_pb2.OwnedTrack: + """Present only for a track constructed from publish_audio_tracks by this connect.""" + + def __init__( + self, + *, + track_handle: builtins.int | None = ..., + publication: track_pb2.OwnedTrackPublication | None = ..., + track: track_pb2.OwnedTrack | None = ..., + audio_track_index: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["audio_track_index", b"audio_track_index", "publication", b"publication", "track", b"track", "track_handle", b"track_handle"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["audio_track_index", b"audio_track_index", "publication", b"publication", "track", b"track", "track_handle", b"track_handle"]) -> None: ... + @typing.final class Result(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -313,21 +397,25 @@ class ConnectCallback(google.protobuf.message.Message): ROOM_FIELD_NUMBER: builtins.int LOCAL_PARTICIPANT_FIELD_NUMBER: builtins.int PARTICIPANTS_FIELD_NUMBER: builtins.int + LOCAL_PUBLICATIONS_FIELD_NUMBER: builtins.int @property def room(self) -> global___OwnedRoom: ... @property def local_participant(self) -> participant_pb2.OwnedParticipant: ... @property def participants(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ConnectCallback.ParticipantWithTracks]: ... + @property + def local_publications(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ConnectCallback.InitialPublication]: ... def __init__( self, *, room: global___OwnedRoom | None = ..., local_participant: participant_pb2.OwnedParticipant | None = ..., participants: collections.abc.Iterable[global___ConnectCallback.ParticipantWithTracks] | None = ..., + local_publications: collections.abc.Iterable[global___ConnectCallback.InitialPublication] | None = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["local_participant", b"local_participant", "room", b"room"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["local_participant", b"local_participant", "participants", b"participants", "room", b"room"]) -> None: ... + def ClearField(self, field_name: typing.Literal["local_participant", b"local_participant", "local_publications", b"local_publications", "participants", b"participants", "room", b"room"]) -> None: ... ASYNC_ID_FIELD_NUMBER: builtins.int ERROR_FIELD_NUMBER: builtins.int @@ -1399,13 +1487,10 @@ class RoomDataStreamOptions(google.protobuf.message.Message): receiving side. Unset falls back to the SDK default. """ use_legacy_client_implementation: builtins.bool - """Temporary migration aid for SDKs that still implement data streams in - their own client-side code on top of the FFI instead of using the FFI - data stream API. When true, this client does not advertise data streams - v2 support: ClientInfo.client_protocol is capped at 1 (DATA_STREAM_RPC), - so remote clients will not use v2-only behavior toward this client. - Defaults to false (v2 advertised). Will be removed once all FFI - consumers migrate. + """Deprecated: no client SDK uses this anymore, and it is ignored. It was a + temporary migration aid for SDKs that implemented data streams in their + own client-side code on top of the FFI; data streams v2 support is now + always advertised. Kept only so the field number is not reused. """ def __init__( self, diff --git a/livekit-rtc/livekit/rtc/room.py b/livekit-rtc/livekit/rtc/room.py index ef8289b52..ce38b0d8a 100644 --- a/livekit-rtc/livekit/rtc/room.py +++ b/livekit-rtc/livekit/rtc/room.py @@ -13,15 +13,15 @@ # limitations under the License. from __future__ import annotations -import datetime import asyncio import ctypes +import datetime import logging -from dataclasses import dataclass, field -from typing import Callable, Dict, Literal, Optional, cast, Mapping import warnings +from collections.abc import Mapping +from dataclasses import dataclass, field +from typing import Callable, Dict, Literal, Optional, cast -from .event_emitter import EventEmitter from ._ffi_client import FfiClient, FfiHandle from ._proto import ffi_pb2 as proto_ffi from ._proto import participant_pb2 as proto_participant @@ -29,10 +29,19 @@ from ._proto import stats_pb2 as proto_stats from ._proto.participant_pb2 import DisconnectReason from ._proto.room_pb2 import ConnectionState, SimulateScenarioKind -from ._proto.track_pb2 import TrackKind from ._proto.rpc_pb2 import RpcMethodInvocationEvent -from ._utils import BroadcastQueue +from ._proto.track_pb2 import TrackKind +from ._utils import BroadcastQueue, Queue +from .audio_source import AudioSource +from .data_stream import ( + ByteStreamHandler, + ByteStreamReader, + TextStreamHandler, + TextStreamReader, +) +from .data_track import RemoteDataTrack from .e2ee import E2EEManager, E2EEOptions +from .event_emitter import EventEmitter from .log import logger from .participant import ( LocalParticipant, @@ -40,17 +49,9 @@ RemoteParticipant, _connection_quality_from_proto, ) -from .track import RemoteAudioTrack, RemoteVideoTrack -from .track_publication import RemoteTrackPublication, TrackPublication +from .track import LocalAudioTrack, LocalTrack, RemoteAudioTrack, RemoteVideoTrack +from .track_publication import LocalTrackPublication, RemoteTrackPublication, TrackPublication from .transcription import TranscriptionSegment -from .data_stream import ( - TextStreamReader, - ByteStreamReader, - TextStreamHandler, - ByteStreamHandler, -) -from .data_track import RemoteDataTrack - EventTypes = Literal[ "participant_connected", @@ -115,6 +116,25 @@ class DataStreamOptions: When None, uses the FFI default.""" +@dataclass +class AudioTrackToPublish: + """Describe an audio publication whose native track is created during connection. + + The source accepts PCM later; no capture device or generated audio is required. + Do not modify or reuse a descriptor while its connection attempt is in progress. + """ + + source: AudioSource + name: str = "audio" + options: proto_room.TrackPublishOptions = field(default_factory=proto_room.TrackPublishOptions) + _track: LocalAudioTrack | None = field(default=None, init=False, repr=False, compare=False) + + @property + def track(self) -> LocalAudioTrack | None: + """The track returned by a successful connection, or None before completion.""" + return self._track + + @dataclass class RoomOptions: auto_subscribe: bool = True @@ -132,6 +152,21 @@ class RoomOptions: """Use a single peer connection for both publish and subscribe. When None, uses the default (true).""" data_stream: DataStreamOptions | None = None """Options for incoming data streams. When None, uses the FFI defaults.""" + publish_tracks: list[tuple[LocalTrack, proto_room.TrackPublishOptions]] = field( + default_factory=list + ) + """Tracks and complete publication options to publish while connecting. + + Prepare sources without capturing media first. Supported servers can bundle publication + with JOIN; other configurations use normal publication. Publications are available through + ``local_participant.track_publications`` after connect. Do not publish these tracks again. + """ + publish_audio_tracks: list[AudioTrackToPublish] = field(default_factory=list) + """Audio sources and publication settings prepared natively inside connect. + + Use this instead of constructing a local audio track first to keep native setup off the + caller's event loop. Created tracks are available on each descriptor after connect. + """ @dataclass @@ -482,6 +517,17 @@ def on_participant_connected(participant): await room.connect("ws://localhost:7880", "your_token") ``` """ + # Snapshot caller-owned configuration and retain tracks through the async connect. + initial_tracks = {track._ffi_handle.handle: track for track, _ in options.publish_tracks} + if len(initial_tracks) != len(options.publish_tracks): + raise ValueError("publish_tracks contains the same track more than once") + + initial_audio = list(options.publish_audio_tracks) + if len({id(audio) for audio in initial_audio}) != len(initial_audio): + raise ValueError("publish_audio_tracks contains the same descriptor more than once") + for audio in initial_audio: + audio._track = None + self._server_url = url self._token = token self._is_connecting = True @@ -490,6 +536,15 @@ def on_participant_connected(participant): req = proto_ffi.FfiRequest() req.connect.url = url req.connect.token = token + for track, publish_options in options.publish_tracks: + initial = req.connect.publish_tracks.add(track_handle=track._ffi_handle.handle) + initial.options.CopyFrom(publish_options) + + for audio in initial_audio: + initial = req.connect.publish_audio_tracks.add( + source_handle=audio.source._ffi_handle.handle, name=audio.name + ) + initial.options.CopyFrom(audio.options) # options req.connect.options.auto_subscribe = options.auto_subscribe @@ -582,9 +637,10 @@ def on_participant_connected(participant): queue = FfiClient.instance.queue.subscribe() try: resp = FfiClient.instance.request(req) - cb: proto_ffi.FfiEvent = await queue.wait_for( - lambda e: e.connect.async_id == resp.connect.async_id - ) + if initial_tracks or initial_audio: + cb = await self._wait_prepared_connect(queue, resp.connect.async_id) + else: + cb = await queue.wait_for(lambda e: e.connect.async_id == resp.connect.async_id) finally: FfiClient.instance.queue.unsubscribe(queue) @@ -606,6 +662,17 @@ def on_participant_connected(participant): self._room_queue, cb.connect.result.local_participant ) + for initial in cb.connect.result.local_publications: + if initial.HasField("track"): + track = LocalAudioTrack(initial.track) + initial_audio[initial.audio_track_index]._track = track + else: + track = initial_tracks[initial.track_handle] + publication = LocalTrackPublication(initial.publication) + publication._track = track + track._info.sid = publication.sid + self._local_participant._track_publications[publication.sid] = publication + for pt in cb.connect.result.participants: rp = self._create_remote_participant(pt.participant) @@ -619,10 +686,12 @@ def on_participant_connected(participant): except BaseException as e: if self._ffi_handle is None and hasattr(self, "_ffi_queue"): FfiClient.instance.queue.unsubscribe(self._ffi_queue) + # Do not store the original traceback on a room-owned future: its connect frame + # retains the room, caller options and prepared tracks after a failed connection. self._fail_first_sid( RuntimeError("room connection was cancelled") if isinstance(e, asyncio.CancelledError) - else e + else ConnectError(str(e)) ) raise finally: @@ -639,6 +708,59 @@ def on_participant_connected(participant): ready_req.ready_for_room_event.room_handle = self._ffi_handle.handle FfiClient.instance.request(ready_req) + async def _wait_prepared_connect( + self, queue: Queue[proto_ffi.FfiEvent], async_id: int + ) -> proto_ffi.FfiEvent: + """Reclaim connect-owned publications if the caller cancels before the callback.""" + callback = self._loop.create_task( + queue.wait_for(lambda e: e.connect.async_id == async_id), + name="prepared_connect_callback", + ) + try: + return await asyncio.shield(callback) + except asyncio.CancelledError: + # The native connect request cannot be cancelled. Wait for its bounded connection + # attempt and tear down any successful room before releasing the prepared sources. + cleanup = self._loop.create_task( + self._discard_prepared_connect(callback, queue), name="prepared_connect_cleanup" + ) + while not cleanup.done(): + try: + await asyncio.shield(cleanup) + except asyncio.CancelledError: + continue + cleanup.result() + raise + + async def _discard_prepared_connect( + self, callback: asyncio.Task[proto_ffi.FfiEvent], queue: Queue[proto_ffi.FfiEvent] + ) -> None: + """Disconnect an unclaimed room and release all handles in its connect result.""" + event = await callback + if event.connect.WhichOneof("message") != "result": + return + result = event.connect.result + handle = result.room.handle.id + try: + ready = proto_ffi.FfiRequest() + ready.ready_for_room_event.room_handle = handle + FfiClient.instance.request(ready) + request = proto_ffi.FfiRequest() + request.disconnect.room_handle = handle + response = FfiClient.instance.request(request) + await queue.wait_for(lambda e: e.disconnect.async_id == response.disconnect.async_id) + finally: + FfiHandle(result.local_participant.handle.id).dispose() + for initial in result.local_publications: + FfiHandle(initial.publication.handle.id).dispose() + if initial.HasField("track"): + FfiHandle(initial.track.handle.id).dispose() + for participant in result.participants: + FfiHandle(participant.participant.handle.id).dispose() + for publication in participant.publications: + FfiHandle(publication.handle.id).dispose() + FfiHandle(handle).dispose() + async def get_rtc_stats(self) -> RtcStats: if not self.isconnected(): raise RuntimeError("the room isn't connected") diff --git a/livekit-rtc/rust-sdks b/livekit-rtc/rust-sdks index c0de3bc4c..cfafe39e4 160000 --- a/livekit-rtc/rust-sdks +++ b/livekit-rtc/rust-sdks @@ -1 +1 @@ -Subproject commit c0de3bc4c1c129b1e5a420f80bbffa0b4595396c +Subproject commit cfafe39e44d8f36f2030225128bd1a78ad891603 diff --git a/tests/rtc/test_connect_publication.py b/tests/rtc/test_connect_publication.py new file mode 100644 index 000000000..7603376c7 --- /dev/null +++ b/tests/rtc/test_connect_publication.py @@ -0,0 +1,180 @@ +"""Connect-time publications are installed before room events are released.""" + +import asyncio +from types import SimpleNamespace +from unittest.mock import Mock + +import pytest +from livekit import rtc +from livekit.rtc._ffi_client import FfiClient, FfiHandle, FfiQueue +from livekit.rtc._proto import ffi_pb2 as ffi +from livekit.rtc._proto import track_pb2 + + +@pytest.mark.asyncio +@pytest.mark.parametrize("outcome", ["success", "failure", "cancel"]) +@pytest.mark.parametrize("native_preparation", [False, True]) +async def test_connect_prepared_publication_state_and_cleanup( + monkeypatch, outcome, native_preparation +): + queue = FfiQueue[ffi.FfiEvent]() + track = Mock(spec=rtc.LocalAudioTrack) + track._ffi_handle = SimpleNamespace(handle=42) + track._info = track_pb2.TrackInfo() + options = rtc.TrackPublishOptions(source=rtc.TrackSource.SOURCE_MICROPHONE) + options.audio_encoding.max_bitrate = 32000 + options.dtx = False + source = Mock(spec=rtc.AudioSource) + source._ffi_handle = SimpleNamespace(handle=44) + audio = rtc.AudioTrackToPublish(source=source, name="prepared", options=options) + consumed = set() + dispose = FfiHandle.dispose + + def observe_dispose(handle): + if not handle.disposed: + consumed.add(handle.handle) + dispose(handle) + + monkeypatch.setattr(FfiHandle, "dispose", observe_dispose) + monkeypatch.setattr( + rtc.LocalAudioTrack, + "create_audio_track", + Mock(side_effect=AssertionError("native track creation must stay inside Rust connect")), + ) + observed = [] + pending = [] + ready = asyncio.Event() + room = rtc.Room() + + def request(req): + response = ffi.FfiResponse() + event = ffi.FfiEvent() + which = req.WhichOneof("message") + if which == "connect": + if native_preparation: + initial = req.connect.publish_audio_tracks[0] + assert initial.source_handle == 44 + assert initial.name == "prepared" + assert not req.connect.publish_tracks + else: + initial = req.connect.publish_tracks[0] + assert initial.track_handle == 42 + assert not req.connect.publish_audio_tracks + assert initial.options == options + response.connect.async_id = event.connect.async_id = 7 + if outcome == "failure": + event.connect.error = "publication rejected" + else: + result = event.connect.result + result.room.handle.id = 1 + result.room.info.sid = "RM_prepared" + result.local_participant.handle.id = 2 + initial = result.local_publications.add( + track_handle=50 if native_preparation else 42 + ) + publication = initial.publication + publication.handle.id = 3 + publication.info.sid = "TR_prepared" + if native_preparation: + initial.audio_track_index = 0 + initial.track.handle.id = 50 + initial.track.info.name = "prepared" + initial.track.info.kind = rtc.TrackKind.KIND_AUDIO + if outcome == "cancel": + pending.append(event) + ready.set() + return response + elif which == "ready_for_room_event": + if outcome == "cancel": + return response + publication = room.local_participant.track_publications["TR_prepared"] + expected = audio.track if native_preparation else track + assert publication.track is expected + assert expected._info.sid == publication.sid + published = ffi.FfiEvent() + published.room_event.room_handle = 1 + published.room_event.local_track_published.track_sid = publication.sid + queue.put(published) + return response + elif which == "disconnect": + response.disconnect.async_id = event.disconnect.async_id = 8 + eos = ffi.FfiEvent() + eos.room_event.room_handle = 1 + eos.room_event.eos.SetInParent() + queue.put(eos) + else: + raise AssertionError(which) + queue.put(event) + return response + + # Synthetic handles must never reach the real native handle table. + monkeypatch.setattr( + FfiClient, "_instance", SimpleNamespace(queue=queue, request=request, _pid=-1) + ) + room.on("local_track_published", lambda pub, local: observed.append((pub, local))) + connecting = asyncio.create_task( + room.connect( + "wss://example.invalid", + "test", + rtc.RoomOptions( + publish_tracks=[] if native_preparation else [(track, options)], + publish_audio_tracks=[audio] if native_preparation else [], + ), + ) + ) + if outcome == "cancel": + await ready.wait() + connecting.cancel() + queue.put(pending[0]) + with pytest.raises(asyncio.CancelledError): + await connecting + elif outcome == "failure": + with pytest.raises(rtc.ConnectError, match="publication rejected"): + await connecting + else: + await connecting + await asyncio.sleep(0) + await asyncio.sleep(0) + assert len(observed) == 1 + assert observed[0][1] is (audio.track if native_preparation else track) + await room.disconnect() + room._ffi_handle = None + assert not room._is_connecting + assert not queue._subscribers + if outcome != "success": + assert room._local_participant is None + assert not track._info.sid + assert audio.track is None + if outcome == "cancel" and native_preparation: + assert 50 in consumed + assert 3 in consumed + assert 44 not in consumed # The caller still owns the source. + + +@pytest.mark.asyncio +async def test_duplicate_prepared_track_rejected_before_connect(monkeypatch): + track = Mock(spec=rtc.LocalAudioTrack) + track._ffi_handle = SimpleNamespace(handle=42) + options = rtc.TrackPublishOptions() + room = rtc.Room() + with pytest.raises(ValueError, match="same track"): + await room.connect( + "wss://example.invalid", + "test", + rtc.RoomOptions(publish_tracks=[(track, options), (track, options)]), + ) + assert not room._is_connecting + + +@pytest.mark.asyncio +async def test_duplicate_audio_description_rejected_before_connect(): + source = Mock(spec=rtc.AudioSource) + audio = rtc.AudioTrackToPublish(source=source) + room = rtc.Room() + with pytest.raises(ValueError, match="same descriptor"): + await room.connect( + "wss://example.invalid", + "test", + rtc.RoomOptions(publish_audio_tracks=[audio, audio]), + ) + assert not room._is_connecting diff --git a/tests/rtc/test_connect_publication_e2e.py b/tests/rtc/test_connect_publication_e2e.py new file mode 100644 index 000000000..65e9b2645 --- /dev/null +++ b/tests/rtc/test_connect_publication_e2e.py @@ -0,0 +1,261 @@ +"""Real-SFU coverage for prepared, ordinary, failed and cancelled audio publications. + +Run with LIVEKIT_URL, LIVEKIT_API_KEY and LIVEKIT_API_SECRET set. LIVEKIT_LIB_PATH +must point to a native FFI build supporting ConnectRequest.publish_tracks. +""" + +import asyncio +import gc +import math +import os +import uuid +import weakref +from array import array + +import pytest +from livekit import api, rtc + +pytestmark = [ + pytest.mark.asyncio, + pytest.mark.skipif(not os.environ.get("LIVEKIT_URL"), reason="requires a test LiveKit server"), +] + + +def token(room, identity): + return ( + api.AccessToken() + .with_identity(identity) + .with_grants(api.VideoGrants(room_join=True, room=room)) + .to_jwt() + ) + + +async def round_trip(single_pc, mode): + name = "prepared-audio-" + uuid.uuid4().hex[:12] + receiver, sender = rtc.Room(), rtc.Room() + source = rtc.AudioSource(24000, 1) + track = None if mode == "source" else rtc.LocalAudioTrack.create_audio_track("prepared", source) + options = rtc.TrackPublishOptions(source=rtc.TrackSource.SOURCE_MICROPHONE) + audio = rtc.AudioTrackToPublish(source=source, name="prepared", options=options) + prepared = mode != "normal" + subscribed = asyncio.get_running_loop().create_future() + receiver.on("track_subscribed", lambda remote, *_: subscribed.set_result(remote)) + stream = None + try: + await receiver.connect(os.environ["LIVEKIT_URL"], token(name, "listener")) + await sender.connect( + os.environ["LIVEKIT_URL"], + token(name, "agent"), + rtc.RoomOptions( + single_peer_connection=single_pc, + publish_tracks=[(track, options)] if mode == "existing" else [], + publish_audio_tracks=[audio] if mode == "source" else [], + ), + ) + if mode == "source": + track = audio.track + assert track is not None + if prepared: + assert len(sender.local_participant.track_publications) == 1 + publication = next(iter(sender.local_participant.track_publications.values())) + assert publication.track is track + else: + assert not sender.local_participant.track_publications + publication = await sender.local_participant.publish_track(track, options) + await asyncio.wait_for(publication.wait_for_subscription(), 10) + remote = await asyncio.wait_for(subscribed, 10) + stream = rtc.AudioStream(remote, sample_rate=24000, num_channels=1, capacity=8) + pcm = array("h", [int(8000 * math.sin(2 * math.pi * 440 * i / 24000)) for i in range(480)]) + + async def produce(): + for _ in range(12): + await source.capture_frame(rtc.AudioFrame(pcm.tobytes(), 24000, 1, 480)) + await source.wait_for_playout() + + async def receive(): + async for event in stream: + if any(abs(value) > 160 for value in event.frame.data): + return + raise AssertionError("audio ended before receiving non-silent PCM") + + tasks = [ + asyncio.create_task(produce()), + asyncio.create_task(asyncio.wait_for(receive(), 10)), + ] + try: + await asyncio.gather(*tasks) + finally: + for task in tasks: + task.cancel() + await asyncio.gather(*tasks, return_exceptions=True) + assert len(sender.local_participant.track_publications) == 1 + # Caller-owned track remains usable after connect; it can be unpublished normally. + await sender.local_participant.unpublish_track(publication.sid) + assert not sender.local_participant.track_publications + references = [weakref.ref(source), weakref.ref(track), weakref.ref(publication)] + finally: + if stream is not None: + await stream.aclose() + await asyncio.gather(sender.disconnect(), receiver.disconnect()) + await source.aclose() + async with api.LiveKitAPI() as client: + await client.room.delete_room(api.DeleteRoomRequest(room=name)) + return references + + +@pytest.mark.parametrize("single_pc", [False, True]) +@pytest.mark.parametrize("mode", ["normal", "existing", "source"]) +async def test_audio_after_prepared_or_normal_publication(single_pc, mode): + for _ in range(2): + references = await round_trip(single_pc, mode) + gc.collect() + assert all(reference() is None for reference in references) + + +@pytest.mark.parametrize("cancel", [False, True]) +@pytest.mark.parametrize("native_source", [False, True]) +async def test_failed_or_cancelled_connect_releases_prepared_track(cancel, native_source): + source = rtc.AudioSource(24000, 1) + track = None if native_source else rtc.LocalAudioTrack.create_audio_track("prepared", source) + audio = rtc.AudioTrackToPublish(source=source, name="prepared") + refs = [weakref.ref(source), weakref.ref(audio)] + if track is not None: + refs.append(weakref.ref(track)) + room = rtc.Room() + connect_options = rtc.RoomOptions( + publish_tracks=[] if native_source else [(track, rtc.TrackPublishOptions())], + publish_audio_tracks=[audio] if native_source else [], + ) + connecting = asyncio.create_task( + room.connect(os.environ["LIVEKIT_URL"], "invalid-token", connect_options) + ) + if cancel: + await asyncio.sleep(0) + connecting.cancel() + with pytest.raises(asyncio.CancelledError): + await connecting + else: + with pytest.raises(rtc.ConnectError): + await connecting + assert not room.isconnected() + assert room._local_participant is None + await source.aclose() + assert audio.track is None + del source, track, audio, connecting, connect_options + # A completed task can remain in the event loop's current callback until it yields. + await asyncio.sleep(0) + gc.collect() + assert all(reference() is None for reference in refs) + + +@pytest.mark.parametrize("native_source", [False, True]) +async def test_cancelled_successful_connect_reclaims_publication(native_source): + """A late successful callback must be disconnected and its owned handles released.""" + for _ in range(2): + name = "cancel-prepared-" + uuid.uuid4().hex[:12] + room = rtc.Room() + source = rtc.AudioSource(24000, 1) + track = ( + None if native_source else rtc.LocalAudioTrack.create_audio_track("cancelled", source) + ) + audio = rtc.AudioTrackToPublish(source=source, name="cancelled") + refs = [weakref.ref(source), weakref.ref(audio)] + if track is not None: + refs.append(weakref.ref(track)) + options = rtc.RoomOptions( + publish_tracks=[] if native_source else [(track, rtc.TrackPublishOptions())], + publish_audio_tracks=[audio] if native_source else [], + ) + connecting = asyncio.create_task( + room.connect(os.environ["LIVEKIT_URL"], token(name, "agent"), options) + ) + await asyncio.sleep(0) + connecting.cancel() + try: + with pytest.raises(asyncio.CancelledError): + await connecting + assert not room.isconnected() + assert room._local_participant is None + assert not room._is_connecting + await source.aclose() + finally: + async with api.LiveKitAPI() as client: + await client.room.delete_room(api.DeleteRoomRequest(room=name)) + assert audio.track is None + del source, track, audio, connecting, options + await asyncio.sleep(0) + gc.collect() + assert all(reference() is None for reference in refs) + + +async def test_partial_audio_source_validation_releases_borrowed_sources(): + from types import SimpleNamespace + + source = rtc.AudioSource(24000, 1) + room = rtc.Room() + audio = rtc.AudioTrackToPublish(source=source) + invalid = rtc.AudioTrackToPublish( + source=SimpleNamespace(_ffi_handle=SimpleNamespace(handle=2**64 - 1)) + ) + try: + with pytest.raises(rtc.ConnectError, match="handle not found"): + await room.connect( + "wss://unused.invalid", + "unused", + rtc.RoomOptions(publish_audio_tracks=[audio, invalid]), + ) + assert audio.track is None and invalid.track is None + assert room._local_participant is None + finally: + await source.aclose() + + +@pytest.mark.parametrize("single_pc", [False, True]) +async def test_mixed_existing_and_source_publications(single_pc): + """Normalize both input kinds without mixing source indices or duplicating tracks.""" + + async def connect_and_close(): + name = "mixed-prepared-" + uuid.uuid4().hex[:12] + room = rtc.Room() + sources = [rtc.AudioSource(24000, 1) for _ in range(3)] + existing = rtc.LocalAudioTrack.create_audio_track("existing", sources[0]) + options = rtc.TrackPublishOptions(source=rtc.TrackSource.SOURCE_MICROPHONE) + descriptions = [ + rtc.AudioTrackToPublish(source=source, name=f"source-{index}", options=options) + for index, source in enumerate(sources[1:]) + ] + try: + await room.connect( + os.environ["LIVEKIT_URL"], + token(name, "agent"), + rtc.RoomOptions( + single_peer_connection=single_pc, + publish_tracks=[(existing, options)], + publish_audio_tracks=descriptions, + ), + ) + publications = room.local_participant.track_publications + assert len(publications) == 3 + by_name = {publication.name: publication for publication in publications.values()} + assert by_name["existing"].track is existing + for index, description in enumerate(descriptions): + assert description.track is not None + assert by_name[f"source-{index}"].track is description.track + refs = [weakref.ref(source) for source in sources] + refs += [weakref.ref(existing)] + refs += [weakref.ref(description.track) for description in descriptions] + refs += [weakref.ref(publication) for publication in publications.values()] + for publication in list(publications.values()): + await room.local_participant.unpublish_track(publication.sid) + assert not room.local_participant.track_publications + finally: + await room.disconnect() + await asyncio.gather(*(source.aclose() for source in sources)) + async with api.LiveKitAPI() as client: + await client.room.delete_room(api.DeleteRoomRequest(room=name)) + return refs + + for _ in range(2): + refs = await connect_and_close() + gc.collect() + assert all(reference() is None for reference in refs)