Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
d508e3ab
Commit
d508e3ab
authored
4 years ago
by
trilene
Browse files
Options
Downloads
Patches
Plain Diff
Send ICE candidates gathered after timeout
parent
7377215d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CallManager.cpp
+11
-2
11 additions, 2 deletions
src/CallManager.cpp
src/WebRTCSession.cpp
+5
-0
5 additions, 0 deletions
src/WebRTCSession.cpp
src/WebRTCSession.h
+1
-0
1 addition, 0 deletions
src/WebRTCSession.h
with
17 additions
and
2 deletions
src/CallManager.cpp
+
11
−
2
View file @
d508e3ab
...
...
@@ -15,6 +15,7 @@
#include
"dialogs/AcceptCall.h"
Q_DECLARE_METATYPE
(
std
::
vector
<
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
>
)
Q_DECLARE_METATYPE
(
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
)
Q_DECLARE_METATYPE
(
mtx
::
responses
::
TurnServer
)
using
namespace
mtx
::
events
;
...
...
@@ -30,11 +31,12 @@ CallManager::CallManager(QSharedPointer<UserSettings> userSettings)
settings_
(
userSettings
)
{
qRegisterMetaType
<
std
::
vector
<
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
>>
();
qRegisterMetaType
<
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
>
();
qRegisterMetaType
<
mtx
::
responses
::
TurnServer
>
();
connect
(
&
session_
,
&
WebRTCSession
::
offerCreated
,
this
,
[
this
](
const
std
::
string
&
sdp
,
const
std
::
vector
<
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
>
&
candidates
)
const
std
::
vector
<
CallCandidates
::
Candidate
>
&
candidates
)
{
nhlog
::
ui
()
->
debug
(
"Offer created with callid_ and roomid_: {} {}"
,
callid_
,
roomid_
.
toStdString
());
emit
newMessage
(
roomid_
,
CallInvite
{
callid_
,
sdp
,
0
,
timeoutms_
});
...
...
@@ -43,13 +45,20 @@ CallManager::CallManager(QSharedPointer<UserSettings> userSettings)
connect
(
&
session_
,
&
WebRTCSession
::
answerCreated
,
this
,
[
this
](
const
std
::
string
&
sdp
,
const
std
::
vector
<
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
>
&
candidates
)
const
std
::
vector
<
CallCandidates
::
Candidate
>
&
candidates
)
{
nhlog
::
ui
()
->
debug
(
"Answer created with callid_ and roomid_: {} {}"
,
callid_
,
roomid_
.
toStdString
());
emit
newMessage
(
roomid_
,
CallAnswer
{
callid_
,
sdp
,
0
});
emit
newMessage
(
roomid_
,
CallCandidates
{
callid_
,
candidates
,
0
});
});
connect
(
&
session_
,
&
WebRTCSession
::
newICECandidate
,
this
,
[
this
](
const
CallCandidates
::
Candidate
&
candidate
)
{
nhlog
::
ui
()
->
debug
(
"New ICE candidate created with callid_ and roomid_: {} {}"
,
callid_
,
roomid_
.
toStdString
());
emit
newMessage
(
roomid_
,
CallCandidates
{
callid_
,
{
candidate
},
0
});
});
connect
(
&
turnServerTimer_
,
&
QTimer
::
timeout
,
this
,
&
CallManager
::
retrieveTurnServer
);
turnServerTimer_
.
start
(
2000
);
...
...
This diff is collapsed.
Click to expand it.
src/WebRTCSession.cpp
+
5
−
0
View file @
d508e3ab
...
...
@@ -358,6 +358,11 @@ setLocalDescription(GstPromise *promise, gpointer webrtc)
void
addLocalICECandidate
(
GstElement
*
webrtc
G_GNUC_UNUSED
,
guint
mlineIndex
,
gchar
*
candidate
,
gpointer
G_GNUC_UNUSED
)
{
if
(
WebRTCSession
::
instance
().
state
()
==
WebRTCSession
::
State
::
CONNECTED
)
{
emit
WebRTCSession
::
instance
().
newICECandidate
({
"audio"
,
(
uint16_t
)
mlineIndex
,
candidate
});
return
;
}
gcandidates
.
push_back
({
"audio"
,
(
uint16_t
)
mlineIndex
,
candidate
});
// GStreamer v1.16: webrtcbin's notify::ice-gathering-state triggers GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE too early
...
...
This diff is collapsed.
Click to expand it.
src/WebRTCSession.h
+
1
−
0
View file @
d508e3ab
...
...
@@ -46,6 +46,7 @@ public:
signals
:
void
offerCreated
(
const
std
::
string
&
sdp
,
const
std
::
vector
<
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
>&
);
void
answerCreated
(
const
std
::
string
&
sdp
,
const
std
::
vector
<
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
>&
);
void
newICECandidate
(
const
mtx
::
events
::
msg
::
CallCandidates
::
Candidate
&
);
void
stateChanged
(
WebRTCSession
::
State
);
// explicit qualifier necessary for Qt
private
slots
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment