From 5c8841de1f85538f2f30f0708ad899452d09f87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Mon, 30 May 2022 22:43:40 +0200 Subject: [PATCH] cleanup --- main.cpp | 9 +- protocol | 2 +- src/createsession_observer.cpp | 8 + src/createsession_observer.h | 26 + src/peer_observer.h | 19 +- src/peer_transport.cpp | 26 + src/peer_transport.h | 27 + src/proto/livekit_models.pb.cc | 607 ++++++++++++++++++---- src/proto/livekit_models.pb.h | 490 +++++++++++++++++- src/proto/livekit_rtc.pb.cc | 913 ++++++++++++++++++++++++++++----- src/proto/livekit_rtc.pb.h | 758 ++++++++++++++++++++++++++- src/rtc_engine.cpp | 17 +- src/rtc_engine.h | 10 +- src/signal_client.cpp | 70 +-- src/signal_client.h | 26 +- 15 files changed, 2647 insertions(+), 361 deletions(-) create mode 100644 src/createsession_observer.cpp create mode 100644 src/createsession_observer.h create mode 100644 src/peer_transport.cpp create mode 100644 src/peer_transport.h diff --git a/main.cpp b/main.cpp index 8b418c1..2097e19 100644 --- a/main.cpp +++ b/main.cpp @@ -1,15 +1,16 @@ #include -#include "src/signal_client.h" +#include "src/rtc_engine.h" #include "spdlog/spdlog.h" +#include int main() { spdlog::info("Starting LiveKit..."); - livekit::SignalClient client; - client.Connect("ws://localhost:7880", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NTMzMTY2MjYsImlzcyI6IkFQSUNrSG04M01oZ2hQeCIsIm5iZiI6MTY1MDcyNDYyNiwic3ViIjoidGVzdCIsInZpZGVvIjp7InJvb20iOiJ0ZXN0cm9vbSIsInJvb21Kb2luIjp0cnVlfX0.I3Q5W4pk1kUNguGEJ4m95nE8hl8cPCliXBtF9hCt-Wg"); + livekit::RTCEngine engine; + engine.Join("ws://localhost:7880", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NTY1MTUxOTcsImlzcyI6IkFQSUNrSG04M01oZ2hQeCIsIm5iZiI6MTY1MzkyMzE5Nywic3ViIjoidGVzdGlkZW50aXR5IiwidmlkZW8iOnsicm9vbSI6InRlc3Ryb29tIiwicm9vbUpvaW4iOnRydWV9fQ.M6gIwp_GBVLkE5NwQjGUykn9GDIGIq57Php0LYAk2F8"); while(true){ - client.Update(); + engine.Update(); } return EXIT_SUCCESS; diff --git a/protocol b/protocol index 377f74b..51a8116 160000 --- a/protocol +++ b/protocol @@ -1 +1 @@ -Subproject commit 377f74b29d8d0fab17bb5778091144809f9c1123 +Subproject commit 51a8116f88b2c88ee1492c6a4d512b4611400918 diff --git a/src/createsession_observer.cpp b/src/createsession_observer.cpp new file mode 100644 index 0000000..2de88ae --- /dev/null +++ b/src/createsession_observer.cpp @@ -0,0 +1,8 @@ +// +// Created by Théo Monnom on 30/05/2022. +// + +#include "createsession_observer.h" + +namespace livekit { +} // livekit \ No newline at end of file diff --git a/src/createsession_observer.h b/src/createsession_observer.h new file mode 100644 index 0000000..5a77c97 --- /dev/null +++ b/src/createsession_observer.h @@ -0,0 +1,26 @@ +// +// Created by Théo Monnom on 30/05/2022. +// + +#ifndef LIVEKIT_NATIVE_CREATESESSION_OBSERVER_H +#define LIVEKIT_NATIVE_CREATESESSION_OBSERVER_H + +#include + +namespace livekit { + + class CreateSessionObserver : public webrtc::CreateSessionDescriptionObserver { + public: + + void OnSuccess(webrtc::SessionDescriptionInterface *desc) override { + + }; + + void OnFailure(webrtc::RTCError error) override { + + }; + }; + +} // livekit + +#endif //LIVEKIT_NATIVE_CREATESESSION_OBSERVER_H diff --git a/src/peer_observer.h b/src/peer_observer.h index a320714..332f310 100644 --- a/src/peer_observer.h +++ b/src/peer_observer.h @@ -6,44 +6,43 @@ #define LIVEKIT_NATIVE_PEER_OBSERVER_H #include +#include namespace livekit { class PeerObserver : public webrtc::PeerConnectionObserver { public: - - void OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState new_state) override { - + spdlog::info("Received OnSignalingChange"); }; void OnAddStream(rtc::scoped_refptr stream) override { - + spdlog::info("Received OnAddStream"); }; void OnRemoveStream(rtc::scoped_refptr stream) override { - + spdlog::info("Received OnRemoveStream"); }; void OnDataChannel(rtc::scoped_refptr data_channel) override { - + spdlog::info("Received OnDataChannel"); }; void OnRenegotiationNeeded() override { - + spdlog::info("Received OnRenegotiationNeeded"); }; void OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) override { - + spdlog::info("Received OnIceConnectionChange"); }; void OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState new_state) override { - + spdlog::info("Received OnIceGatheringChange"); }; void OnIceCandidate(const webrtc::IceCandidateInterface *candidate) override { - + spdlog::info("Received OnIceCandidate"); }; }; diff --git a/src/peer_transport.cpp b/src/peer_transport.cpp new file mode 100644 index 0000000..e460df0 --- /dev/null +++ b/src/peer_transport.cpp @@ -0,0 +1,26 @@ +// +// Created by Théo Monnom on 30/05/2022. +// + +#include "peer_transport.h" +#include "rtc_engine.h" + +namespace livekit { + PeerTransport::PeerTransport(const RTCEngine &rtc_engine) { + observer = std::make_unique(); + webrtc::PeerConnectionDependencies peer_configuration{observer.get()}; + + webrtc::RTCErrorOr> opt_peer = rtc_engine.peer_factory_->CreatePeerConnectionOrError( + rtc_engine.configuration_, std::move(peer_configuration)); + + if (!opt_peer.ok()) { + throw std::runtime_error{"Failed to create a peer connection"}; + } + + peer_connection = opt_peer.value(); + } + + void PeerTransport::Negotiate() { + } + +} // livekit \ No newline at end of file diff --git a/src/peer_transport.h b/src/peer_transport.h new file mode 100644 index 0000000..38c40c7 --- /dev/null +++ b/src/peer_transport.h @@ -0,0 +1,27 @@ +// +// Created by Théo Monnom on 30/05/2022. +// + +#ifndef LIVEKIT_NATIVE_PEER_TRANSPORT_H +#define LIVEKIT_NATIVE_PEER_TRANSPORT_H + +#include +#include "peer_observer.h" + +namespace livekit { + + class RTCEngine; + + class PeerTransport { + public: + explicit PeerTransport(const RTCEngine &rtc_engine); + void Negotiate(); + + private: + rtc::scoped_refptr peer_connection; + std::unique_ptr observer; + }; + +} // livekit + +#endif //LIVEKIT_NATIVE_PEER_TRANSPORT_H diff --git a/src/proto/livekit_models.pb.cc b/src/proto/livekit_models.pb.cc index 307c6db..233adf5 100644 --- a/src/proto/livekit_models.pb.cc +++ b/src/proto/livekit_models.pb.cc @@ -90,9 +90,25 @@ struct ParticipantInfoDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ParticipantInfoDefaultTypeInternal _ParticipantInfo_default_instance_; +constexpr SimulcastCodecInfo::SimulcastCodecInfo( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : layers_() + , mime_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , mid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , cid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +struct SimulcastCodecInfoDefaultTypeInternal { + constexpr SimulcastCodecInfoDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~SimulcastCodecInfoDefaultTypeInternal() {} + union { + SimulcastCodecInfo _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SimulcastCodecInfoDefaultTypeInternal _SimulcastCodecInfo_default_instance_; constexpr TrackInfo::TrackInfo( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : layers_() + , codecs_() , sid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , mime_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) @@ -309,7 +325,7 @@ struct RTPStatsDefaultTypeInternal { }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT RTPStatsDefaultTypeInternal _RTPStats_default_instance_; } // namespace livekit -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_livekit_5fmodels_2eproto[16]; +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_livekit_5fmodels_2eproto[17]; static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_livekit_5fmodels_2eproto[8]; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_livekit_5fmodels_2eproto = nullptr; @@ -367,6 +383,16 @@ const uint32_t TableStruct_livekit_5fmodels_2eproto::offsets[] PROTOBUF_SECTION_ PROTOBUF_FIELD_OFFSET(::livekit::ParticipantInfo, region_), PROTOBUF_FIELD_OFFSET(::livekit::ParticipantInfo, is_publisher_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodecInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodecInfo, mime_type_), + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodecInfo, mid_), + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodecInfo, cid_), + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodecInfo, layers_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::livekit::TrackInfo, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -384,6 +410,7 @@ const uint32_t TableStruct_livekit_5fmodels_2eproto::offsets[] PROTOBUF_SECTION_ PROTOBUF_FIELD_OFFSET(::livekit::TrackInfo, layers_), PROTOBUF_FIELD_OFFSET(::livekit::TrackInfo, mime_type_), PROTOBUF_FIELD_OFFSET(::livekit::TrackInfo, mid_), + PROTOBUF_FIELD_OFFSET(::livekit::TrackInfo, codecs_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::livekit::VideoLayer, _internal_metadata_), ~0u, // no _extensions_ @@ -529,18 +556,19 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB { 16, -1, -1, sizeof(::livekit::Codec)}, { 24, -1, -1, sizeof(::livekit::ParticipantPermission)}, { 35, -1, -1, sizeof(::livekit::ParticipantInfo)}, - { 52, -1, -1, sizeof(::livekit::TrackInfo)}, - { 70, -1, -1, sizeof(::livekit::VideoLayer)}, - { 81, -1, -1, sizeof(::livekit::DataPacket)}, - { 91, -1, -1, sizeof(::livekit::ActiveSpeakerUpdate)}, - { 98, -1, -1, sizeof(::livekit::SpeakerInfo)}, - { 107, -1, -1, sizeof(::livekit::UserPacket)}, - { 116, -1, -1, sizeof(::livekit::ParticipantTracks)}, - { 124, -1, -1, sizeof(::livekit::ClientInfo)}, - { 139, -1, -1, sizeof(::livekit::ClientConfiguration)}, - { 148, -1, -1, sizeof(::livekit::VideoConfiguration)}, - { 155, 163, -1, sizeof(::livekit::RTPStats_GapHistogramEntry_DoNotUse)}, - { 165, -1, -1, sizeof(::livekit::RTPStats)}, + { 52, -1, -1, sizeof(::livekit::SimulcastCodecInfo)}, + { 62, -1, -1, sizeof(::livekit::TrackInfo)}, + { 81, -1, -1, sizeof(::livekit::VideoLayer)}, + { 92, -1, -1, sizeof(::livekit::DataPacket)}, + { 102, -1, -1, sizeof(::livekit::ActiveSpeakerUpdate)}, + { 109, -1, -1, sizeof(::livekit::SpeakerInfo)}, + { 118, -1, -1, sizeof(::livekit::UserPacket)}, + { 127, -1, -1, sizeof(::livekit::ParticipantTracks)}, + { 135, -1, -1, sizeof(::livekit::ClientInfo)}, + { 150, -1, -1, sizeof(::livekit::ClientConfiguration)}, + { 159, -1, -1, sizeof(::livekit::VideoConfiguration)}, + { 166, 174, -1, sizeof(::livekit::RTPStats_GapHistogramEntry_DoNotUse)}, + { 176, -1, -1, sizeof(::livekit::RTPStats)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -548,6 +576,7 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&::livekit::_Codec_default_instance_), reinterpret_cast(&::livekit::_ParticipantPermission_default_instance_), reinterpret_cast(&::livekit::_ParticipantInfo_default_instance_), + reinterpret_cast(&::livekit::_SimulcastCodecInfo_default_instance_), reinterpret_cast(&::livekit::_TrackInfo_default_instance_), reinterpret_cast(&::livekit::_VideoLayer_default_instance_), reinterpret_cast(&::livekit::_DataPacket_default_instance_), @@ -583,87 +612,91 @@ const char descriptor_table_protodef_livekit_5fmodels_2eproto[] PROTOBUF_SECTION "\n\npermission\030\013 \001(\0132\036.livekit.Participant" "Permission\022\016\n\006region\030\014 \001(\t\022\024\n\014is_publish" "er\030\r \001(\010\">\n\005State\022\013\n\007JOINING\020\000\022\n\n\006JOINED" - "\020\001\022\n\n\006ACTIVE\020\002\022\020\n\014DISCONNECTED\020\003\"\211\002\n\tTra" - "ckInfo\022\013\n\003sid\030\001 \001(\t\022 \n\004type\030\002 \001(\0162\022.live" - "kit.TrackType\022\014\n\004name\030\003 \001(\t\022\r\n\005muted\030\004 \001" - "(\010\022\r\n\005width\030\005 \001(\r\022\016\n\006height\030\006 \001(\r\022\021\n\tsim" - "ulcast\030\007 \001(\010\022\023\n\013disable_dtx\030\010 \001(\010\022$\n\006sou" - "rce\030\t \001(\0162\024.livekit.TrackSource\022#\n\006layer" - "s\030\n \003(\0132\023.livekit.VideoLayer\022\021\n\tmime_typ" - "e\030\013 \001(\t\022\013\n\003mid\030\014 \001(\t\"r\n\nVideoLayer\022&\n\007qu" - "ality\030\001 \001(\0162\025.livekit.VideoQuality\022\r\n\005wi" - "dth\030\002 \001(\r\022\016\n\006height\030\003 \001(\r\022\017\n\007bitrate\030\004 \001" - "(\r\022\014\n\004ssrc\030\005 \001(\r\"\264\001\n\nDataPacket\022&\n\004kind\030" - "\001 \001(\0162\030.livekit.DataPacket.Kind\022#\n\004user\030" - "\002 \001(\0132\023.livekit.UserPacketH\000\022/\n\007speaker\030" - "\003 \001(\0132\034.livekit.ActiveSpeakerUpdateH\000\"\037\n" - "\004Kind\022\014\n\010RELIABLE\020\000\022\t\n\005LOSSY\020\001B\007\n\005value\"" - "=\n\023ActiveSpeakerUpdate\022&\n\010speakers\030\001 \003(\013" - "2\024.livekit.SpeakerInfo\"9\n\013SpeakerInfo\022\013\n" - "\003sid\030\001 \001(\t\022\r\n\005level\030\002 \001(\002\022\016\n\006active\030\003 \001(" - "\010\"P\n\nUserPacket\022\027\n\017participant_sid\030\001 \001(\t" - "\022\017\n\007payload\030\002 \001(\014\022\030\n\020destination_sids\030\003 " - "\003(\t\"@\n\021ParticipantTracks\022\027\n\017participant_" - "sid\030\001 \001(\t\022\022\n\ntrack_sids\030\002 \003(\t\"\232\002\n\nClient" - "Info\022$\n\003sdk\030\001 \001(\0162\027.livekit.ClientInfo.S" - "DK\022\017\n\007version\030\002 \001(\t\022\020\n\010protocol\030\003 \001(\005\022\n\n" - "\002os\030\004 \001(\t\022\022\n\nos_version\030\005 \001(\t\022\024\n\014device_" - "model\030\006 \001(\t\022\017\n\007browser\030\007 \001(\t\022\027\n\017browser_" - "version\030\010 \001(\t\022\017\n\007address\030\t \001(\t\"R\n\003SDK\022\013\n" - "\007UNKNOWN\020\000\022\006\n\002JS\020\001\022\t\n\005SWIFT\020\002\022\013\n\007ANDROID" - "\020\003\022\013\n\007FLUTTER\020\004\022\006\n\002GO\020\005\022\t\n\005UNITY\020\006\"\247\001\n\023C" - "lientConfiguration\022*\n\005video\030\001 \001(\0132\033.live" - "kit.VideoConfiguration\022+\n\006screen\030\002 \001(\0132\033" - ".livekit.VideoConfiguration\0227\n\021resume_co" - "nnection\030\003 \001(\0162\034.livekit.ClientConfigSet" - "ting\"L\n\022VideoConfiguration\0226\n\020hardware_e" - "ncoder\030\001 \001(\0162\034.livekit.ClientConfigSetti" - "ng\"\311\010\n\010RTPStats\022.\n\nstart_time\030\001 \001(\0132\032.go" - "ogle.protobuf.Timestamp\022,\n\010end_time\030\002 \001(" - "\0132\032.google.protobuf.Timestamp\022\020\n\010duratio" - "n\030\003 \001(\001\022\017\n\007packets\030\004 \001(\r\022\023\n\013packet_rate\030" - "\005 \001(\001\022\r\n\005bytes\030\006 \001(\004\022\017\n\007bitrate\030\007 \001(\001\022\024\n" - "\014packets_lost\030\010 \001(\r\022\030\n\020packet_loss_rate\030" - "\t \001(\001\022\036\n\026packet_loss_percentage\030\n \001(\002\022\031\n" - "\021packets_duplicate\030\013 \001(\r\022\035\n\025packet_dupli" - "cate_rate\030\014 \001(\001\022\027\n\017bytes_duplicate\030\r \001(\004" - "\022\031\n\021bitrate_duplicate\030\016 \001(\001\022\027\n\017packets_p" - "adding\030\017 \001(\r\022\033\n\023packet_padding_rate\030\020 \001(" - "\001\022\025\n\rbytes_padding\030\021 \001(\004\022\027\n\017bitrate_padd" - "ing\030\022 \001(\001\022\034\n\024packets_out_of_order\030\023 \001(\r\022" - "\016\n\006frames\030\024 \001(\r\022\022\n\nframe_rate\030\025 \001(\001\022\026\n\016j" - "itter_current\030\026 \001(\001\022\022\n\njitter_max\030\027 \001(\001\022" - ":\n\rgap_histogram\030\030 \003(\0132#.livekit.RTPStat" - "s.GapHistogramEntry\022\r\n\005nacks\030\031 \001(\r\022\021\n\tna" - "ck_acks\030% \001(\r\022\023\n\013nack_misses\030\032 \001(\r\022\025\n\rna" - "ck_repeated\030& \001(\r\022\014\n\004plis\030\033 \001(\r\022,\n\010last_" - "pli\030\034 \001(\0132\032.google.protobuf.Timestamp\022\014\n" - "\004firs\030\035 \001(\r\022,\n\010last_fir\030\036 \001(\0132\032.google.p" - "rotobuf.Timestamp\022\023\n\013rtt_current\030\037 \001(\r\022\017" - "\n\007rtt_max\030 \001(\r\022\022\n\nkey_frames\030! \001(\r\0222\n\016l" - "ast_key_frame\030\" \001(\0132\032.google.protobuf.Ti" - "mestamp\022\027\n\017layer_lock_plis\030# \001(\r\0227\n\023last" - "_layer_lock_pli\030$ \001(\0132\032.google.protobuf." - "Timestamp\0323\n\021GapHistogramEntry\022\013\n\003key\030\001 " - "\001(\005\022\r\n\005value\030\002 \001(\r:\0028\001*+\n\tTrackType\022\t\n\005A" - "UDIO\020\000\022\t\n\005VIDEO\020\001\022\010\n\004DATA\020\002*`\n\013TrackSour" - "ce\022\013\n\007UNKNOWN\020\000\022\n\n\006CAMERA\020\001\022\016\n\nMICROPHON" - "E\020\002\022\020\n\014SCREEN_SHARE\020\003\022\026\n\022SCREEN_SHARE_AU" - "DIO\020\004*6\n\014VideoQuality\022\007\n\003LOW\020\000\022\n\n\006MEDIUM" - "\020\001\022\010\n\004HIGH\020\002\022\007\n\003OFF\020\003*6\n\021ConnectionQuali" - "ty\022\010\n\004POOR\020\000\022\010\n\004GOOD\020\001\022\r\n\tEXCELLENT\020\002*;\n" - "\023ClientConfigSetting\022\t\n\005UNSET\020\000\022\014\n\010DISAB" - "LED\020\001\022\013\n\007ENABLED\020\002BFZ#github.com/livekit" - "/protocol/livekit\252\002\rLiveKit.Proto\352\002\016Live" - "Kit::Protob\006proto3" + "\020\001\022\n\n\006ACTIVE\020\002\022\020\n\014DISCONNECTED\020\003\"f\n\022Simu" + "lcastCodecInfo\022\021\n\tmime_type\030\001 \001(\t\022\013\n\003mid" + "\030\002 \001(\t\022\013\n\003cid\030\003 \001(\t\022#\n\006layers\030\004 \003(\0132\023.li" + "vekit.VideoLayer\"\266\002\n\tTrackInfo\022\013\n\003sid\030\001 " + "\001(\t\022 \n\004type\030\002 \001(\0162\022.livekit.TrackType\022\014\n" + "\004name\030\003 \001(\t\022\r\n\005muted\030\004 \001(\010\022\r\n\005width\030\005 \001(" + "\r\022\016\n\006height\030\006 \001(\r\022\021\n\tsimulcast\030\007 \001(\010\022\023\n\013" + "disable_dtx\030\010 \001(\010\022$\n\006source\030\t \001(\0162\024.live" + "kit.TrackSource\022#\n\006layers\030\n \003(\0132\023.liveki" + "t.VideoLayer\022\021\n\tmime_type\030\013 \001(\t\022\013\n\003mid\030\014" + " \001(\t\022+\n\006codecs\030\r \003(\0132\033.livekit.Simulcast" + "CodecInfo\"r\n\nVideoLayer\022&\n\007quality\030\001 \001(\016" + "2\025.livekit.VideoQuality\022\r\n\005width\030\002 \001(\r\022\016" + "\n\006height\030\003 \001(\r\022\017\n\007bitrate\030\004 \001(\r\022\014\n\004ssrc\030" + "\005 \001(\r\"\264\001\n\nDataPacket\022&\n\004kind\030\001 \001(\0162\030.liv" + "ekit.DataPacket.Kind\022#\n\004user\030\002 \001(\0132\023.liv" + "ekit.UserPacketH\000\022/\n\007speaker\030\003 \001(\0132\034.liv" + "ekit.ActiveSpeakerUpdateH\000\"\037\n\004Kind\022\014\n\010RE" + "LIABLE\020\000\022\t\n\005LOSSY\020\001B\007\n\005value\"=\n\023ActiveSp" + "eakerUpdate\022&\n\010speakers\030\001 \003(\0132\024.livekit." + "SpeakerInfo\"9\n\013SpeakerInfo\022\013\n\003sid\030\001 \001(\t\022" + "\r\n\005level\030\002 \001(\002\022\016\n\006active\030\003 \001(\010\"P\n\nUserPa" + "cket\022\027\n\017participant_sid\030\001 \001(\t\022\017\n\007payload" + "\030\002 \001(\014\022\030\n\020destination_sids\030\003 \003(\t\"@\n\021Part" + "icipantTracks\022\027\n\017participant_sid\030\001 \001(\t\022\022" + "\n\ntrack_sids\030\002 \003(\t\"\232\002\n\nClientInfo\022$\n\003sdk" + "\030\001 \001(\0162\027.livekit.ClientInfo.SDK\022\017\n\007versi" + "on\030\002 \001(\t\022\020\n\010protocol\030\003 \001(\005\022\n\n\002os\030\004 \001(\t\022\022" + "\n\nos_version\030\005 \001(\t\022\024\n\014device_model\030\006 \001(\t" + "\022\017\n\007browser\030\007 \001(\t\022\027\n\017browser_version\030\010 \001" + "(\t\022\017\n\007address\030\t \001(\t\"R\n\003SDK\022\013\n\007UNKNOWN\020\000\022" + "\006\n\002JS\020\001\022\t\n\005SWIFT\020\002\022\013\n\007ANDROID\020\003\022\013\n\007FLUTT" + "ER\020\004\022\006\n\002GO\020\005\022\t\n\005UNITY\020\006\"\247\001\n\023ClientConfig" + "uration\022*\n\005video\030\001 \001(\0132\033.livekit.VideoCo" + "nfiguration\022+\n\006screen\030\002 \001(\0132\033.livekit.Vi" + "deoConfiguration\0227\n\021resume_connection\030\003 " + "\001(\0162\034.livekit.ClientConfigSetting\"L\n\022Vid" + "eoConfiguration\0226\n\020hardware_encoder\030\001 \001(" + "\0162\034.livekit.ClientConfigSetting\"\311\010\n\010RTPS" + "tats\022.\n\nstart_time\030\001 \001(\0132\032.google.protob" + "uf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032.google." + "protobuf.Timestamp\022\020\n\010duration\030\003 \001(\001\022\017\n\007" + "packets\030\004 \001(\r\022\023\n\013packet_rate\030\005 \001(\001\022\r\n\005by" + "tes\030\006 \001(\004\022\017\n\007bitrate\030\007 \001(\001\022\024\n\014packets_lo" + "st\030\010 \001(\r\022\030\n\020packet_loss_rate\030\t \001(\001\022\036\n\026pa" + "cket_loss_percentage\030\n \001(\002\022\031\n\021packets_du" + "plicate\030\013 \001(\r\022\035\n\025packet_duplicate_rate\030\014" + " \001(\001\022\027\n\017bytes_duplicate\030\r \001(\004\022\031\n\021bitrate" + "_duplicate\030\016 \001(\001\022\027\n\017packets_padding\030\017 \001(" + "\r\022\033\n\023packet_padding_rate\030\020 \001(\001\022\025\n\rbytes_" + "padding\030\021 \001(\004\022\027\n\017bitrate_padding\030\022 \001(\001\022\034" + "\n\024packets_out_of_order\030\023 \001(\r\022\016\n\006frames\030\024" + " \001(\r\022\022\n\nframe_rate\030\025 \001(\001\022\026\n\016jitter_curre" + "nt\030\026 \001(\001\022\022\n\njitter_max\030\027 \001(\001\022:\n\rgap_hist" + "ogram\030\030 \003(\0132#.livekit.RTPStats.GapHistog" + "ramEntry\022\r\n\005nacks\030\031 \001(\r\022\021\n\tnack_acks\030% \001" + "(\r\022\023\n\013nack_misses\030\032 \001(\r\022\025\n\rnack_repeated" + "\030& \001(\r\022\014\n\004plis\030\033 \001(\r\022,\n\010last_pli\030\034 \001(\0132\032" + ".google.protobuf.Timestamp\022\014\n\004firs\030\035 \001(\r" + "\022,\n\010last_fir\030\036 \001(\0132\032.google.protobuf.Tim" + "estamp\022\023\n\013rtt_current\030\037 \001(\r\022\017\n\007rtt_max\030 " + " \001(\r\022\022\n\nkey_frames\030! \001(\r\0222\n\016last_key_fra" + "me\030\" \001(\0132\032.google.protobuf.Timestamp\022\027\n\017" + "layer_lock_plis\030# \001(\r\0227\n\023last_layer_lock" + "_pli\030$ \001(\0132\032.google.protobuf.Timestamp\0323" + "\n\021GapHistogramEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005valu" + "e\030\002 \001(\r:\0028\001*+\n\tTrackType\022\t\n\005AUDIO\020\000\022\t\n\005V" + "IDEO\020\001\022\010\n\004DATA\020\002*`\n\013TrackSource\022\013\n\007UNKNO" + "WN\020\000\022\n\n\006CAMERA\020\001\022\016\n\nMICROPHONE\020\002\022\020\n\014SCRE" + "EN_SHARE\020\003\022\026\n\022SCREEN_SHARE_AUDIO\020\004*6\n\014Vi" + "deoQuality\022\007\n\003LOW\020\000\022\n\n\006MEDIUM\020\001\022\010\n\004HIGH\020" + "\002\022\007\n\003OFF\020\003*6\n\021ConnectionQuality\022\010\n\004POOR\020" + "\000\022\010\n\004GOOD\020\001\022\r\n\tEXCELLENT\020\002*;\n\023ClientConf" + "igSetting\022\t\n\005UNSET\020\000\022\014\n\010DISABLED\020\001\022\013\n\007EN" + "ABLED\020\002BFZ#github.com/livekit/protocol/l" + "ivekit\252\002\rLiveKit.Proto\352\002\016LiveKit::Protob" + "\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_livekit_5fmodels_2eproto_deps[1] = { &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_livekit_5fmodels_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_livekit_5fmodels_2eproto = { - false, false, 3698, descriptor_table_protodef_livekit_5fmodels_2eproto, "livekit_models.proto", - &descriptor_table_livekit_5fmodels_2eproto_once, descriptor_table_livekit_5fmodels_2eproto_deps, 1, 16, + false, false, 3847, descriptor_table_protodef_livekit_5fmodels_2eproto, "livekit_models.proto", + &descriptor_table_livekit_5fmodels_2eproto_once, descriptor_table_livekit_5fmodels_2eproto_deps, 1, 17, schemas, file_default_instances, TableStruct_livekit_5fmodels_2eproto::offsets, file_level_metadata_livekit_5fmodels_2eproto, file_level_enum_descriptors_livekit_5fmodels_2eproto, file_level_service_descriptors_livekit_5fmodels_2eproto, }; @@ -2451,6 +2484,340 @@ void ParticipantInfo::InternalSwap(ParticipantInfo* other) { // =================================================================== +class SimulcastCodecInfo::_Internal { + public: +}; + +SimulcastCodecInfo::SimulcastCodecInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), + layers_(arena) { + SharedCtor(); + if (!is_message_owned) { + RegisterArenaDtor(arena); + } + // @@protoc_insertion_point(arena_constructor:livekit.SimulcastCodecInfo) +} +SimulcastCodecInfo::SimulcastCodecInfo(const SimulcastCodecInfo& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + layers_(from.layers_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + mime_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + mime_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_mime_type().empty()) { + mime_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_mime_type(), + GetArenaForAllocation()); + } + mid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + mid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_mid().empty()) { + mid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_mid(), + GetArenaForAllocation()); + } + cid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + cid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_cid().empty()) { + cid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_cid(), + GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:livekit.SimulcastCodecInfo) +} + +inline void SimulcastCodecInfo::SharedCtor() { +mime_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + mime_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +mid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + mid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +cid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + cid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +SimulcastCodecInfo::~SimulcastCodecInfo() { + // @@protoc_insertion_point(destructor:livekit.SimulcastCodecInfo) + if (GetArenaForAllocation() != nullptr) return; + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +inline void SimulcastCodecInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + mime_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + mid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + cid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void SimulcastCodecInfo::ArenaDtor(void* object) { + SimulcastCodecInfo* _this = reinterpret_cast< SimulcastCodecInfo* >(object); + (void)_this; +} +void SimulcastCodecInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SimulcastCodecInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void SimulcastCodecInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:livekit.SimulcastCodecInfo) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + layers_.Clear(); + mime_type_.ClearToEmpty(); + mid_.ClearToEmpty(); + cid_.ClearToEmpty(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SimulcastCodecInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string mime_type = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_mime_type(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "livekit.SimulcastCodecInfo.mime_type")); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string mid = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_mid(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "livekit.SimulcastCodecInfo.mid")); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string cid = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_cid(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "livekit.SimulcastCodecInfo.cid")); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .livekit.VideoLayer layers = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_layers(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* SimulcastCodecInfo::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:livekit.SimulcastCodecInfo) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string mime_type = 1; + if (!this->_internal_mime_type().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_mime_type().data(), static_cast(this->_internal_mime_type().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "livekit.SimulcastCodecInfo.mime_type"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_mime_type(), target); + } + + // string mid = 2; + if (!this->_internal_mid().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_mid().data(), static_cast(this->_internal_mid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "livekit.SimulcastCodecInfo.mid"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_mid(), target); + } + + // string cid = 3; + if (!this->_internal_cid().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_cid().data(), static_cast(this->_internal_cid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "livekit.SimulcastCodecInfo.cid"); + target = stream->WriteStringMaybeAliased( + 3, this->_internal_cid(), target); + } + + // repeated .livekit.VideoLayer layers = 4; + for (unsigned int i = 0, + n = static_cast(this->_internal_layers_size()); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, this->_internal_layers(i), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:livekit.SimulcastCodecInfo) + return target; +} + +size_t SimulcastCodecInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:livekit.SimulcastCodecInfo) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .livekit.VideoLayer layers = 4; + total_size += 1UL * this->_internal_layers_size(); + for (const auto& msg : this->layers_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // string mime_type = 1; + if (!this->_internal_mime_type().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_mime_type()); + } + + // string mid = 2; + if (!this->_internal_mid().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_mid()); + } + + // string cid = 3; + if (!this->_internal_cid().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_cid()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SimulcastCodecInfo::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + SimulcastCodecInfo::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SimulcastCodecInfo::GetClassData() const { return &_class_data_; } + +void SimulcastCodecInfo::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void SimulcastCodecInfo::MergeFrom(const SimulcastCodecInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:livekit.SimulcastCodecInfo) + GOOGLE_DCHECK_NE(&from, this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + layers_.MergeFrom(from.layers_); + if (!from._internal_mime_type().empty()) { + _internal_set_mime_type(from._internal_mime_type()); + } + if (!from._internal_mid().empty()) { + _internal_set_mid(from._internal_mid()); + } + if (!from._internal_cid().empty()) { + _internal_set_cid(from._internal_cid()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void SimulcastCodecInfo::CopyFrom(const SimulcastCodecInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:livekit.SimulcastCodecInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SimulcastCodecInfo::IsInitialized() const { + return true; +} + +void SimulcastCodecInfo::InternalSwap(SimulcastCodecInfo* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + layers_.InternalSwap(&other->layers_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + &mime_type_, lhs_arena, + &other->mime_type_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + &mid_, lhs_arena, + &other->mid_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + &cid_, lhs_arena, + &other->cid_, rhs_arena + ); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SimulcastCodecInfo::GetMetadata() const { + return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, + file_level_metadata_livekit_5fmodels_2eproto[4]); +} + +// =================================================================== + class TrackInfo::_Internal { public: }; @@ -2458,7 +2825,8 @@ class TrackInfo::_Internal { TrackInfo::TrackInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - layers_(arena) { + layers_(arena), + codecs_(arena) { SharedCtor(); if (!is_message_owned) { RegisterArenaDtor(arena); @@ -2467,7 +2835,8 @@ TrackInfo::TrackInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, } TrackInfo::TrackInfo(const TrackInfo& from) : ::PROTOBUF_NAMESPACE_ID::Message(), - layers_(from.layers_) { + layers_(from.layers_), + codecs_(from.codecs_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); sid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -2562,6 +2931,7 @@ void TrackInfo::Clear() { (void) cached_has_bits; layers_.Clear(); + codecs_.Clear(); sid_.ClearToEmpty(); name_.ClearToEmpty(); mime_type_.ClearToEmpty(); @@ -2689,6 +3059,19 @@ const char* TrackInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: } else goto handle_unusual; continue; + // repeated .livekit.SimulcastCodecInfo codecs = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 106)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_codecs(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<106>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -2810,6 +3193,14 @@ uint8_t* TrackInfo::_InternalSerialize( 12, this->_internal_mid(), target); } + // repeated .livekit.SimulcastCodecInfo codecs = 13; + for (unsigned int i = 0, + n = static_cast(this->_internal_codecs_size()); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(13, this->_internal_codecs(i), target, stream); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -2833,6 +3224,13 @@ size_t TrackInfo::ByteSizeLong() const { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } + // repeated .livekit.SimulcastCodecInfo codecs = 13; + total_size += 1UL * this->_internal_codecs_size(); + for (const auto& msg : this->codecs_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + // string sid = 1; if (!this->_internal_sid().empty()) { total_size += 1 + @@ -2921,6 +3319,7 @@ void TrackInfo::MergeFrom(const TrackInfo& from) { (void) cached_has_bits; layers_.MergeFrom(from.layers_); + codecs_.MergeFrom(from.codecs_); if (!from._internal_sid().empty()) { _internal_set_sid(from._internal_sid()); } @@ -2974,6 +3373,7 @@ void TrackInfo::InternalSwap(TrackInfo* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); layers_.InternalSwap(&other->layers_); + codecs_.InternalSwap(&other->codecs_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &sid_, lhs_arena, @@ -3005,7 +3405,7 @@ void TrackInfo::InternalSwap(TrackInfo* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TrackInfo::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[4]); + file_level_metadata_livekit_5fmodels_2eproto[5]); } // =================================================================== @@ -3286,7 +3686,7 @@ void VideoLayer::InternalSwap(VideoLayer* other) { ::PROTOBUF_NAMESPACE_ID::Metadata VideoLayer::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[5]); + file_level_metadata_livekit_5fmodels_2eproto[6]); } // =================================================================== @@ -3615,7 +4015,7 @@ void DataPacket::InternalSwap(DataPacket* other) { ::PROTOBUF_NAMESPACE_ID::Metadata DataPacket::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[6]); + file_level_metadata_livekit_5fmodels_2eproto[7]); } // =================================================================== @@ -3800,7 +4200,7 @@ void ActiveSpeakerUpdate::InternalSwap(ActiveSpeakerUpdate* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ActiveSpeakerUpdate::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[7]); + file_level_metadata_livekit_5fmodels_2eproto[8]); } // =================================================================== @@ -4075,7 +4475,7 @@ void SpeakerInfo::InternalSwap(SpeakerInfo* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SpeakerInfo::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[8]); + file_level_metadata_livekit_5fmodels_2eproto[9]); } // =================================================================== @@ -4360,7 +4760,7 @@ void UserPacket::InternalSwap(UserPacket* other) { ::PROTOBUF_NAMESPACE_ID::Metadata UserPacket::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[9]); + file_level_metadata_livekit_5fmodels_2eproto[10]); } // =================================================================== @@ -4601,7 +5001,7 @@ void ParticipantTracks::InternalSwap(ParticipantTracks* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ParticipantTracks::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[10]); + file_level_metadata_livekit_5fmodels_2eproto[11]); } // =================================================================== @@ -5161,7 +5561,7 @@ void ClientInfo::InternalSwap(ClientInfo* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ClientInfo::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[11]); + file_level_metadata_livekit_5fmodels_2eproto[12]); } // =================================================================== @@ -5432,7 +5832,7 @@ void ClientConfiguration::InternalSwap(ClientConfiguration* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ClientConfiguration::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[12]); + file_level_metadata_livekit_5fmodels_2eproto[13]); } // =================================================================== @@ -5613,7 +6013,7 @@ void VideoConfiguration::InternalSwap(VideoConfiguration* other) { ::PROTOBUF_NAMESPACE_ID::Metadata VideoConfiguration::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[13]); + file_level_metadata_livekit_5fmodels_2eproto[14]); } // =================================================================== @@ -5627,7 +6027,7 @@ void RTPStats_GapHistogramEntry_DoNotUse::MergeFrom(const RTPStats_GapHistogramE ::PROTOBUF_NAMESPACE_ID::Metadata RTPStats_GapHistogramEntry_DoNotUse::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[14]); + file_level_metadata_livekit_5fmodels_2eproto[15]); } // =================================================================== @@ -6991,7 +7391,7 @@ void RTPStats::InternalSwap(RTPStats* other) { ::PROTOBUF_NAMESPACE_ID::Metadata RTPStats::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5fmodels_2eproto_getter, &descriptor_table_livekit_5fmodels_2eproto_once, - file_level_metadata_livekit_5fmodels_2eproto[15]); + file_level_metadata_livekit_5fmodels_2eproto[16]); } // @@protoc_insertion_point(namespace_scope) @@ -7009,6 +7409,9 @@ template<> PROTOBUF_NOINLINE ::livekit::ParticipantPermission* Arena::CreateMayb template<> PROTOBUF_NOINLINE ::livekit::ParticipantInfo* Arena::CreateMaybeMessage< ::livekit::ParticipantInfo >(Arena* arena) { return Arena::CreateMessageInternal< ::livekit::ParticipantInfo >(arena); } +template<> PROTOBUF_NOINLINE ::livekit::SimulcastCodecInfo* Arena::CreateMaybeMessage< ::livekit::SimulcastCodecInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::livekit::SimulcastCodecInfo >(arena); +} template<> PROTOBUF_NOINLINE ::livekit::TrackInfo* Arena::CreateMaybeMessage< ::livekit::TrackInfo >(Arena* arena) { return Arena::CreateMessageInternal< ::livekit::TrackInfo >(arena); } diff --git a/src/proto/livekit_models.pb.h b/src/proto/livekit_models.pb.h index e48b778..36d4832 100644 --- a/src/proto/livekit_models.pb.h +++ b/src/proto/livekit_models.pb.h @@ -51,7 +51,7 @@ struct TableStruct_livekit_5fmodels_2eproto { PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[16] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[17] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; @@ -92,6 +92,9 @@ extern RTPStats_GapHistogramEntry_DoNotUseDefaultTypeInternal _RTPStats_GapHisto class Room; struct RoomDefaultTypeInternal; extern RoomDefaultTypeInternal _Room_default_instance_; +class SimulcastCodecInfo; +struct SimulcastCodecInfoDefaultTypeInternal; +extern SimulcastCodecInfoDefaultTypeInternal _SimulcastCodecInfo_default_instance_; class SpeakerInfo; struct SpeakerInfoDefaultTypeInternal; extern SpeakerInfoDefaultTypeInternal _SpeakerInfo_default_instance_; @@ -120,6 +123,7 @@ template<> ::livekit::ParticipantTracks* Arena::CreateMaybeMessage<::livekit::Pa template<> ::livekit::RTPStats* Arena::CreateMaybeMessage<::livekit::RTPStats>(Arena*); template<> ::livekit::RTPStats_GapHistogramEntry_DoNotUse* Arena::CreateMaybeMessage<::livekit::RTPStats_GapHistogramEntry_DoNotUse>(Arena*); template<> ::livekit::Room* Arena::CreateMaybeMessage<::livekit::Room>(Arena*); +template<> ::livekit::SimulcastCodecInfo* Arena::CreateMaybeMessage<::livekit::SimulcastCodecInfo>(Arena*); template<> ::livekit::SpeakerInfo* Arena::CreateMaybeMessage<::livekit::SpeakerInfo>(Arena*); template<> ::livekit::TrackInfo* Arena::CreateMaybeMessage<::livekit::TrackInfo>(Arena*); template<> ::livekit::UserPacket* Arena::CreateMaybeMessage<::livekit::UserPacket>(Arena*); @@ -1309,6 +1313,209 @@ class ParticipantInfo final : }; // ------------------------------------------------------------------- +class SimulcastCodecInfo final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:livekit.SimulcastCodecInfo) */ { + public: + inline SimulcastCodecInfo() : SimulcastCodecInfo(nullptr) {} + ~SimulcastCodecInfo() override; + explicit constexpr SimulcastCodecInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + SimulcastCodecInfo(const SimulcastCodecInfo& from); + SimulcastCodecInfo(SimulcastCodecInfo&& from) noexcept + : SimulcastCodecInfo() { + *this = ::std::move(from); + } + + inline SimulcastCodecInfo& operator=(const SimulcastCodecInfo& from) { + CopyFrom(from); + return *this; + } + inline SimulcastCodecInfo& operator=(SimulcastCodecInfo&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SimulcastCodecInfo& default_instance() { + return *internal_default_instance(); + } + static inline const SimulcastCodecInfo* internal_default_instance() { + return reinterpret_cast( + &_SimulcastCodecInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(SimulcastCodecInfo& a, SimulcastCodecInfo& b) { + a.Swap(&b); + } + inline void Swap(SimulcastCodecInfo* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SimulcastCodecInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SimulcastCodecInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const SimulcastCodecInfo& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const SimulcastCodecInfo& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SimulcastCodecInfo* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "livekit.SimulcastCodecInfo"; + } + protected: + explicit SimulcastCodecInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kLayersFieldNumber = 4, + kMimeTypeFieldNumber = 1, + kMidFieldNumber = 2, + kCidFieldNumber = 3, + }; + // repeated .livekit.VideoLayer layers = 4; + int layers_size() const; + private: + int _internal_layers_size() const; + public: + void clear_layers(); + ::livekit::VideoLayer* mutable_layers(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer >* + mutable_layers(); + private: + const ::livekit::VideoLayer& _internal_layers(int index) const; + ::livekit::VideoLayer* _internal_add_layers(); + public: + const ::livekit::VideoLayer& layers(int index) const; + ::livekit::VideoLayer* add_layers(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer >& + layers() const; + + // string mime_type = 1; + void clear_mime_type(); + const std::string& mime_type() const; + template + void set_mime_type(ArgT0&& arg0, ArgT... args); + std::string* mutable_mime_type(); + PROTOBUF_NODISCARD std::string* release_mime_type(); + void set_allocated_mime_type(std::string* mime_type); + private: + const std::string& _internal_mime_type() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_mime_type(const std::string& value); + std::string* _internal_mutable_mime_type(); + public: + + // string mid = 2; + void clear_mid(); + const std::string& mid() const; + template + void set_mid(ArgT0&& arg0, ArgT... args); + std::string* mutable_mid(); + PROTOBUF_NODISCARD std::string* release_mid(); + void set_allocated_mid(std::string* mid); + private: + const std::string& _internal_mid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_mid(const std::string& value); + std::string* _internal_mutable_mid(); + public: + + // string cid = 3; + void clear_cid(); + const std::string& cid() const; + template + void set_cid(ArgT0&& arg0, ArgT... args); + std::string* mutable_cid(); + PROTOBUF_NODISCARD std::string* release_cid(); + void set_allocated_cid(std::string* cid); + private: + const std::string& _internal_cid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_cid(const std::string& value); + std::string* _internal_mutable_cid(); + public: + + // @@protoc_insertion_point(class_scope:livekit.SimulcastCodecInfo) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer > layers_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr mime_type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr mid_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr cid_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_livekit_5fmodels_2eproto; +}; +// ------------------------------------------------------------------- + class TrackInfo final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:livekit.TrackInfo) */ { public: @@ -1357,7 +1564,7 @@ class TrackInfo final : &_TrackInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 5; friend void swap(TrackInfo& a, TrackInfo& b) { a.Swap(&b); @@ -1432,6 +1639,7 @@ class TrackInfo final : enum : int { kLayersFieldNumber = 10, + kCodecsFieldNumber = 13, kSidFieldNumber = 1, kNameFieldNumber = 3, kMimeTypeFieldNumber = 11, @@ -1462,6 +1670,24 @@ class TrackInfo final : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer >& layers() const; + // repeated .livekit.SimulcastCodecInfo codecs = 13; + int codecs_size() const; + private: + int _internal_codecs_size() const; + public: + void clear_codecs(); + ::livekit::SimulcastCodecInfo* mutable_codecs(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodecInfo >* + mutable_codecs(); + private: + const ::livekit::SimulcastCodecInfo& _internal_codecs(int index) const; + ::livekit::SimulcastCodecInfo* _internal_add_codecs(); + public: + const ::livekit::SimulcastCodecInfo& codecs(int index) const; + ::livekit::SimulcastCodecInfo* add_codecs(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodecInfo >& + codecs() const; + // string sid = 1; void clear_sid(); const std::string& sid() const; @@ -1589,6 +1815,7 @@ class TrackInfo final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer > layers_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodecInfo > codecs_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sid_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr mime_type_; @@ -1653,7 +1880,7 @@ class VideoLayer final : &_VideoLayer_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 6; friend void swap(VideoLayer& a, VideoLayer& b) { a.Swap(&b); @@ -1849,7 +2076,7 @@ class DataPacket final : &_DataPacket_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 7; friend void swap(DataPacket& a, DataPacket& b) { a.Swap(&b); @@ -2078,7 +2305,7 @@ class ActiveSpeakerUpdate final : &_ActiveSpeakerUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 8; friend void swap(ActiveSpeakerUpdate& a, ActiveSpeakerUpdate& b) { a.Swap(&b); @@ -2233,7 +2460,7 @@ class SpeakerInfo final : &_SpeakerInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 9; friend void swap(SpeakerInfo& a, SpeakerInfo& b) { a.Swap(&b); @@ -2406,7 +2633,7 @@ class UserPacket final : &_UserPacket_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 10; friend void swap(UserPacket& a, UserPacket& b) { a.Swap(&b); @@ -2599,7 +2826,7 @@ class ParticipantTracks final : &_ParticipantTracks_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 11; friend void swap(ParticipantTracks& a, ParticipantTracks& b) { a.Swap(&b); @@ -2776,7 +3003,7 @@ class ClientInfo final : &_ClientInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 11; + 12; friend void swap(ClientInfo& a, ClientInfo& b) { a.Swap(&b); @@ -3085,7 +3312,7 @@ class ClientConfiguration final : &_ClientConfiguration_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 13; friend void swap(ClientConfiguration& a, ClientConfiguration& b) { a.Swap(&b); @@ -3271,7 +3498,7 @@ class VideoConfiguration final : &_VideoConfiguration_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 14; friend void swap(VideoConfiguration& a, VideoConfiguration& b) { a.Swap(&b); @@ -3440,7 +3667,7 @@ class RTPStats final : &_RTPStats_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 16; friend void swap(RTPStats& a, RTPStats& b) { a.Swap(&b); @@ -5046,6 +5273,203 @@ inline void ParticipantInfo::set_is_publisher(bool value) { // ------------------------------------------------------------------- +// SimulcastCodecInfo + +// string mime_type = 1; +inline void SimulcastCodecInfo::clear_mime_type() { + mime_type_.ClearToEmpty(); +} +inline const std::string& SimulcastCodecInfo::mime_type() const { + // @@protoc_insertion_point(field_get:livekit.SimulcastCodecInfo.mime_type) + return _internal_mime_type(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SimulcastCodecInfo::set_mime_type(ArgT0&& arg0, ArgT... args) { + + mime_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:livekit.SimulcastCodecInfo.mime_type) +} +inline std::string* SimulcastCodecInfo::mutable_mime_type() { + std::string* _s = _internal_mutable_mime_type(); + // @@protoc_insertion_point(field_mutable:livekit.SimulcastCodecInfo.mime_type) + return _s; +} +inline const std::string& SimulcastCodecInfo::_internal_mime_type() const { + return mime_type_.Get(); +} +inline void SimulcastCodecInfo::_internal_set_mime_type(const std::string& value) { + + mime_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); +} +inline std::string* SimulcastCodecInfo::_internal_mutable_mime_type() { + + return mime_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); +} +inline std::string* SimulcastCodecInfo::release_mime_type() { + // @@protoc_insertion_point(field_release:livekit.SimulcastCodecInfo.mime_type) + return mime_type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); +} +inline void SimulcastCodecInfo::set_allocated_mime_type(std::string* mime_type) { + if (mime_type != nullptr) { + + } else { + + } + mime_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), mime_type, + GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (mime_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { + mime_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:livekit.SimulcastCodecInfo.mime_type) +} + +// string mid = 2; +inline void SimulcastCodecInfo::clear_mid() { + mid_.ClearToEmpty(); +} +inline const std::string& SimulcastCodecInfo::mid() const { + // @@protoc_insertion_point(field_get:livekit.SimulcastCodecInfo.mid) + return _internal_mid(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SimulcastCodecInfo::set_mid(ArgT0&& arg0, ArgT... args) { + + mid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:livekit.SimulcastCodecInfo.mid) +} +inline std::string* SimulcastCodecInfo::mutable_mid() { + std::string* _s = _internal_mutable_mid(); + // @@protoc_insertion_point(field_mutable:livekit.SimulcastCodecInfo.mid) + return _s; +} +inline const std::string& SimulcastCodecInfo::_internal_mid() const { + return mid_.Get(); +} +inline void SimulcastCodecInfo::_internal_set_mid(const std::string& value) { + + mid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); +} +inline std::string* SimulcastCodecInfo::_internal_mutable_mid() { + + return mid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); +} +inline std::string* SimulcastCodecInfo::release_mid() { + // @@protoc_insertion_point(field_release:livekit.SimulcastCodecInfo.mid) + return mid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); +} +inline void SimulcastCodecInfo::set_allocated_mid(std::string* mid) { + if (mid != nullptr) { + + } else { + + } + mid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), mid, + GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (mid_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { + mid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:livekit.SimulcastCodecInfo.mid) +} + +// string cid = 3; +inline void SimulcastCodecInfo::clear_cid() { + cid_.ClearToEmpty(); +} +inline const std::string& SimulcastCodecInfo::cid() const { + // @@protoc_insertion_point(field_get:livekit.SimulcastCodecInfo.cid) + return _internal_cid(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SimulcastCodecInfo::set_cid(ArgT0&& arg0, ArgT... args) { + + cid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:livekit.SimulcastCodecInfo.cid) +} +inline std::string* SimulcastCodecInfo::mutable_cid() { + std::string* _s = _internal_mutable_cid(); + // @@protoc_insertion_point(field_mutable:livekit.SimulcastCodecInfo.cid) + return _s; +} +inline const std::string& SimulcastCodecInfo::_internal_cid() const { + return cid_.Get(); +} +inline void SimulcastCodecInfo::_internal_set_cid(const std::string& value) { + + cid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); +} +inline std::string* SimulcastCodecInfo::_internal_mutable_cid() { + + return cid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); +} +inline std::string* SimulcastCodecInfo::release_cid() { + // @@protoc_insertion_point(field_release:livekit.SimulcastCodecInfo.cid) + return cid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); +} +inline void SimulcastCodecInfo::set_allocated_cid(std::string* cid) { + if (cid != nullptr) { + + } else { + + } + cid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), cid, + GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (cid_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { + cid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:livekit.SimulcastCodecInfo.cid) +} + +// repeated .livekit.VideoLayer layers = 4; +inline int SimulcastCodecInfo::_internal_layers_size() const { + return layers_.size(); +} +inline int SimulcastCodecInfo::layers_size() const { + return _internal_layers_size(); +} +inline void SimulcastCodecInfo::clear_layers() { + layers_.Clear(); +} +inline ::livekit::VideoLayer* SimulcastCodecInfo::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:livekit.SimulcastCodecInfo.layers) + return layers_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer >* +SimulcastCodecInfo::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:livekit.SimulcastCodecInfo.layers) + return &layers_; +} +inline const ::livekit::VideoLayer& SimulcastCodecInfo::_internal_layers(int index) const { + return layers_.Get(index); +} +inline const ::livekit::VideoLayer& SimulcastCodecInfo::layers(int index) const { + // @@protoc_insertion_point(field_get:livekit.SimulcastCodecInfo.layers) + return _internal_layers(index); +} +inline ::livekit::VideoLayer* SimulcastCodecInfo::_internal_add_layers() { + return layers_.Add(); +} +inline ::livekit::VideoLayer* SimulcastCodecInfo::add_layers() { + ::livekit::VideoLayer* _add = _internal_add_layers(); + // @@protoc_insertion_point(field_add:livekit.SimulcastCodecInfo.layers) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer >& +SimulcastCodecInfo::layers() const { + // @@protoc_insertion_point(field_list:livekit.SimulcastCodecInfo.layers) + return layers_; +} + +// ------------------------------------------------------------------- + // TrackInfo // string sid = 1; @@ -5432,6 +5856,46 @@ inline void TrackInfo::set_allocated_mid(std::string* mid) { // @@protoc_insertion_point(field_set_allocated:livekit.TrackInfo.mid) } +// repeated .livekit.SimulcastCodecInfo codecs = 13; +inline int TrackInfo::_internal_codecs_size() const { + return codecs_.size(); +} +inline int TrackInfo::codecs_size() const { + return _internal_codecs_size(); +} +inline void TrackInfo::clear_codecs() { + codecs_.Clear(); +} +inline ::livekit::SimulcastCodecInfo* TrackInfo::mutable_codecs(int index) { + // @@protoc_insertion_point(field_mutable:livekit.TrackInfo.codecs) + return codecs_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodecInfo >* +TrackInfo::mutable_codecs() { + // @@protoc_insertion_point(field_mutable_list:livekit.TrackInfo.codecs) + return &codecs_; +} +inline const ::livekit::SimulcastCodecInfo& TrackInfo::_internal_codecs(int index) const { + return codecs_.Get(index); +} +inline const ::livekit::SimulcastCodecInfo& TrackInfo::codecs(int index) const { + // @@protoc_insertion_point(field_get:livekit.TrackInfo.codecs) + return _internal_codecs(index); +} +inline ::livekit::SimulcastCodecInfo* TrackInfo::_internal_add_codecs() { + return codecs_.Add(); +} +inline ::livekit::SimulcastCodecInfo* TrackInfo::add_codecs() { + ::livekit::SimulcastCodecInfo* _add = _internal_add_codecs(); + // @@protoc_insertion_point(field_add:livekit.TrackInfo.codecs) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodecInfo >& +TrackInfo::codecs() const { + // @@protoc_insertion_point(field_list:livekit.TrackInfo.codecs) + return codecs_; +} + // ------------------------------------------------------------------- // VideoLayer @@ -8000,6 +8464,8 @@ inline void RTPStats::set_allocated_last_layer_lock_pli(::PROTOBUF_NAMESPACE_ID: // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/src/proto/livekit_rtc.pb.cc b/src/proto/livekit_rtc.pb.cc index f6e58ac..33f8a6e 100644 --- a/src/proto/livekit_rtc.pb.cc +++ b/src/proto/livekit_rtc.pb.cc @@ -41,9 +41,24 @@ struct SignalResponseDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SignalResponseDefaultTypeInternal _SignalResponse_default_instance_; +constexpr SimulcastCodec::SimulcastCodec( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : codec_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , cid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , enable_simulcast_layers_(false){} +struct SimulcastCodecDefaultTypeInternal { + constexpr SimulcastCodecDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~SimulcastCodecDefaultTypeInternal() {} + union { + SimulcastCodec _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SimulcastCodecDefaultTypeInternal _SimulcastCodec_default_instance_; constexpr AddTrackRequest::AddTrackRequest( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : layers_() + , simulcast_codecs_() , cid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , type_(0) @@ -322,9 +337,23 @@ struct SubscribedQualityDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SubscribedQualityDefaultTypeInternal _SubscribedQuality_default_instance_; +constexpr SubscribedCodec::SubscribedCodec( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : qualities_() + , codec_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +struct SubscribedCodecDefaultTypeInternal { + constexpr SubscribedCodecDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~SubscribedCodecDefaultTypeInternal() {} + union { + SubscribedCodec _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SubscribedCodecDefaultTypeInternal _SubscribedCodec_default_instance_; constexpr SubscribedQualityUpdate::SubscribedQualityUpdate( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : subscribed_qualities_() + , subscribed_codecs_() , track_sid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} struct SubscribedQualityUpdateDefaultTypeInternal { constexpr SubscribedQualityUpdateDefaultTypeInternal() @@ -420,7 +449,7 @@ struct SimulateScenarioDefaultTypeInternal { }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SimulateScenarioDefaultTypeInternal _SimulateScenario_default_instance_; } // namespace livekit -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_livekit_5frtc_2eproto[29]; +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_livekit_5frtc_2eproto[31]; static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_livekit_5frtc_2eproto[2]; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_livekit_5frtc_2eproto = nullptr; @@ -468,6 +497,15 @@ const uint32_t TableStruct_livekit_5frtc_2eproto::offsets[] PROTOBUF_SECTION_VAR ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, PROTOBUF_FIELD_OFFSET(::livekit::SignalResponse, message_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodec, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodec, codec_), + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodec, cid_), + PROTOBUF_FIELD_OFFSET(::livekit::SimulcastCodec, enable_simulcast_layers_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::livekit::AddTrackRequest, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -482,6 +520,7 @@ const uint32_t TableStruct_livekit_5frtc_2eproto::offsets[] PROTOBUF_SECTION_VAR PROTOBUF_FIELD_OFFSET(::livekit::AddTrackRequest, disable_dtx_), PROTOBUF_FIELD_OFFSET(::livekit::AddTrackRequest, source_), PROTOBUF_FIELD_OFFSET(::livekit::AddTrackRequest, layers_), + PROTOBUF_FIELD_OFFSET(::livekit::AddTrackRequest, simulcast_codecs_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::livekit::TrickleRequest, _internal_metadata_), ~0u, // no _extensions_ @@ -642,6 +681,14 @@ const uint32_t TableStruct_livekit_5frtc_2eproto::offsets[] PROTOBUF_SECTION_VAR PROTOBUF_FIELD_OFFSET(::livekit::SubscribedQuality, quality_), PROTOBUF_FIELD_OFFSET(::livekit::SubscribedQuality, enabled_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::livekit::SubscribedCodec, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::livekit::SubscribedCodec, codec_), + PROTOBUF_FIELD_OFFSET(::livekit::SubscribedCodec, qualities_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::livekit::SubscribedQualityUpdate, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -649,6 +696,7 @@ const uint32_t TableStruct_livekit_5frtc_2eproto::offsets[] PROTOBUF_SECTION_VAR ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::livekit::SubscribedQualityUpdate, track_sid_), PROTOBUF_FIELD_OFFSET(::livekit::SubscribedQualityUpdate, subscribed_qualities_), + PROTOBUF_FIELD_OFFSET(::livekit::SubscribedQualityUpdate, subscribed_codecs_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::livekit::TrackPermission, _internal_metadata_), ~0u, // no _extensions_ @@ -710,38 +758,41 @@ const uint32_t TableStruct_livekit_5frtc_2eproto::offsets[] PROTOBUF_SECTION_VAR static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::livekit::SignalRequest)}, { 19, -1, -1, sizeof(::livekit::SignalResponse)}, - { 42, -1, -1, sizeof(::livekit::AddTrackRequest)}, - { 57, -1, -1, sizeof(::livekit::TrickleRequest)}, - { 65, -1, -1, sizeof(::livekit::MuteTrackRequest)}, - { 73, -1, -1, sizeof(::livekit::JoinResponse)}, - { 88, -1, -1, sizeof(::livekit::TrackPublishedResponse)}, - { 96, -1, -1, sizeof(::livekit::TrackUnpublishedResponse)}, - { 103, -1, -1, sizeof(::livekit::SessionDescription)}, - { 111, -1, -1, sizeof(::livekit::ParticipantUpdate)}, - { 118, -1, -1, sizeof(::livekit::UpdateSubscription)}, - { 127, -1, -1, sizeof(::livekit::UpdateTrackSettings)}, - { 138, -1, -1, sizeof(::livekit::LeaveRequest)}, - { 145, -1, -1, sizeof(::livekit::UpdateVideoLayers)}, - { 153, -1, -1, sizeof(::livekit::ICEServer)}, - { 162, -1, -1, sizeof(::livekit::SpeakersChanged)}, - { 169, -1, -1, sizeof(::livekit::RoomUpdate)}, - { 176, -1, -1, sizeof(::livekit::ConnectionQualityInfo)}, - { 185, -1, -1, sizeof(::livekit::ConnectionQualityUpdate)}, - { 192, -1, -1, sizeof(::livekit::StreamStateInfo)}, - { 201, -1, -1, sizeof(::livekit::StreamStateUpdate)}, - { 208, -1, -1, sizeof(::livekit::SubscribedQuality)}, - { 216, -1, -1, sizeof(::livekit::SubscribedQualityUpdate)}, - { 224, -1, -1, sizeof(::livekit::TrackPermission)}, - { 234, -1, -1, sizeof(::livekit::SubscriptionPermission)}, - { 242, -1, -1, sizeof(::livekit::SubscriptionPermissionUpdate)}, - { 251, -1, -1, sizeof(::livekit::SyncState)}, - { 261, -1, -1, sizeof(::livekit::DataChannelInfo)}, - { 270, -1, -1, sizeof(::livekit::SimulateScenario)}, + { 42, -1, -1, sizeof(::livekit::SimulcastCodec)}, + { 51, -1, -1, sizeof(::livekit::AddTrackRequest)}, + { 67, -1, -1, sizeof(::livekit::TrickleRequest)}, + { 75, -1, -1, sizeof(::livekit::MuteTrackRequest)}, + { 83, -1, -1, sizeof(::livekit::JoinResponse)}, + { 98, -1, -1, sizeof(::livekit::TrackPublishedResponse)}, + { 106, -1, -1, sizeof(::livekit::TrackUnpublishedResponse)}, + { 113, -1, -1, sizeof(::livekit::SessionDescription)}, + { 121, -1, -1, sizeof(::livekit::ParticipantUpdate)}, + { 128, -1, -1, sizeof(::livekit::UpdateSubscription)}, + { 137, -1, -1, sizeof(::livekit::UpdateTrackSettings)}, + { 148, -1, -1, sizeof(::livekit::LeaveRequest)}, + { 155, -1, -1, sizeof(::livekit::UpdateVideoLayers)}, + { 163, -1, -1, sizeof(::livekit::ICEServer)}, + { 172, -1, -1, sizeof(::livekit::SpeakersChanged)}, + { 179, -1, -1, sizeof(::livekit::RoomUpdate)}, + { 186, -1, -1, sizeof(::livekit::ConnectionQualityInfo)}, + { 195, -1, -1, sizeof(::livekit::ConnectionQualityUpdate)}, + { 202, -1, -1, sizeof(::livekit::StreamStateInfo)}, + { 211, -1, -1, sizeof(::livekit::StreamStateUpdate)}, + { 218, -1, -1, sizeof(::livekit::SubscribedQuality)}, + { 226, -1, -1, sizeof(::livekit::SubscribedCodec)}, + { 234, -1, -1, sizeof(::livekit::SubscribedQualityUpdate)}, + { 243, -1, -1, sizeof(::livekit::TrackPermission)}, + { 253, -1, -1, sizeof(::livekit::SubscriptionPermission)}, + { 261, -1, -1, sizeof(::livekit::SubscriptionPermissionUpdate)}, + { 270, -1, -1, sizeof(::livekit::SyncState)}, + { 280, -1, -1, sizeof(::livekit::DataChannelInfo)}, + { 289, -1, -1, sizeof(::livekit::SimulateScenario)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { reinterpret_cast(&::livekit::_SignalRequest_default_instance_), reinterpret_cast(&::livekit::_SignalResponse_default_instance_), + reinterpret_cast(&::livekit::_SimulcastCodec_default_instance_), reinterpret_cast(&::livekit::_AddTrackRequest_default_instance_), reinterpret_cast(&::livekit::_TrickleRequest_default_instance_), reinterpret_cast(&::livekit::_MuteTrackRequest_default_instance_), @@ -762,6 +813,7 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&::livekit::_StreamStateInfo_default_instance_), reinterpret_cast(&::livekit::_StreamStateUpdate_default_instance_), reinterpret_cast(&::livekit::_SubscribedQuality_default_instance_), + reinterpret_cast(&::livekit::_SubscribedCodec_default_instance_), reinterpret_cast(&::livekit::_SubscribedQualityUpdate_default_instance_), reinterpret_cast(&::livekit::_TrackPermission_default_instance_), reinterpret_cast(&::livekit::_SubscriptionPermission_default_instance_), @@ -810,87 +862,94 @@ const char descriptor_table_protodef_livekit_5frtc_2eproto[] PROTOBUF_SECTION_VA "ionPermissionUpdateH\000\022\027\n\rrefresh_token\030\020" " \001(\tH\000\022>\n\021track_unpublished\030\021 \001(\0132!.live" "kit.TrackUnpublishedResponseH\000B\t\n\007messag" - "e\"\334\001\n\017AddTrackRequest\022\013\n\003cid\030\001 \001(\t\022\014\n\004na" - "me\030\002 \001(\t\022 \n\004type\030\003 \001(\0162\022.livekit.TrackTy" - "pe\022\r\n\005width\030\004 \001(\r\022\016\n\006height\030\005 \001(\r\022\r\n\005mut" - "ed\030\006 \001(\010\022\023\n\013disable_dtx\030\007 \001(\010\022$\n\006source\030" - "\010 \001(\0162\024.livekit.TrackSource\022#\n\006layers\030\t " - "\003(\0132\023.livekit.VideoLayer\"N\n\016TrickleReque" - "st\022\025\n\rcandidateInit\030\001 \001(\t\022%\n\006target\030\002 \001(" - "\0162\025.livekit.SignalTarget\".\n\020MuteTrackReq" - "uest\022\013\n\003sid\030\001 \001(\t\022\r\n\005muted\030\002 \001(\010\"\331\002\n\014Joi" - "nResponse\022\033\n\004room\030\001 \001(\0132\r.livekit.Room\022-" - "\n\013participant\030\002 \001(\0132\030.livekit.Participan" - "tInfo\0224\n\022other_participants\030\003 \003(\0132\030.live" - "kit.ParticipantInfo\022\026\n\016server_version\030\004 " - "\001(\t\022\'\n\013ice_servers\030\005 \003(\0132\022.livekit.ICESe" - "rver\022\032\n\022subscriber_primary\030\006 \001(\010\022\027\n\017alte" - "rnative_url\030\007 \001(\t\022:\n\024client_configuratio" - "n\030\010 \001(\0132\034.livekit.ClientConfiguration\022\025\n" - "\rserver_region\030\t \001(\t\"H\n\026TrackPublishedRe" - "sponse\022\013\n\003cid\030\001 \001(\t\022!\n\005track\030\002 \001(\0132\022.liv" - "ekit.TrackInfo\"-\n\030TrackUnpublishedRespon" - "se\022\021\n\ttrack_sid\030\001 \001(\t\"/\n\022SessionDescript" - "ion\022\014\n\004type\030\001 \001(\t\022\013\n\003sdp\030\002 \001(\t\"C\n\021Partic" - "ipantUpdate\022.\n\014participants\030\001 \003(\0132\030.live" - "kit.ParticipantInfo\"s\n\022UpdateSubscriptio" - "n\022\022\n\ntrack_sids\030\001 \003(\t\022\021\n\tsubscribe\030\002 \001(\010" - "\0226\n\022participant_tracks\030\003 \003(\0132\032.livekit.P" - "articipantTracks\"\202\001\n\023UpdateTrackSettings" - "\022\022\n\ntrack_sids\030\001 \003(\t\022\020\n\010disabled\030\003 \001(\010\022&" - "\n\007quality\030\004 \001(\0162\025.livekit.VideoQuality\022\r" - "\n\005width\030\005 \001(\r\022\016\n\006height\030\006 \001(\r\"%\n\014LeaveRe" - "quest\022\025\n\rcan_reconnect\030\001 \001(\010\"K\n\021UpdateVi" - "deoLayers\022\021\n\ttrack_sid\030\001 \001(\t\022#\n\006layers\030\002" - " \003(\0132\023.livekit.VideoLayer\"\?\n\tICEServer\022\014" - "\n\004urls\030\001 \003(\t\022\020\n\010username\030\002 \001(\t\022\022\n\ncreden" - "tial\030\003 \001(\t\"9\n\017SpeakersChanged\022&\n\010speaker" - "s\030\001 \003(\0132\024.livekit.SpeakerInfo\")\n\nRoomUpd" - "ate\022\033\n\004room\030\001 \001(\0132\r.livekit.Room\"l\n\025Conn" - "ectionQualityInfo\022\027\n\017participant_sid\030\001 \001" - "(\t\022+\n\007quality\030\002 \001(\0162\032.livekit.Connection" - "Quality\022\r\n\005score\030\003 \001(\002\"J\n\027ConnectionQual" - "ityUpdate\022/\n\007updates\030\001 \003(\0132\036.livekit.Con" - "nectionQualityInfo\"b\n\017StreamStateInfo\022\027\n" - "\017participant_sid\030\001 \001(\t\022\021\n\ttrack_sid\030\002 \001(" - "\t\022#\n\005state\030\003 \001(\0162\024.livekit.StreamState\"D" - "\n\021StreamStateUpdate\022/\n\rstream_states\030\001 \003" - "(\0132\030.livekit.StreamStateInfo\"L\n\021Subscrib" - "edQuality\022&\n\007quality\030\001 \001(\0162\025.livekit.Vid" - "eoQuality\022\017\n\007enabled\030\002 \001(\010\"f\n\027Subscribed" - "QualityUpdate\022\021\n\ttrack_sid\030\001 \001(\t\0228\n\024subs" - "cribed_qualities\030\002 \003(\0132\032.livekit.Subscri" - "bedQuality\"p\n\017TrackPermission\022\027\n\017partici" - "pant_sid\030\001 \001(\t\022\022\n\nall_tracks\030\002 \001(\010\022\022\n\ntr" - "ack_sids\030\003 \003(\t\022\034\n\024participant_identity\030\004" - " \001(\t\"g\n\026SubscriptionPermission\022\030\n\020all_pa" - "rticipants\030\001 \001(\010\0223\n\021track_permissions\030\002 " - "\003(\0132\030.livekit.TrackPermission\"[\n\034Subscri" - "ptionPermissionUpdate\022\027\n\017participant_sid" - "\030\001 \001(\t\022\021\n\ttrack_sid\030\002 \001(\t\022\017\n\007allowed\030\003 \001" - "(\010\"\325\001\n\tSyncState\022+\n\006answer\030\001 \001(\0132\033.livek" - "it.SessionDescription\0221\n\014subscription\030\002 " - "\001(\0132\033.livekit.UpdateSubscription\0227\n\016publ" - "ish_tracks\030\003 \003(\0132\037.livekit.TrackPublishe" - "dResponse\022/\n\rdata_channels\030\004 \003(\0132\030.livek" - "it.DataChannelInfo\"S\n\017DataChannelInfo\022\r\n" - "\005label\030\001 \001(\t\022\n\n\002id\030\002 \001(\r\022%\n\006target\030\003 \001(\016" - "2\025.livekit.SignalTarget\"}\n\020SimulateScena" - "rio\022\030\n\016speaker_update\030\001 \001(\005H\000\022\026\n\014node_fa" - "ilure\030\002 \001(\010H\000\022\023\n\tmigration\030\003 \001(\010H\000\022\026\n\014se" - "rver_leave\030\004 \001(\010H\000B\n\n\010scenario*-\n\014Signal" - "Target\022\r\n\tPUBLISHER\020\000\022\016\n\nSUBSCRIBER\020\001*%\n" - "\013StreamState\022\n\n\006ACTIVE\020\000\022\n\n\006PAUSED\020\001BFZ#" - "github.com/livekit/protocol/livekit\252\002\rLi" - "veKit.Proto\352\002\016LiveKit::Protob\006proto3" + "e\"M\n\016SimulcastCodec\022\r\n\005codec\030\001 \001(\t\022\013\n\003ci" + "d\030\002 \001(\t\022\037\n\027enable_simulcast_layers\030\003 \001(\010" + "\"\217\002\n\017AddTrackRequest\022\013\n\003cid\030\001 \001(\t\022\014\n\004nam" + "e\030\002 \001(\t\022 \n\004type\030\003 \001(\0162\022.livekit.TrackTyp" + "e\022\r\n\005width\030\004 \001(\r\022\016\n\006height\030\005 \001(\r\022\r\n\005mute" + "d\030\006 \001(\010\022\023\n\013disable_dtx\030\007 \001(\010\022$\n\006source\030\010" + " \001(\0162\024.livekit.TrackSource\022#\n\006layers\030\t \003" + "(\0132\023.livekit.VideoLayer\0221\n\020simulcast_cod" + "ecs\030\n \003(\0132\027.livekit.SimulcastCodec\"N\n\016Tr" + "ickleRequest\022\025\n\rcandidateInit\030\001 \001(\t\022%\n\006t" + "arget\030\002 \001(\0162\025.livekit.SignalTarget\".\n\020Mu" + "teTrackRequest\022\013\n\003sid\030\001 \001(\t\022\r\n\005muted\030\002 \001" + "(\010\"\331\002\n\014JoinResponse\022\033\n\004room\030\001 \001(\0132\r.live" + "kit.Room\022-\n\013participant\030\002 \001(\0132\030.livekit." + "ParticipantInfo\0224\n\022other_participants\030\003 " + "\003(\0132\030.livekit.ParticipantInfo\022\026\n\016server_" + "version\030\004 \001(\t\022\'\n\013ice_servers\030\005 \003(\0132\022.liv" + "ekit.ICEServer\022\032\n\022subscriber_primary\030\006 \001" + "(\010\022\027\n\017alternative_url\030\007 \001(\t\022:\n\024client_co" + "nfiguration\030\010 \001(\0132\034.livekit.ClientConfig" + "uration\022\025\n\rserver_region\030\t \001(\t\"H\n\026TrackP" + "ublishedResponse\022\013\n\003cid\030\001 \001(\t\022!\n\005track\030\002" + " \001(\0132\022.livekit.TrackInfo\"-\n\030TrackUnpubli" + "shedResponse\022\021\n\ttrack_sid\030\001 \001(\t\"/\n\022Sessi" + "onDescription\022\014\n\004type\030\001 \001(\t\022\013\n\003sdp\030\002 \001(\t" + "\"C\n\021ParticipantUpdate\022.\n\014participants\030\001 " + "\003(\0132\030.livekit.ParticipantInfo\"s\n\022UpdateS" + "ubscription\022\022\n\ntrack_sids\030\001 \003(\t\022\021\n\tsubsc" + "ribe\030\002 \001(\010\0226\n\022participant_tracks\030\003 \003(\0132\032" + ".livekit.ParticipantTracks\"\202\001\n\023UpdateTra" + "ckSettings\022\022\n\ntrack_sids\030\001 \003(\t\022\020\n\010disabl" + "ed\030\003 \001(\010\022&\n\007quality\030\004 \001(\0162\025.livekit.Vide" + "oQuality\022\r\n\005width\030\005 \001(\r\022\016\n\006height\030\006 \001(\r\"" + "%\n\014LeaveRequest\022\025\n\rcan_reconnect\030\001 \001(\010\"K" + "\n\021UpdateVideoLayers\022\021\n\ttrack_sid\030\001 \001(\t\022#" + "\n\006layers\030\002 \003(\0132\023.livekit.VideoLayer\"\?\n\tI" + "CEServer\022\014\n\004urls\030\001 \003(\t\022\020\n\010username\030\002 \001(\t" + "\022\022\n\ncredential\030\003 \001(\t\"9\n\017SpeakersChanged\022" + "&\n\010speakers\030\001 \003(\0132\024.livekit.SpeakerInfo\"" + ")\n\nRoomUpdate\022\033\n\004room\030\001 \001(\0132\r.livekit.Ro" + "om\"l\n\025ConnectionQualityInfo\022\027\n\017participa" + "nt_sid\030\001 \001(\t\022+\n\007quality\030\002 \001(\0162\032.livekit." + "ConnectionQuality\022\r\n\005score\030\003 \001(\002\"J\n\027Conn" + "ectionQualityUpdate\022/\n\007updates\030\001 \003(\0132\036.l" + "ivekit.ConnectionQualityInfo\"b\n\017StreamSt" + "ateInfo\022\027\n\017participant_sid\030\001 \001(\t\022\021\n\ttrac" + "k_sid\030\002 \001(\t\022#\n\005state\030\003 \001(\0162\024.livekit.Str" + "eamState\"D\n\021StreamStateUpdate\022/\n\rstream_" + "states\030\001 \003(\0132\030.livekit.StreamStateInfo\"L" + "\n\021SubscribedQuality\022&\n\007quality\030\001 \001(\0162\025.l" + "ivekit.VideoQuality\022\017\n\007enabled\030\002 \001(\010\"O\n\017" + "SubscribedCodec\022\r\n\005codec\030\001 \001(\t\022-\n\tqualit" + "ies\030\002 \003(\0132\032.livekit.SubscribedQuality\"\233\001" + "\n\027SubscribedQualityUpdate\022\021\n\ttrack_sid\030\001" + " \001(\t\0228\n\024subscribed_qualities\030\002 \003(\0132\032.liv" + "ekit.SubscribedQuality\0223\n\021subscribed_cod" + "ecs\030\003 \003(\0132\030.livekit.SubscribedCodec\"p\n\017T" + "rackPermission\022\027\n\017participant_sid\030\001 \001(\t\022" + "\022\n\nall_tracks\030\002 \001(\010\022\022\n\ntrack_sids\030\003 \003(\t\022" + "\034\n\024participant_identity\030\004 \001(\t\"g\n\026Subscri" + "ptionPermission\022\030\n\020all_participants\030\001 \001(" + "\010\0223\n\021track_permissions\030\002 \003(\0132\030.livekit.T" + "rackPermission\"[\n\034SubscriptionPermission" + "Update\022\027\n\017participant_sid\030\001 \001(\t\022\021\n\ttrack" + "_sid\030\002 \001(\t\022\017\n\007allowed\030\003 \001(\010\"\325\001\n\tSyncStat" + "e\022+\n\006answer\030\001 \001(\0132\033.livekit.SessionDescr" + "iption\0221\n\014subscription\030\002 \001(\0132\033.livekit.U" + "pdateSubscription\0227\n\016publish_tracks\030\003 \003(" + "\0132\037.livekit.TrackPublishedResponse\022/\n\rda" + "ta_channels\030\004 \003(\0132\030.livekit.DataChannelI" + "nfo\"S\n\017DataChannelInfo\022\r\n\005label\030\001 \001(\t\022\n\n" + "\002id\030\002 \001(\r\022%\n\006target\030\003 \001(\0162\025.livekit.Sign" + "alTarget\"}\n\020SimulateScenario\022\030\n\016speaker_" + "update\030\001 \001(\005H\000\022\026\n\014node_failure\030\002 \001(\010H\000\022\023" + "\n\tmigration\030\003 \001(\010H\000\022\026\n\014server_leave\030\004 \001(" + "\010H\000B\n\n\010scenario*-\n\014SignalTarget\022\r\n\tPUBLI" + "SHER\020\000\022\016\n\nSUBSCRIBER\020\001*%\n\013StreamState\022\n\n" + "\006ACTIVE\020\000\022\n\n\006PAUSED\020\001BFZ#github.com/live" + "kit/protocol/livekit\252\002\rLiveKit.Proto\352\002\016L" + "iveKit::Protob\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_livekit_5frtc_2eproto_deps[1] = { &::descriptor_table_livekit_5fmodels_2eproto, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_livekit_5frtc_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_livekit_5frtc_2eproto = { - false, false, 4436, descriptor_table_protodef_livekit_5frtc_2eproto, "livekit_rtc.proto", - &descriptor_table_livekit_5frtc_2eproto_once, descriptor_table_livekit_5frtc_2eproto_deps, 1, 29, + false, false, 4701, descriptor_table_protodef_livekit_5frtc_2eproto, "livekit_rtc.proto", + &descriptor_table_livekit_5frtc_2eproto_once, descriptor_table_livekit_5frtc_2eproto_deps, 1, 31, schemas, file_default_instances, TableStruct_livekit_5frtc_2eproto::offsets, file_level_metadata_livekit_5frtc_2eproto, file_level_enum_descriptors_livekit_5frtc_2eproto, file_level_service_descriptors_livekit_5frtc_2eproto, }; @@ -2882,6 +2941,284 @@ void SignalResponse::InternalSwap(SignalResponse* other) { // =================================================================== +class SimulcastCodec::_Internal { + public: +}; + +SimulcastCodec::SimulcastCodec(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(); + if (!is_message_owned) { + RegisterArenaDtor(arena); + } + // @@protoc_insertion_point(arena_constructor:livekit.SimulcastCodec) +} +SimulcastCodec::SimulcastCodec(const SimulcastCodec& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + codec_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + codec_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_codec().empty()) { + codec_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_codec(), + GetArenaForAllocation()); + } + cid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + cid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_cid().empty()) { + cid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_cid(), + GetArenaForAllocation()); + } + enable_simulcast_layers_ = from.enable_simulcast_layers_; + // @@protoc_insertion_point(copy_constructor:livekit.SimulcastCodec) +} + +inline void SimulcastCodec::SharedCtor() { +codec_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + codec_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +cid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + cid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +enable_simulcast_layers_ = false; +} + +SimulcastCodec::~SimulcastCodec() { + // @@protoc_insertion_point(destructor:livekit.SimulcastCodec) + if (GetArenaForAllocation() != nullptr) return; + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +inline void SimulcastCodec::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + codec_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + cid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void SimulcastCodec::ArenaDtor(void* object) { + SimulcastCodec* _this = reinterpret_cast< SimulcastCodec* >(object); + (void)_this; +} +void SimulcastCodec::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SimulcastCodec::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void SimulcastCodec::Clear() { +// @@protoc_insertion_point(message_clear_start:livekit.SimulcastCodec) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + codec_.ClearToEmpty(); + cid_.ClearToEmpty(); + enable_simulcast_layers_ = false; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SimulcastCodec::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string codec = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_codec(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "livekit.SimulcastCodec.codec")); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string cid = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_cid(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "livekit.SimulcastCodec.cid")); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool enable_simulcast_layers = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + enable_simulcast_layers_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* SimulcastCodec::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:livekit.SimulcastCodec) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string codec = 1; + if (!this->_internal_codec().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_codec().data(), static_cast(this->_internal_codec().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "livekit.SimulcastCodec.codec"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_codec(), target); + } + + // string cid = 2; + if (!this->_internal_cid().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_cid().data(), static_cast(this->_internal_cid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "livekit.SimulcastCodec.cid"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_cid(), target); + } + + // bool enable_simulcast_layers = 3; + if (this->_internal_enable_simulcast_layers() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_enable_simulcast_layers(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:livekit.SimulcastCodec) + return target; +} + +size_t SimulcastCodec::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:livekit.SimulcastCodec) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string codec = 1; + if (!this->_internal_codec().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_codec()); + } + + // string cid = 2; + if (!this->_internal_cid().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_cid()); + } + + // bool enable_simulcast_layers = 3; + if (this->_internal_enable_simulcast_layers() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SimulcastCodec::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + SimulcastCodec::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SimulcastCodec::GetClassData() const { return &_class_data_; } + +void SimulcastCodec::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void SimulcastCodec::MergeFrom(const SimulcastCodec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:livekit.SimulcastCodec) + GOOGLE_DCHECK_NE(&from, this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_codec().empty()) { + _internal_set_codec(from._internal_codec()); + } + if (!from._internal_cid().empty()) { + _internal_set_cid(from._internal_cid()); + } + if (from._internal_enable_simulcast_layers() != 0) { + _internal_set_enable_simulcast_layers(from._internal_enable_simulcast_layers()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void SimulcastCodec::CopyFrom(const SimulcastCodec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:livekit.SimulcastCodec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SimulcastCodec::IsInitialized() const { + return true; +} + +void SimulcastCodec::InternalSwap(SimulcastCodec* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + &codec_, lhs_arena, + &other->codec_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + &cid_, lhs_arena, + &other->cid_, rhs_arena + ); + swap(enable_simulcast_layers_, other->enable_simulcast_layers_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SimulcastCodec::GetMetadata() const { + return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, + file_level_metadata_livekit_5frtc_2eproto[2]); +} + +// =================================================================== + class AddTrackRequest::_Internal { public: }; @@ -2892,7 +3229,8 @@ void AddTrackRequest::clear_layers() { AddTrackRequest::AddTrackRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - layers_(arena) { + layers_(arena), + simulcast_codecs_(arena) { SharedCtor(); if (!is_message_owned) { RegisterArenaDtor(arena); @@ -2901,7 +3239,8 @@ AddTrackRequest::AddTrackRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, } AddTrackRequest::AddTrackRequest(const AddTrackRequest& from) : ::PROTOBUF_NAMESPACE_ID::Message(), - layers_(from.layers_) { + layers_(from.layers_), + simulcast_codecs_(from.simulcast_codecs_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); cid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -2970,6 +3309,7 @@ void AddTrackRequest::Clear() { (void) cached_has_bits; layers_.Clear(); + simulcast_codecs_.Clear(); cid_.ClearToEmpty(); name_.ClearToEmpty(); ::memset(&type_, 0, static_cast( @@ -3067,6 +3407,19 @@ const char* AddTrackRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC } else goto handle_unusual; continue; + // repeated .livekit.SimulcastCodec simulcast_codecs = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_simulcast_codecs(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -3162,6 +3515,14 @@ uint8_t* AddTrackRequest::_InternalSerialize( InternalWriteMessage(9, this->_internal_layers(i), target, stream); } + // repeated .livekit.SimulcastCodec simulcast_codecs = 10; + for (unsigned int i = 0, + n = static_cast(this->_internal_simulcast_codecs_size()); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(10, this->_internal_simulcast_codecs(i), target, stream); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -3185,6 +3546,13 @@ size_t AddTrackRequest::ByteSizeLong() const { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } + // repeated .livekit.SimulcastCodec simulcast_codecs = 10; + total_size += 1UL * this->_internal_simulcast_codecs_size(); + for (const auto& msg : this->simulcast_codecs_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + // string cid = 1; if (!this->_internal_cid().empty()) { total_size += 1 + @@ -3254,6 +3622,7 @@ void AddTrackRequest::MergeFrom(const AddTrackRequest& from) { (void) cached_has_bits; layers_.MergeFrom(from.layers_); + simulcast_codecs_.MergeFrom(from.simulcast_codecs_); if (!from._internal_cid().empty()) { _internal_set_cid(from._internal_cid()); } @@ -3298,6 +3667,7 @@ void AddTrackRequest::InternalSwap(AddTrackRequest* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); layers_.InternalSwap(&other->layers_); + simulcast_codecs_.InternalSwap(&other->simulcast_codecs_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &cid_, lhs_arena, @@ -3319,7 +3689,7 @@ void AddTrackRequest::InternalSwap(AddTrackRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AddTrackRequest::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[2]); + file_level_metadata_livekit_5frtc_2eproto[3]); } // =================================================================== @@ -3551,7 +3921,7 @@ void TrickleRequest::InternalSwap(TrickleRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TrickleRequest::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[3]); + file_level_metadata_livekit_5frtc_2eproto[4]); } // =================================================================== @@ -3780,7 +4150,7 @@ void MuteTrackRequest::InternalSwap(MuteTrackRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata MuteTrackRequest::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[4]); + file_level_metadata_livekit_5frtc_2eproto[5]); } // =================================================================== @@ -4325,7 +4695,7 @@ void JoinResponse::InternalSwap(JoinResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata JoinResponse::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[5]); + file_level_metadata_livekit_5frtc_2eproto[6]); } // =================================================================== @@ -4577,7 +4947,7 @@ void TrackPublishedResponse::InternalSwap(TrackPublishedResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TrackPublishedResponse::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[6]); + file_level_metadata_livekit_5frtc_2eproto[7]); } // =================================================================== @@ -4780,7 +5150,7 @@ void TrackUnpublishedResponse::InternalSwap(TrackUnpublishedResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TrackUnpublishedResponse::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[7]); + file_level_metadata_livekit_5frtc_2eproto[8]); } // =================================================================== @@ -5032,7 +5402,7 @@ void SessionDescription::InternalSwap(SessionDescription* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SessionDescription::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[8]); + file_level_metadata_livekit_5frtc_2eproto[9]); } // =================================================================== @@ -5220,7 +5590,7 @@ void ParticipantUpdate::InternalSwap(ParticipantUpdate* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ParticipantUpdate::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[9]); + file_level_metadata_livekit_5frtc_2eproto[10]); } // =================================================================== @@ -5472,7 +5842,7 @@ void UpdateSubscription::InternalSwap(UpdateSubscription* other) { ::PROTOBUF_NAMESPACE_ID::Metadata UpdateSubscription::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[10]); + file_level_metadata_livekit_5frtc_2eproto[11]); } // =================================================================== @@ -5769,7 +6139,7 @@ void UpdateTrackSettings::InternalSwap(UpdateTrackSettings* other) { ::PROTOBUF_NAMESPACE_ID::Metadata UpdateTrackSettings::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[11]); + file_level_metadata_livekit_5frtc_2eproto[12]); } // =================================================================== @@ -5947,7 +6317,7 @@ void LeaveRequest::InternalSwap(LeaveRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata LeaveRequest::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[12]); + file_level_metadata_livekit_5frtc_2eproto[13]); } // =================================================================== @@ -6186,7 +6556,7 @@ void UpdateVideoLayers::InternalSwap(UpdateVideoLayers* other) { ::PROTOBUF_NAMESPACE_ID::Metadata UpdateVideoLayers::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[13]); + file_level_metadata_livekit_5frtc_2eproto[14]); } // =================================================================== @@ -6476,7 +6846,7 @@ void ICEServer::InternalSwap(ICEServer* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ICEServer::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[14]); + file_level_metadata_livekit_5frtc_2eproto[15]); } // =================================================================== @@ -6664,7 +7034,7 @@ void SpeakersChanged::InternalSwap(SpeakersChanged* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SpeakersChanged::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[15]); + file_level_metadata_livekit_5frtc_2eproto[16]); } // =================================================================== @@ -6865,7 +7235,7 @@ void RoomUpdate::InternalSwap(RoomUpdate* other) { ::PROTOBUF_NAMESPACE_ID::Metadata RoomUpdate::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[16]); + file_level_metadata_livekit_5frtc_2eproto[17]); } // =================================================================== @@ -7143,7 +7513,7 @@ void ConnectionQualityInfo::InternalSwap(ConnectionQualityInfo* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ConnectionQualityInfo::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[17]); + file_level_metadata_livekit_5frtc_2eproto[18]); } // =================================================================== @@ -7328,7 +7698,7 @@ void ConnectionQualityUpdate::InternalSwap(ConnectionQualityUpdate* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ConnectionQualityUpdate::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[18]); + file_level_metadata_livekit_5frtc_2eproto[19]); } // =================================================================== @@ -7609,7 +7979,7 @@ void StreamStateInfo::InternalSwap(StreamStateInfo* other) { ::PROTOBUF_NAMESPACE_ID::Metadata StreamStateInfo::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[19]); + file_level_metadata_livekit_5frtc_2eproto[20]); } // =================================================================== @@ -7794,7 +8164,7 @@ void StreamStateUpdate::InternalSwap(StreamStateUpdate* other) { ::PROTOBUF_NAMESPACE_ID::Metadata StreamStateUpdate::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[20]); + file_level_metadata_livekit_5frtc_2eproto[21]); } // =================================================================== @@ -8009,7 +8379,243 @@ void SubscribedQuality::InternalSwap(SubscribedQuality* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SubscribedQuality::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[21]); + file_level_metadata_livekit_5frtc_2eproto[22]); +} + +// =================================================================== + +class SubscribedCodec::_Internal { + public: +}; + +SubscribedCodec::SubscribedCodec(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), + qualities_(arena) { + SharedCtor(); + if (!is_message_owned) { + RegisterArenaDtor(arena); + } + // @@protoc_insertion_point(arena_constructor:livekit.SubscribedCodec) +} +SubscribedCodec::SubscribedCodec(const SubscribedCodec& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + qualities_(from.qualities_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + codec_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + codec_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_codec().empty()) { + codec_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_codec(), + GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:livekit.SubscribedCodec) +} + +inline void SubscribedCodec::SharedCtor() { +codec_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + codec_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +SubscribedCodec::~SubscribedCodec() { + // @@protoc_insertion_point(destructor:livekit.SubscribedCodec) + if (GetArenaForAllocation() != nullptr) return; + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +inline void SubscribedCodec::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + codec_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void SubscribedCodec::ArenaDtor(void* object) { + SubscribedCodec* _this = reinterpret_cast< SubscribedCodec* >(object); + (void)_this; +} +void SubscribedCodec::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SubscribedCodec::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void SubscribedCodec::Clear() { +// @@protoc_insertion_point(message_clear_start:livekit.SubscribedCodec) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + qualities_.Clear(); + codec_.ClearToEmpty(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SubscribedCodec::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string codec = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_codec(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "livekit.SubscribedCodec.codec")); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .livekit.SubscribedQuality qualities = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_qualities(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* SubscribedCodec::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:livekit.SubscribedCodec) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string codec = 1; + if (!this->_internal_codec().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_codec().data(), static_cast(this->_internal_codec().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "livekit.SubscribedCodec.codec"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_codec(), target); + } + + // repeated .livekit.SubscribedQuality qualities = 2; + for (unsigned int i = 0, + n = static_cast(this->_internal_qualities_size()); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, this->_internal_qualities(i), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:livekit.SubscribedCodec) + return target; +} + +size_t SubscribedCodec::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:livekit.SubscribedCodec) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .livekit.SubscribedQuality qualities = 2; + total_size += 1UL * this->_internal_qualities_size(); + for (const auto& msg : this->qualities_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // string codec = 1; + if (!this->_internal_codec().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_codec()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SubscribedCodec::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, + SubscribedCodec::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SubscribedCodec::GetClassData() const { return &_class_data_; } + +void SubscribedCodec::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, + const ::PROTOBUF_NAMESPACE_ID::Message& from) { + static_cast(to)->MergeFrom( + static_cast(from)); +} + + +void SubscribedCodec::MergeFrom(const SubscribedCodec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:livekit.SubscribedCodec) + GOOGLE_DCHECK_NE(&from, this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + qualities_.MergeFrom(from.qualities_); + if (!from._internal_codec().empty()) { + _internal_set_codec(from._internal_codec()); + } + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void SubscribedCodec::CopyFrom(const SubscribedCodec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:livekit.SubscribedCodec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SubscribedCodec::IsInitialized() const { + return true; +} + +void SubscribedCodec::InternalSwap(SubscribedCodec* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + qualities_.InternalSwap(&other->qualities_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + &codec_, lhs_arena, + &other->codec_, rhs_arena + ); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SubscribedCodec::GetMetadata() const { + return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( + &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, + file_level_metadata_livekit_5frtc_2eproto[23]); } // =================================================================== @@ -8021,7 +8627,8 @@ class SubscribedQualityUpdate::_Internal { SubscribedQualityUpdate::SubscribedQualityUpdate(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - subscribed_qualities_(arena) { + subscribed_qualities_(arena), + subscribed_codecs_(arena) { SharedCtor(); if (!is_message_owned) { RegisterArenaDtor(arena); @@ -8030,7 +8637,8 @@ SubscribedQualityUpdate::SubscribedQualityUpdate(::PROTOBUF_NAMESPACE_ID::Arena* } SubscribedQualityUpdate::SubscribedQualityUpdate(const SubscribedQualityUpdate& from) : ::PROTOBUF_NAMESPACE_ID::Message(), - subscribed_qualities_(from.subscribed_qualities_) { + subscribed_qualities_(from.subscribed_qualities_), + subscribed_codecs_(from.subscribed_codecs_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); track_sid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -8079,6 +8687,7 @@ void SubscribedQualityUpdate::Clear() { (void) cached_has_bits; subscribed_qualities_.Clear(); + subscribed_codecs_.Clear(); track_sid_.ClearToEmpty(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -8112,6 +8721,19 @@ const char* SubscribedQualityUpdate::_InternalParse(const char* ptr, ::PROTOBUF_ } else goto handle_unusual; continue; + // repeated .livekit.SubscribedCodec subscribed_codecs = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_subscribed_codecs(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -8159,6 +8781,14 @@ uint8_t* SubscribedQualityUpdate::_InternalSerialize( InternalWriteMessage(2, this->_internal_subscribed_qualities(i), target, stream); } + // repeated .livekit.SubscribedCodec subscribed_codecs = 3; + for (unsigned int i = 0, + n = static_cast(this->_internal_subscribed_codecs_size()); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, this->_internal_subscribed_codecs(i), target, stream); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -8182,6 +8812,13 @@ size_t SubscribedQualityUpdate::ByteSizeLong() const { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } + // repeated .livekit.SubscribedCodec subscribed_codecs = 3; + total_size += 1UL * this->_internal_subscribed_codecs_size(); + for (const auto& msg : this->subscribed_codecs_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + // string track_sid = 1; if (!this->_internal_track_sid().empty()) { total_size += 1 + @@ -8212,6 +8849,7 @@ void SubscribedQualityUpdate::MergeFrom(const SubscribedQualityUpdate& from) { (void) cached_has_bits; subscribed_qualities_.MergeFrom(from.subscribed_qualities_); + subscribed_codecs_.MergeFrom(from.subscribed_codecs_); if (!from._internal_track_sid().empty()) { _internal_set_track_sid(from._internal_track_sid()); } @@ -8235,6 +8873,7 @@ void SubscribedQualityUpdate::InternalSwap(SubscribedQualityUpdate* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); subscribed_qualities_.InternalSwap(&other->subscribed_qualities_); + subscribed_codecs_.InternalSwap(&other->subscribed_codecs_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), &track_sid_, lhs_arena, @@ -8245,7 +8884,7 @@ void SubscribedQualityUpdate::InternalSwap(SubscribedQualityUpdate* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SubscribedQualityUpdate::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[22]); + file_level_metadata_livekit_5frtc_2eproto[24]); } // =================================================================== @@ -8561,7 +9200,7 @@ void TrackPermission::InternalSwap(TrackPermission* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TrackPermission::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[23]); + file_level_metadata_livekit_5frtc_2eproto[25]); } // =================================================================== @@ -8772,7 +9411,7 @@ void SubscriptionPermission::InternalSwap(SubscriptionPermission* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SubscriptionPermission::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[24]); + file_level_metadata_livekit_5frtc_2eproto[26]); } // =================================================================== @@ -9050,7 +9689,7 @@ void SubscriptionPermissionUpdate::InternalSwap(SubscriptionPermissionUpdate* ot ::PROTOBUF_NAMESPACE_ID::Metadata SubscriptionPermissionUpdate::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[25]); + file_level_metadata_livekit_5frtc_2eproto[27]); } // =================================================================== @@ -9360,7 +9999,7 @@ void SyncState::InternalSwap(SyncState* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SyncState::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[26]); + file_level_metadata_livekit_5frtc_2eproto[28]); } // =================================================================== @@ -9626,7 +10265,7 @@ void DataChannelInfo::InternalSwap(DataChannelInfo* other) { ::PROTOBUF_NAMESPACE_ID::Metadata DataChannelInfo::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[27]); + file_level_metadata_livekit_5frtc_2eproto[29]); } // =================================================================== @@ -9936,7 +10575,7 @@ void SimulateScenario::InternalSwap(SimulateScenario* other) { ::PROTOBUF_NAMESPACE_ID::Metadata SimulateScenario::GetMetadata() const { return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( &descriptor_table_livekit_5frtc_2eproto_getter, &descriptor_table_livekit_5frtc_2eproto_once, - file_level_metadata_livekit_5frtc_2eproto[28]); + file_level_metadata_livekit_5frtc_2eproto[30]); } // @@protoc_insertion_point(namespace_scope) @@ -9948,6 +10587,9 @@ template<> PROTOBUF_NOINLINE ::livekit::SignalRequest* Arena::CreateMaybeMessage template<> PROTOBUF_NOINLINE ::livekit::SignalResponse* Arena::CreateMaybeMessage< ::livekit::SignalResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::livekit::SignalResponse >(arena); } +template<> PROTOBUF_NOINLINE ::livekit::SimulcastCodec* Arena::CreateMaybeMessage< ::livekit::SimulcastCodec >(Arena* arena) { + return Arena::CreateMessageInternal< ::livekit::SimulcastCodec >(arena); +} template<> PROTOBUF_NOINLINE ::livekit::AddTrackRequest* Arena::CreateMaybeMessage< ::livekit::AddTrackRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::livekit::AddTrackRequest >(arena); } @@ -10008,6 +10650,9 @@ template<> PROTOBUF_NOINLINE ::livekit::StreamStateUpdate* Arena::CreateMaybeMes template<> PROTOBUF_NOINLINE ::livekit::SubscribedQuality* Arena::CreateMaybeMessage< ::livekit::SubscribedQuality >(Arena* arena) { return Arena::CreateMessageInternal< ::livekit::SubscribedQuality >(arena); } +template<> PROTOBUF_NOINLINE ::livekit::SubscribedCodec* Arena::CreateMaybeMessage< ::livekit::SubscribedCodec >(Arena* arena) { + return Arena::CreateMessageInternal< ::livekit::SubscribedCodec >(arena); +} template<> PROTOBUF_NOINLINE ::livekit::SubscribedQualityUpdate* Arena::CreateMaybeMessage< ::livekit::SubscribedQualityUpdate >(Arena* arena) { return Arena::CreateMessageInternal< ::livekit::SubscribedQualityUpdate >(arena); } diff --git a/src/proto/livekit_rtc.pb.h b/src/proto/livekit_rtc.pb.h index 265e8f0..7dabe71 100644 --- a/src/proto/livekit_rtc.pb.h +++ b/src/proto/livekit_rtc.pb.h @@ -48,7 +48,7 @@ struct TableStruct_livekit_5frtc_2eproto { PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[29] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[31] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; @@ -98,6 +98,9 @@ extern SignalResponseDefaultTypeInternal _SignalResponse_default_instance_; class SimulateScenario; struct SimulateScenarioDefaultTypeInternal; extern SimulateScenarioDefaultTypeInternal _SimulateScenario_default_instance_; +class SimulcastCodec; +struct SimulcastCodecDefaultTypeInternal; +extern SimulcastCodecDefaultTypeInternal _SimulcastCodec_default_instance_; class SpeakersChanged; struct SpeakersChangedDefaultTypeInternal; extern SpeakersChangedDefaultTypeInternal _SpeakersChanged_default_instance_; @@ -107,6 +110,9 @@ extern StreamStateInfoDefaultTypeInternal _StreamStateInfo_default_instance_; class StreamStateUpdate; struct StreamStateUpdateDefaultTypeInternal; extern StreamStateUpdateDefaultTypeInternal _StreamStateUpdate_default_instance_; +class SubscribedCodec; +struct SubscribedCodecDefaultTypeInternal; +extern SubscribedCodecDefaultTypeInternal _SubscribedCodec_default_instance_; class SubscribedQuality; struct SubscribedQualityDefaultTypeInternal; extern SubscribedQualityDefaultTypeInternal _SubscribedQuality_default_instance_; @@ -159,9 +165,11 @@ template<> ::livekit::SessionDescription* Arena::CreateMaybeMessage<::livekit::S template<> ::livekit::SignalRequest* Arena::CreateMaybeMessage<::livekit::SignalRequest>(Arena*); template<> ::livekit::SignalResponse* Arena::CreateMaybeMessage<::livekit::SignalResponse>(Arena*); template<> ::livekit::SimulateScenario* Arena::CreateMaybeMessage<::livekit::SimulateScenario>(Arena*); +template<> ::livekit::SimulcastCodec* Arena::CreateMaybeMessage<::livekit::SimulcastCodec>(Arena*); template<> ::livekit::SpeakersChanged* Arena::CreateMaybeMessage<::livekit::SpeakersChanged>(Arena*); template<> ::livekit::StreamStateInfo* Arena::CreateMaybeMessage<::livekit::StreamStateInfo>(Arena*); template<> ::livekit::StreamStateUpdate* Arena::CreateMaybeMessage<::livekit::StreamStateUpdate>(Arena*); +template<> ::livekit::SubscribedCodec* Arena::CreateMaybeMessage<::livekit::SubscribedCodec>(Arena*); template<> ::livekit::SubscribedQuality* Arena::CreateMaybeMessage<::livekit::SubscribedQuality>(Arena*); template<> ::livekit::SubscribedQualityUpdate* Arena::CreateMaybeMessage<::livekit::SubscribedQualityUpdate>(Arena*); template<> ::livekit::SubscriptionPermission* Arena::CreateMaybeMessage<::livekit::SubscriptionPermission>(Arena*); @@ -1145,6 +1153,184 @@ class SignalResponse final : }; // ------------------------------------------------------------------- +class SimulcastCodec final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:livekit.SimulcastCodec) */ { + public: + inline SimulcastCodec() : SimulcastCodec(nullptr) {} + ~SimulcastCodec() override; + explicit constexpr SimulcastCodec(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + SimulcastCodec(const SimulcastCodec& from); + SimulcastCodec(SimulcastCodec&& from) noexcept + : SimulcastCodec() { + *this = ::std::move(from); + } + + inline SimulcastCodec& operator=(const SimulcastCodec& from) { + CopyFrom(from); + return *this; + } + inline SimulcastCodec& operator=(SimulcastCodec&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SimulcastCodec& default_instance() { + return *internal_default_instance(); + } + static inline const SimulcastCodec* internal_default_instance() { + return reinterpret_cast( + &_SimulcastCodec_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(SimulcastCodec& a, SimulcastCodec& b) { + a.Swap(&b); + } + inline void Swap(SimulcastCodec* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SimulcastCodec* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SimulcastCodec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const SimulcastCodec& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const SimulcastCodec& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SimulcastCodec* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "livekit.SimulcastCodec"; + } + protected: + explicit SimulcastCodec(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kCodecFieldNumber = 1, + kCidFieldNumber = 2, + kEnableSimulcastLayersFieldNumber = 3, + }; + // string codec = 1; + void clear_codec(); + const std::string& codec() const; + template + void set_codec(ArgT0&& arg0, ArgT... args); + std::string* mutable_codec(); + PROTOBUF_NODISCARD std::string* release_codec(); + void set_allocated_codec(std::string* codec); + private: + const std::string& _internal_codec() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_codec(const std::string& value); + std::string* _internal_mutable_codec(); + public: + + // string cid = 2; + void clear_cid(); + const std::string& cid() const; + template + void set_cid(ArgT0&& arg0, ArgT... args); + std::string* mutable_cid(); + PROTOBUF_NODISCARD std::string* release_cid(); + void set_allocated_cid(std::string* cid); + private: + const std::string& _internal_cid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_cid(const std::string& value); + std::string* _internal_mutable_cid(); + public: + + // bool enable_simulcast_layers = 3; + void clear_enable_simulcast_layers(); + bool enable_simulcast_layers() const; + void set_enable_simulcast_layers(bool value); + private: + bool _internal_enable_simulcast_layers() const; + void _internal_set_enable_simulcast_layers(bool value); + public: + + // @@protoc_insertion_point(class_scope:livekit.SimulcastCodec) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr codec_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr cid_; + bool enable_simulcast_layers_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_livekit_5frtc_2eproto; +}; +// ------------------------------------------------------------------- + class AddTrackRequest final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:livekit.AddTrackRequest) */ { public: @@ -1193,7 +1379,7 @@ class AddTrackRequest final : &_AddTrackRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 2; + 3; friend void swap(AddTrackRequest& a, AddTrackRequest& b) { a.Swap(&b); @@ -1268,6 +1454,7 @@ class AddTrackRequest final : enum : int { kLayersFieldNumber = 9, + kSimulcastCodecsFieldNumber = 10, kCidFieldNumber = 1, kNameFieldNumber = 2, kTypeFieldNumber = 3, @@ -1295,6 +1482,24 @@ class AddTrackRequest final : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer >& layers() const; + // repeated .livekit.SimulcastCodec simulcast_codecs = 10; + int simulcast_codecs_size() const; + private: + int _internal_simulcast_codecs_size() const; + public: + void clear_simulcast_codecs(); + ::livekit::SimulcastCodec* mutable_simulcast_codecs(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodec >* + mutable_simulcast_codecs(); + private: + const ::livekit::SimulcastCodec& _internal_simulcast_codecs(int index) const; + ::livekit::SimulcastCodec* _internal_add_simulcast_codecs(); + public: + const ::livekit::SimulcastCodec& simulcast_codecs(int index) const; + ::livekit::SimulcastCodec* add_simulcast_codecs(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodec >& + simulcast_codecs() const; + // string cid = 1; void clear_cid(); const std::string& cid() const; @@ -1385,6 +1590,7 @@ class AddTrackRequest final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::VideoLayer > layers_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodec > simulcast_codecs_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr cid_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; int type_; @@ -1446,7 +1652,7 @@ class TrickleRequest final : &_TrickleRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 4; friend void swap(TrickleRequest& a, TrickleRequest& b) { a.Swap(&b); @@ -1608,7 +1814,7 @@ class MuteTrackRequest final : &_MuteTrackRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 5; friend void swap(MuteTrackRequest& a, MuteTrackRequest& b) { a.Swap(&b); @@ -1770,7 +1976,7 @@ class JoinResponse final : &_JoinResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 6; friend void swap(JoinResponse& a, JoinResponse& b) { a.Swap(&b); @@ -2064,7 +2270,7 @@ class TrackPublishedResponse final : &_TrackPublishedResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 7; friend void swap(TrackPublishedResponse& a, TrackPublishedResponse& b) { a.Swap(&b); @@ -2235,7 +2441,7 @@ class TrackUnpublishedResponse final : &_TrackUnpublishedResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 8; friend void swap(TrackUnpublishedResponse& a, TrackUnpublishedResponse& b) { a.Swap(&b); @@ -2386,7 +2592,7 @@ class SessionDescription final : &_SessionDescription_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 9; friend void swap(SessionDescription& a, SessionDescription& b) { a.Swap(&b); @@ -2553,7 +2759,7 @@ class ParticipantUpdate final : &_ParticipantUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 10; friend void swap(ParticipantUpdate& a, ParticipantUpdate& b) { a.Swap(&b); @@ -2708,7 +2914,7 @@ class UpdateSubscription final : &_UpdateSubscription_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 11; friend void swap(UpdateSubscription& a, UpdateSubscription& b) { a.Swap(&b); @@ -2900,7 +3106,7 @@ class UpdateTrackSettings final : &_UpdateTrackSettings_default_instance_); } static constexpr int kIndexInFileMessages = - 11; + 12; friend void swap(UpdateTrackSettings& a, UpdateTrackSettings& b) { a.Swap(&b); @@ -3105,7 +3311,7 @@ class LeaveRequest final : &_LeaveRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 13; friend void swap(LeaveRequest& a, LeaveRequest& b) { a.Swap(&b); @@ -3251,7 +3457,7 @@ class UpdateVideoLayers final : &_UpdateVideoLayers_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 14; friend void swap(UpdateVideoLayers& a, UpdateVideoLayers& b) { a.Swap(&b); @@ -3422,7 +3628,7 @@ class ICEServer final : &_ICEServer_default_instance_); } static constexpr int kIndexInFileMessages = - 14; + 15; friend void swap(ICEServer& a, ICEServer& b) { a.Swap(&b); @@ -3615,7 +3821,7 @@ class SpeakersChanged final : &_SpeakersChanged_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 16; friend void swap(SpeakersChanged& a, SpeakersChanged& b) { a.Swap(&b); @@ -3770,7 +3976,7 @@ class RoomUpdate final : &_RoomUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 17; friend void swap(RoomUpdate& a, RoomUpdate& b) { a.Swap(&b); @@ -3925,7 +4131,7 @@ class ConnectionQualityInfo final : &_ConnectionQualityInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 18; friend void swap(ConnectionQualityInfo& a, ConnectionQualityInfo& b) { a.Swap(&b); @@ -4098,7 +4304,7 @@ class ConnectionQualityUpdate final : &_ConnectionQualityUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 19; friend void swap(ConnectionQualityUpdate& a, ConnectionQualityUpdate& b) { a.Swap(&b); @@ -4253,7 +4459,7 @@ class StreamStateInfo final : &_StreamStateInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 20; friend void swap(StreamStateInfo& a, StreamStateInfo& b) { a.Swap(&b); @@ -4431,7 +4637,7 @@ class StreamStateUpdate final : &_StreamStateUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 20; + 21; friend void swap(StreamStateUpdate& a, StreamStateUpdate& b) { a.Swap(&b); @@ -4586,7 +4792,7 @@ class SubscribedQuality final : &_SubscribedQuality_default_instance_); } static constexpr int kIndexInFileMessages = - 21; + 22; friend void swap(SubscribedQuality& a, SubscribedQuality& b) { a.Swap(&b); @@ -4695,6 +4901,177 @@ class SubscribedQuality final : }; // ------------------------------------------------------------------- +class SubscribedCodec final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:livekit.SubscribedCodec) */ { + public: + inline SubscribedCodec() : SubscribedCodec(nullptr) {} + ~SubscribedCodec() override; + explicit constexpr SubscribedCodec(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + SubscribedCodec(const SubscribedCodec& from); + SubscribedCodec(SubscribedCodec&& from) noexcept + : SubscribedCodec() { + *this = ::std::move(from); + } + + inline SubscribedCodec& operator=(const SubscribedCodec& from) { + CopyFrom(from); + return *this; + } + inline SubscribedCodec& operator=(SubscribedCodec&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SubscribedCodec& default_instance() { + return *internal_default_instance(); + } + static inline const SubscribedCodec* internal_default_instance() { + return reinterpret_cast( + &_SubscribedCodec_default_instance_); + } + static constexpr int kIndexInFileMessages = + 23; + + friend void swap(SubscribedCodec& a, SubscribedCodec& b) { + a.Swap(&b); + } + inline void Swap(SubscribedCodec* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SubscribedCodec* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SubscribedCodec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const SubscribedCodec& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom(const SubscribedCodec& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SubscribedCodec* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "livekit.SubscribedCodec"; + } + protected: + explicit SubscribedCodec(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kQualitiesFieldNumber = 2, + kCodecFieldNumber = 1, + }; + // repeated .livekit.SubscribedQuality qualities = 2; + int qualities_size() const; + private: + int _internal_qualities_size() const; + public: + void clear_qualities(); + ::livekit::SubscribedQuality* mutable_qualities(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedQuality >* + mutable_qualities(); + private: + const ::livekit::SubscribedQuality& _internal_qualities(int index) const; + ::livekit::SubscribedQuality* _internal_add_qualities(); + public: + const ::livekit::SubscribedQuality& qualities(int index) const; + ::livekit::SubscribedQuality* add_qualities(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedQuality >& + qualities() const; + + // string codec = 1; + void clear_codec(); + const std::string& codec() const; + template + void set_codec(ArgT0&& arg0, ArgT... args); + std::string* mutable_codec(); + PROTOBUF_NODISCARD std::string* release_codec(); + void set_allocated_codec(std::string* codec); + private: + const std::string& _internal_codec() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_codec(const std::string& value); + std::string* _internal_mutable_codec(); + public: + + // @@protoc_insertion_point(class_scope:livekit.SubscribedCodec) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedQuality > qualities_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr codec_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_livekit_5frtc_2eproto; +}; +// ------------------------------------------------------------------- + class SubscribedQualityUpdate final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:livekit.SubscribedQualityUpdate) */ { public: @@ -4743,7 +5120,7 @@ class SubscribedQualityUpdate final : &_SubscribedQualityUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 22; + 24; friend void swap(SubscribedQualityUpdate& a, SubscribedQualityUpdate& b) { a.Swap(&b); @@ -4818,6 +5195,7 @@ class SubscribedQualityUpdate final : enum : int { kSubscribedQualitiesFieldNumber = 2, + kSubscribedCodecsFieldNumber = 3, kTrackSidFieldNumber = 1, }; // repeated .livekit.SubscribedQuality subscribed_qualities = 2; @@ -4838,6 +5216,24 @@ class SubscribedQualityUpdate final : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedQuality >& subscribed_qualities() const; + // repeated .livekit.SubscribedCodec subscribed_codecs = 3; + int subscribed_codecs_size() const; + private: + int _internal_subscribed_codecs_size() const; + public: + void clear_subscribed_codecs(); + ::livekit::SubscribedCodec* mutable_subscribed_codecs(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedCodec >* + mutable_subscribed_codecs(); + private: + const ::livekit::SubscribedCodec& _internal_subscribed_codecs(int index) const; + ::livekit::SubscribedCodec* _internal_add_subscribed_codecs(); + public: + const ::livekit::SubscribedCodec& subscribed_codecs(int index) const; + ::livekit::SubscribedCodec* add_subscribed_codecs(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedCodec >& + subscribed_codecs() const; + // string track_sid = 1; void clear_track_sid(); const std::string& track_sid() const; @@ -4860,6 +5256,7 @@ class SubscribedQualityUpdate final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedQuality > subscribed_qualities_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedCodec > subscribed_codecs_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr track_sid_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_livekit_5frtc_2eproto; @@ -4914,7 +5311,7 @@ class TrackPermission final : &_TrackPermission_default_instance_); } static constexpr int kIndexInFileMessages = - 23; + 25; friend void swap(TrackPermission& a, TrackPermission& b) { a.Swap(&b); @@ -5118,7 +5515,7 @@ class SubscriptionPermission final : &_SubscriptionPermission_default_instance_); } static constexpr int kIndexInFileMessages = - 24; + 26; friend void swap(SubscriptionPermission& a, SubscriptionPermission& b) { a.Swap(&b); @@ -5284,7 +5681,7 @@ class SubscriptionPermissionUpdate final : &_SubscriptionPermissionUpdate_default_instance_); } static constexpr int kIndexInFileMessages = - 25; + 27; friend void swap(SubscriptionPermissionUpdate& a, SubscriptionPermissionUpdate& b) { a.Swap(&b); @@ -5462,7 +5859,7 @@ class SyncState final : &_SyncState_default_instance_); } static constexpr int kIndexInFileMessages = - 26; + 28; friend void swap(SyncState& a, SyncState& b) { a.Swap(&b); @@ -5677,7 +6074,7 @@ class DataChannelInfo final : &_DataChannelInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 27; + 29; friend void swap(DataChannelInfo& a, DataChannelInfo& b) { a.Swap(&b); @@ -5858,7 +6255,7 @@ class SimulateScenario final : &_SimulateScenario_default_instance_); } static constexpr int kIndexInFileMessages = - 28; + 30; friend void swap(SimulateScenario& a, SimulateScenario& b) { a.Swap(&b); @@ -8133,6 +8530,132 @@ inline SignalResponse::MessageCase SignalResponse::message_case() const { } // ------------------------------------------------------------------- +// SimulcastCodec + +// string codec = 1; +inline void SimulcastCodec::clear_codec() { + codec_.ClearToEmpty(); +} +inline const std::string& SimulcastCodec::codec() const { + // @@protoc_insertion_point(field_get:livekit.SimulcastCodec.codec) + return _internal_codec(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SimulcastCodec::set_codec(ArgT0&& arg0, ArgT... args) { + + codec_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:livekit.SimulcastCodec.codec) +} +inline std::string* SimulcastCodec::mutable_codec() { + std::string* _s = _internal_mutable_codec(); + // @@protoc_insertion_point(field_mutable:livekit.SimulcastCodec.codec) + return _s; +} +inline const std::string& SimulcastCodec::_internal_codec() const { + return codec_.Get(); +} +inline void SimulcastCodec::_internal_set_codec(const std::string& value) { + + codec_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); +} +inline std::string* SimulcastCodec::_internal_mutable_codec() { + + return codec_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); +} +inline std::string* SimulcastCodec::release_codec() { + // @@protoc_insertion_point(field_release:livekit.SimulcastCodec.codec) + return codec_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); +} +inline void SimulcastCodec::set_allocated_codec(std::string* codec) { + if (codec != nullptr) { + + } else { + + } + codec_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), codec, + GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (codec_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { + codec_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:livekit.SimulcastCodec.codec) +} + +// string cid = 2; +inline void SimulcastCodec::clear_cid() { + cid_.ClearToEmpty(); +} +inline const std::string& SimulcastCodec::cid() const { + // @@protoc_insertion_point(field_get:livekit.SimulcastCodec.cid) + return _internal_cid(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SimulcastCodec::set_cid(ArgT0&& arg0, ArgT... args) { + + cid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:livekit.SimulcastCodec.cid) +} +inline std::string* SimulcastCodec::mutable_cid() { + std::string* _s = _internal_mutable_cid(); + // @@protoc_insertion_point(field_mutable:livekit.SimulcastCodec.cid) + return _s; +} +inline const std::string& SimulcastCodec::_internal_cid() const { + return cid_.Get(); +} +inline void SimulcastCodec::_internal_set_cid(const std::string& value) { + + cid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); +} +inline std::string* SimulcastCodec::_internal_mutable_cid() { + + return cid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); +} +inline std::string* SimulcastCodec::release_cid() { + // @@protoc_insertion_point(field_release:livekit.SimulcastCodec.cid) + return cid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); +} +inline void SimulcastCodec::set_allocated_cid(std::string* cid) { + if (cid != nullptr) { + + } else { + + } + cid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), cid, + GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (cid_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { + cid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:livekit.SimulcastCodec.cid) +} + +// bool enable_simulcast_layers = 3; +inline void SimulcastCodec::clear_enable_simulcast_layers() { + enable_simulcast_layers_ = false; +} +inline bool SimulcastCodec::_internal_enable_simulcast_layers() const { + return enable_simulcast_layers_; +} +inline bool SimulcastCodec::enable_simulcast_layers() const { + // @@protoc_insertion_point(field_get:livekit.SimulcastCodec.enable_simulcast_layers) + return _internal_enable_simulcast_layers(); +} +inline void SimulcastCodec::_internal_set_enable_simulcast_layers(bool value) { + + enable_simulcast_layers_ = value; +} +inline void SimulcastCodec::set_enable_simulcast_layers(bool value) { + _internal_set_enable_simulcast_layers(value); + // @@protoc_insertion_point(field_set:livekit.SimulcastCodec.enable_simulcast_layers) +} + +// ------------------------------------------------------------------- + // AddTrackRequest // string cid = 1; @@ -8394,6 +8917,46 @@ AddTrackRequest::layers() const { return layers_; } +// repeated .livekit.SimulcastCodec simulcast_codecs = 10; +inline int AddTrackRequest::_internal_simulcast_codecs_size() const { + return simulcast_codecs_.size(); +} +inline int AddTrackRequest::simulcast_codecs_size() const { + return _internal_simulcast_codecs_size(); +} +inline void AddTrackRequest::clear_simulcast_codecs() { + simulcast_codecs_.Clear(); +} +inline ::livekit::SimulcastCodec* AddTrackRequest::mutable_simulcast_codecs(int index) { + // @@protoc_insertion_point(field_mutable:livekit.AddTrackRequest.simulcast_codecs) + return simulcast_codecs_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodec >* +AddTrackRequest::mutable_simulcast_codecs() { + // @@protoc_insertion_point(field_mutable_list:livekit.AddTrackRequest.simulcast_codecs) + return &simulcast_codecs_; +} +inline const ::livekit::SimulcastCodec& AddTrackRequest::_internal_simulcast_codecs(int index) const { + return simulcast_codecs_.Get(index); +} +inline const ::livekit::SimulcastCodec& AddTrackRequest::simulcast_codecs(int index) const { + // @@protoc_insertion_point(field_get:livekit.AddTrackRequest.simulcast_codecs) + return _internal_simulcast_codecs(index); +} +inline ::livekit::SimulcastCodec* AddTrackRequest::_internal_add_simulcast_codecs() { + return simulcast_codecs_.Add(); +} +inline ::livekit::SimulcastCodec* AddTrackRequest::add_simulcast_codecs() { + ::livekit::SimulcastCodec* _add = _internal_add_simulcast_codecs(); + // @@protoc_insertion_point(field_add:livekit.AddTrackRequest.simulcast_codecs) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SimulcastCodec >& +AddTrackRequest::simulcast_codecs() const { + // @@protoc_insertion_point(field_list:livekit.AddTrackRequest.simulcast_codecs) + return simulcast_codecs_; +} + // ------------------------------------------------------------------- // TrickleRequest @@ -10477,6 +11040,101 @@ inline void SubscribedQuality::set_enabled(bool value) { // ------------------------------------------------------------------- +// SubscribedCodec + +// string codec = 1; +inline void SubscribedCodec::clear_codec() { + codec_.ClearToEmpty(); +} +inline const std::string& SubscribedCodec::codec() const { + // @@protoc_insertion_point(field_get:livekit.SubscribedCodec.codec) + return _internal_codec(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SubscribedCodec::set_codec(ArgT0&& arg0, ArgT... args) { + + codec_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:livekit.SubscribedCodec.codec) +} +inline std::string* SubscribedCodec::mutable_codec() { + std::string* _s = _internal_mutable_codec(); + // @@protoc_insertion_point(field_mutable:livekit.SubscribedCodec.codec) + return _s; +} +inline const std::string& SubscribedCodec::_internal_codec() const { + return codec_.Get(); +} +inline void SubscribedCodec::_internal_set_codec(const std::string& value) { + + codec_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); +} +inline std::string* SubscribedCodec::_internal_mutable_codec() { + + return codec_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); +} +inline std::string* SubscribedCodec::release_codec() { + // @@protoc_insertion_point(field_release:livekit.SubscribedCodec.codec) + return codec_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); +} +inline void SubscribedCodec::set_allocated_codec(std::string* codec) { + if (codec != nullptr) { + + } else { + + } + codec_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), codec, + GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (codec_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { + codec_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:livekit.SubscribedCodec.codec) +} + +// repeated .livekit.SubscribedQuality qualities = 2; +inline int SubscribedCodec::_internal_qualities_size() const { + return qualities_.size(); +} +inline int SubscribedCodec::qualities_size() const { + return _internal_qualities_size(); +} +inline void SubscribedCodec::clear_qualities() { + qualities_.Clear(); +} +inline ::livekit::SubscribedQuality* SubscribedCodec::mutable_qualities(int index) { + // @@protoc_insertion_point(field_mutable:livekit.SubscribedCodec.qualities) + return qualities_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedQuality >* +SubscribedCodec::mutable_qualities() { + // @@protoc_insertion_point(field_mutable_list:livekit.SubscribedCodec.qualities) + return &qualities_; +} +inline const ::livekit::SubscribedQuality& SubscribedCodec::_internal_qualities(int index) const { + return qualities_.Get(index); +} +inline const ::livekit::SubscribedQuality& SubscribedCodec::qualities(int index) const { + // @@protoc_insertion_point(field_get:livekit.SubscribedCodec.qualities) + return _internal_qualities(index); +} +inline ::livekit::SubscribedQuality* SubscribedCodec::_internal_add_qualities() { + return qualities_.Add(); +} +inline ::livekit::SubscribedQuality* SubscribedCodec::add_qualities() { + ::livekit::SubscribedQuality* _add = _internal_add_qualities(); + // @@protoc_insertion_point(field_add:livekit.SubscribedCodec.qualities) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedQuality >& +SubscribedCodec::qualities() const { + // @@protoc_insertion_point(field_list:livekit.SubscribedCodec.qualities) + return qualities_; +} + +// ------------------------------------------------------------------- + // SubscribedQualityUpdate // string track_sid = 1; @@ -10570,6 +11228,46 @@ SubscribedQualityUpdate::subscribed_qualities() const { return subscribed_qualities_; } +// repeated .livekit.SubscribedCodec subscribed_codecs = 3; +inline int SubscribedQualityUpdate::_internal_subscribed_codecs_size() const { + return subscribed_codecs_.size(); +} +inline int SubscribedQualityUpdate::subscribed_codecs_size() const { + return _internal_subscribed_codecs_size(); +} +inline void SubscribedQualityUpdate::clear_subscribed_codecs() { + subscribed_codecs_.Clear(); +} +inline ::livekit::SubscribedCodec* SubscribedQualityUpdate::mutable_subscribed_codecs(int index) { + // @@protoc_insertion_point(field_mutable:livekit.SubscribedQualityUpdate.subscribed_codecs) + return subscribed_codecs_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedCodec >* +SubscribedQualityUpdate::mutable_subscribed_codecs() { + // @@protoc_insertion_point(field_mutable_list:livekit.SubscribedQualityUpdate.subscribed_codecs) + return &subscribed_codecs_; +} +inline const ::livekit::SubscribedCodec& SubscribedQualityUpdate::_internal_subscribed_codecs(int index) const { + return subscribed_codecs_.Get(index); +} +inline const ::livekit::SubscribedCodec& SubscribedQualityUpdate::subscribed_codecs(int index) const { + // @@protoc_insertion_point(field_get:livekit.SubscribedQualityUpdate.subscribed_codecs) + return _internal_subscribed_codecs(index); +} +inline ::livekit::SubscribedCodec* SubscribedQualityUpdate::_internal_add_subscribed_codecs() { + return subscribed_codecs_.Add(); +} +inline ::livekit::SubscribedCodec* SubscribedQualityUpdate::add_subscribed_codecs() { + ::livekit::SubscribedCodec* _add = _internal_add_subscribed_codecs(); + // @@protoc_insertion_point(field_add:livekit.SubscribedQualityUpdate.subscribed_codecs) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::livekit::SubscribedCodec >& +SubscribedQualityUpdate::subscribed_codecs() const { + // @@protoc_insertion_point(field_list:livekit.SubscribedQualityUpdate.subscribed_codecs) + return subscribed_codecs_; +} + // ------------------------------------------------------------------- // TrackPermission @@ -11544,6 +12242,10 @@ inline SimulateScenario::ScenarioCase SimulateScenario::scenario_case() const { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/src/rtc_engine.cpp b/src/rtc_engine.cpp index 6b5657b..e0bd90d 100644 --- a/src/rtc_engine.cpp +++ b/src/rtc_engine.cpp @@ -5,6 +5,7 @@ #include "rtc_engine.h" #include #include +#include "peer_transport.h" namespace livekit{ @@ -19,13 +20,13 @@ namespace livekit{ void RTCEngine::Update(){ client_.update(); - // Fetch SignalResponse ( The whole protocol is async ) auto res = client_.poll(); if(res.has_join()) OnJoin(res.join()); } void RTCEngine::OnJoin(const JoinResponse &res){ + spdlog::info("OnJoin"); rtc::InitializeSSL(); for(auto& is : res.ice_servers()){ @@ -60,25 +61,11 @@ namespace livekit{ subscriber_ = std::make_unique(*this); publisher_ = std::make_unique(*this); - - } void RTCEngine::Configure() { } - RTCEngine::PeerTransport::PeerTransport(const RTCEngine &rtc_engine) { - observer = std::make_unique(); - webrtc::PeerConnectionDependencies peer_configuration{observer.get()}; - webrtc::RTCErrorOr> opt_peer = rtc_engine.peer_factory_->CreatePeerConnectionOrError( - rtc_engine.configuration_, std::move(peer_configuration)); - - if (!opt_peer.ok()) { - throw std::runtime_error{"Failed to create a peer connection"}; - } - - peer_connection = opt_peer.value(); - } } // livekit diff --git a/src/rtc_engine.h b/src/rtc_engine.h index 4f1b690..e2fcbaf 100644 --- a/src/rtc_engine.h +++ b/src/rtc_engine.h @@ -7,6 +7,7 @@ #include "signal_client.h" #include "peer_observer.h" +#include "peer_transport.h" #include namespace livekit{ @@ -24,14 +25,7 @@ namespace livekit{ void OnJoin(const JoinResponse &res); private: - // Wrapper for our PeerConnection ( Int. Impl. ) - class PeerTransport { - public: - explicit PeerTransport(const RTCEngine &rtc_engine); - - rtc::scoped_refptr peer_connection; - std::unique_ptr observer; - }; + friend class PeerTransport; SignalClient client_; diff --git a/src/signal_client.cpp b/src/signal_client.cpp index 26020a2..4b4d7f4 100644 --- a/src/signal_client.cpp +++ b/src/signal_client.cpp @@ -8,7 +8,7 @@ namespace livekit { - SignalClient::SignalClient() : m_Connected(false), m_Writing(false), m_Reading(false) { + SignalClient::SignalClient() : connected_(false), writing_(false), reading_(false) { } @@ -17,79 +17,80 @@ namespace livekit { } void SignalClient::Connect(const std::string &url, const std::string &token) { - if (m_Connected) + if (connected_) throw std::runtime_error{"already connected"}; - m_URL = ParseURL(url); - m_Token = token; + url_ = ParseURL(url); + token_ = token; start(); // We don't need a thread, everything is async ( + easier to maintain ) } void SignalClient::update() { beast::error_code ec; - m_IOContext.poll(ec); + io_context_.poll(ec); if (ec) throw std::runtime_error{"SignalClient::Update - " + ec.message()}; - if (m_Connected) { - if (!m_WebSocket.is_open()) + if (connected_) { + if (!websocket_.is_open()) throw std::runtime_error{"Websocket isn't open"}; // TODO Start reconnect - if (!m_Reading) { - m_WebSocket.async_read(m_ReadBuffer, beast::bind_front_handler(&SignalClient::OnRead, this)); - m_Reading = true; + if (!reading_) { + websocket_.async_read(read_buffer_, beast::bind_front_handler(&SignalClient::OnRead, this)); + reading_ = true; } // Write pending messages - if (!m_Writing && !m_WriteQueue.empty()) { - auto req = m_WriteQueue.front(); + if (!writing_ && !write_queue_.empty()) { + auto req = write_queue_.front(); unsigned long len = req.ByteSizeLong(); uint8_t data[len]; req.SerializeToArray(data, len); - m_WebSocket.async_write(net::buffer(&data, len), + websocket_.async_write(net::buffer(&data, len), beast::bind_front_handler(&SignalClient::OnWrite, this)); - m_WriteQueue.pop(); - m_Writing = true; + write_queue_.pop(); + writing_ = true; } } } SignalResponse SignalClient::poll(){ + if(read_queue_.empty()) + return SignalResponse{}; - - auto& r = m_ReadQueue.front(); - m_ReadQueue.pop(); + auto r = read_queue_.front(); + read_queue_.pop(); return r; } void SignalClient::start() { - m_Resolver.async_resolve(m_URL.host, m_URL.port, beast::bind_front_handler(&SignalClient::OnResolve, this)); + resolver_.async_resolve(url_.host, url_.port, beast::bind_front_handler(&SignalClient::OnResolve, this)); } void SignalClient::Disconnect() { - if (!m_Connected) + if (!connected_) return; - m_Connected = false; - m_Work.reset(); + connected_ = false; + work_guard_.reset(); //m_IOContext.stop(); - m_WebSocket.close(websocket::close_code::normal); // TODO Close should be async + websocket_.close(websocket::close_code::normal); // TODO Close should be async } void SignalClient::Send(SignalRequest req) { - m_WriteQueue.emplace(req); + write_queue_.emplace(req); } void SignalClient::OnResolve(beast::error_code ec, tcp::resolver::results_type results) { if (ec) throw std::runtime_error{"SignalClient::OnResolve - " + ec.message()}; - auto &layer = beast::get_lowest_layer(m_WebSocket); + auto &layer = beast::get_lowest_layer(websocket_); layer.expires_after(std::chrono::seconds(15)); layer.async_connect(results, beast::bind_front_handler(&SignalClient::OnConnect, this)); } @@ -98,10 +99,10 @@ namespace livekit { if (ec) throw std::runtime_error{"SignalClient::OnConnect - " + ec.message()}; - beast::get_lowest_layer(m_WebSocket).expires_never(); - m_WebSocket.set_option(websocket::stream_base::timeout::suggested(beast::role_type::client)); + beast::get_lowest_layer(websocket_).expires_never(); + websocket_.set_option(websocket::stream_base::timeout::suggested(beast::role_type::client)); - m_WebSocket.async_handshake(m_URL.host, "/rtc?access_token=" + m_Token + "&protocol=7", + websocket_.async_handshake(url_.host, "/rtc?access_token=" + token_ + "&protocol=7", beast::bind_front_handler(&SignalClient::OnHandshake, this)); } @@ -110,28 +111,29 @@ namespace livekit { throw std::runtime_error{ "SignalClient::OnHandshake - " + ec.message()}; // TODO Callback for handling errors - m_Connected = true; + connected_ = true; spdlog::info("Connected to Websocket"); } void SignalClient::OnRead(beast::error_code ec, std::size_t bytesTransferred) { - m_Reading = false; + reading_ = false; if (ec) throw std::runtime_error{"SignalClient::OnRead - " + ec.message()}; SignalResponse res{}; - if (res.ParseFromArray(m_ReadBuffer.cdata().data(), bytesTransferred)) { - m_ReadQueue.emplace(res); + if (res.ParseFromArray(read_buffer_.cdata().data(), bytesTransferred)) { + spdlog::info("Received SignalResponse {}", bytesTransferred); + read_queue_.emplace(res); } else { spdlog::error("Failed to decode signal message"); } - m_ReadBuffer.clear(); + read_buffer_.clear(); } void SignalClient::OnWrite(beast::error_code ec, std::size_t bytesTransferred) { - m_Writing = false; + writing_ = false; if (ec) throw std::runtime_error{"SignalClient::OnWrite - " + ec.message()}; diff --git a/src/signal_client.h b/src/signal_client.h index 855d46b..bed8bec 100644 --- a/src/signal_client.h +++ b/src/signal_client.h @@ -42,23 +42,23 @@ namespace livekit { void OnWrite(beast::error_code ec, std::size_t bytesTransferred); private: - URL m_URL; - std::string m_Token; + URL url_; + std::string token_; - std::queue m_ReadQueue; - std::queue m_WriteQueue; - bool m_Connected; - bool m_Reading, m_Writing; + std::queue read_queue_; + std::queue write_queue_; + bool connected_; + bool reading_, writing_; - beast::flat_buffer m_WriteBuffer; - beast::flat_buffer m_ReadBuffer; + beast::flat_buffer write_buffer_; + beast::flat_buffer read_buffer_; // Keep order - net::io_context m_IOContext; - net::executor_work_guard m_Work = net::make_work_guard( - m_IOContext); // Prevent the IOContext from running out of work - tcp::resolver m_Resolver{m_IOContext}; - websocket::stream m_WebSocket{m_IOContext}; + net::io_context io_context_; + net::executor_work_guard work_guard_ = net::make_work_guard( + io_context_); // Prevent the IOContext from running out of work + tcp::resolver resolver_{io_context_}; + websocket::stream websocket_{io_context_}; }; } // livekit