Skip to content
Snippets Groups Projects
Commit 459c5990 authored by trilene's avatar trilene Committed by Nicolas Werner
Browse files

Fix one-way video calls

parent 71240249
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,7 @@ Rectangle {
}
ImageButton {
visible: CallManager.isVideo
visible: CallManager.haveLocalVideo
width: 24
height: 24
buttonTextColor: "#000000"
......
......@@ -25,6 +25,7 @@ class CallManager : public QObject
Q_PROPERTY(bool haveCallInvite READ haveCallInvite NOTIFY newInviteState)
Q_PROPERTY(bool isOnCall READ isOnCall NOTIFY newCallState)
Q_PROPERTY(bool isVideo READ isVideo NOTIFY newInviteState)
Q_PROPERTY(bool haveLocalVideo READ haveLocalVideo NOTIFY newCallState)
Q_PROPERTY(webrtc::State callState READ callState NOTIFY newCallState)
Q_PROPERTY(QString callParty READ callParty NOTIFY newInviteState)
Q_PROPERTY(QString callPartyAvatarUrl READ callPartyAvatarUrl NOTIFY newInviteState)
......@@ -40,6 +41,7 @@ public:
bool haveCallInvite() const { return haveCallInvite_; }
bool isOnCall() const { return session_.state() != webrtc::State::DISCONNECTED; }
bool isVideo() const { return isVideo_; }
bool haveLocalVideo() const { return session_.haveLocalVideo(); }
webrtc::State callState() const { return session_.state(); }
QString callParty() const { return callParty_; }
QString callPartyAvatarUrl() const { return callPartyAvatarUrl_; }
......
......@@ -555,7 +555,10 @@ getResolution(GstPad *pad)
void
addCameraView(GstElement *pipe, const std::pair<int, int> &videoCallSize)
{
GstElement *tee = gst_bin_get_by_name(GST_BIN(pipe), "videosrctee");
GstElement *tee = gst_bin_get_by_name(GST_BIN(pipe), "videosrctee");
if (!tee)
return;
GstElement *queue = gst_element_factory_make("queue", nullptr);
GstElement *videorate = gst_element_factory_make("videorate", nullptr);
gst_bin_add_many(GST_BIN(pipe), queue, videorate, nullptr);
......@@ -1152,6 +1155,19 @@ WebRTCSession::addVideoPipeline(int vp8PayloadType)
return true;
}
bool
WebRTCSession::haveLocalVideo() const
{
if (isVideo_ && state_ >= State::INITIATED) {
GstElement *tee = gst_bin_get_by_name(GST_BIN(pipe_), "videosrctee");
if (tee) {
gst_object_unref(tee);
return true;
}
}
return false;
}
bool
WebRTCSession::isMicMuted() const
{
......@@ -1326,6 +1342,12 @@ WebRTCSession::havePlugins(bool, std::string *)
return false;
}
bool
WebRTCSession::haveLocalVideo() const
{
return false;
}
bool
WebRTCSession::createOffer(bool)
{
......
......@@ -43,6 +43,7 @@ public:
bool havePlugins(bool isVideo, std::string *errorMessage = nullptr);
webrtc::State state() const { return state_; }
bool isVideo() const { return isVideo_; }
bool haveLocalVideo() const;
bool isOffering() const { return isOffering_; }
bool isRemoteVideoRecvOnly() const { return isRemoteVideoRecvOnly_; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment