#ifndef TGCALLS_SIGNALING_H #define TGCALLS_SIGNALING_H #include #include #include "absl/types/variant.h" #include "absl/types/optional.h" #include "api/rtp_parameters.h" namespace tgcalls { namespace signaling { struct DtlsFingerprint { std::string hash; std::string setup; std::string fingerprint; }; struct ConnectionAddress { std::string ip; int port = 0; }; struct IceCandidate { std::string sdpString; }; struct SsrcGroup { std::vector ssrcs; std::string semantics; }; struct FeedbackType { std::string type; std::string subtype; }; struct PayloadType { uint32_t id = 0; std::string name; uint32_t clockrate = 0; uint32_t channels = 0; std::vector feedbackTypes; std::vector> parameters; }; struct MediaContent { uint32_t ssrc = 0; std::vector ssrcGroups; std::vector payloadTypes; std::vector rtpExtensions; }; struct InitialSetupMessage { std::string ufrag; std::string pwd; std::vector fingerprints; absl::optional audio; absl::optional video; absl::optional screencast; }; struct CandidatesMessage { std::vector iceCandidates; }; struct MediaStateMessage { enum class VideoState { Inactive, Suspended, Active }; enum class VideoRotation { Rotation0, Rotation90, Rotation180, Rotation270 }; bool isMuted = false; VideoState videoState = VideoState::Inactive; VideoRotation videoRotation = VideoRotation::Rotation0; VideoState screencastState = VideoState::Inactive; bool isBatteryLow = false; }; struct Message { absl::variant< InitialSetupMessage, CandidatesMessage, MediaStateMessage> data; std::vector serialize() const; static absl::optional parse(const std::vector &data); }; }; } // namespace tgcalls #endif