diff options
author | trilene <trilene@runbox.com> | 2021-02-18 15:55:29 -0500 |
---|---|---|
committer | trilene <trilene@runbox.com> | 2021-02-18 15:55:29 -0500 |
commit | 8df10eeecac15ddb45ed4e350d33814ac4690f89 (patch) | |
tree | 3fbc9f2041926417b453eec6ba559b813904367e /src/WebRTCSession.h | |
parent | Translated using Weblate (Hungarian) (diff) | |
download | nheko-8df10eeecac15ddb45ed4e350d33814ac4690f89.tar.xz |
Support desktop screen sharing on X11
Diffstat (limited to 'src/WebRTCSession.h')
-rw-r--r-- | src/WebRTCSession.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/WebRTCSession.h b/src/WebRTCSession.h index 0fe8a864..64eac706 100644 --- a/src/WebRTCSession.h +++ b/src/WebRTCSession.h @@ -5,15 +5,23 @@ #include <QObject> -#include "CallDevices.h" #include "mtx/events/voip.hpp" typedef struct _GstElement GstElement; +class CallDevices; class QQuickItem; namespace webrtc { Q_NAMESPACE +enum class CallType +{ + VOICE, + VIDEO, + SCREEN // localUser is sharing screen +}; +Q_ENUM_NS(CallType) + enum class State { DISCONNECTED, @@ -42,13 +50,14 @@ public: } bool havePlugins(bool isVideo, std::string *errorMessage = nullptr); + webrtc::CallType callType() const { return callType_; } webrtc::State state() const { return state_; } - bool isVideo() const { return isVideo_; } - bool haveLocalVideo() const; + bool haveLocalCamera() const; bool isOffering() const { return isOffering_; } bool isRemoteVideoRecvOnly() const { return isRemoteVideoRecvOnly_; } + bool isRemoteVideoSendOnly() const { return isRemoteVideoSendOnly_; } - bool createOffer(bool isVideo); + bool createOffer(webrtc::CallType); bool acceptOffer(const std::string &sdp); bool acceptAnswer(const std::string &sdp); void acceptICECandidates(const std::vector<mtx::events::msg::CallCandidates::Candidate> &); @@ -81,10 +90,11 @@ private: bool initialised_ = false; bool haveVoicePlugins_ = false; bool haveVideoPlugins_ = false; + webrtc::CallType callType_ = webrtc::CallType::VOICE; webrtc::State state_ = webrtc::State::DISCONNECTED; - bool isVideo_ = false; bool isOffering_ = false; bool isRemoteVideoRecvOnly_ = false; + bool isRemoteVideoSendOnly_ = false; QQuickItem *videoItem_ = nullptr; GstElement *pipe_ = nullptr; GstElement *webrtc_ = nullptr; |