Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
e623a19b
Commit
e623a19b
authored
Feb 11, 2015
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified notification handlers
parent
045fd5e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
31 deletions
+9
-31
sessions.py
blink/sessions.py
+9
-31
No files found.
blink/sessions.py
View file @
e623a19b
...
@@ -963,43 +963,21 @@ class BlinkSession(QObject):
...
@@ -963,43 +963,21 @@ class BlinkSession(QObject):
self
.
unhold
()
self
.
unhold
()
def
_NH_RTPStreamICENegotiationStateDidChange
(
self
,
notification
):
def
_NH_RTPStreamICENegotiationStateDidChange
(
self
,
notification
):
if
notification
.
sender
.
type
==
'audio'
:
if
notification
.
data
.
state
in
{
'GATHERING'
,
'GATHERING_COMPLETE'
,
'NEGOTIATING'
}:
info
=
self
.
info
.
streams
.
audio
stream_info
=
self
.
info
.
streams
[
notification
.
sender
.
type
]
elif
notification
.
sender
.
type
==
'video'
:
stream_info
.
ice_status
=
notification
.
data
.
state
.
lower
()
info
=
self
.
info
.
streams
.
video
else
:
raise
RuntimeError
(
'Unexpected stream type:
%
s'
%
notification
.
sender
.
type
)
state
=
notification
.
data
.
state
if
state
==
'GATHERING'
:
info
.
ice_status
=
'gathering'
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
if
state
==
'GATHERING_COMPLETE'
:
info
.
ice_status
=
'gathering_complete'
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
elif
state
==
'NEGOTIATING'
:
info
.
ice_status
=
'negotiating'
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
def
_NH_RTPStreamICENegotiationDidSucceed
(
self
,
notification
):
def
_NH_RTPStreamICENegotiationDidSucceed
(
self
,
notification
):
if
notification
.
sender
.
type
==
'audio'
:
stream_info
=
self
.
info
.
streams
[
notification
.
sender
.
type
]
info
=
self
.
info
.
streams
.
audio
stream_info
.
ice_status
=
'succeeded'
elif
notification
.
sender
.
type
==
'video'
:
stream_info
.
local_rtp_candidate
=
notification
.
sender
.
local_rtp_candidate
info
=
self
.
info
.
streams
.
video
stream_info
.
remote_rtp_candidate
=
notification
.
sender
.
remote_rtp_candidate
else
:
raise
RuntimeError
(
'Unexpected stream type:
%
s'
%
notification
.
sender
.
type
)
info
.
ice_status
=
'succeeded'
info
.
local_rtp_candidate
=
notification
.
sender
.
local_rtp_candidate
info
.
remote_rtp_candidate
=
notification
.
sender
.
remote_rtp_candidate
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
def
_NH_RTPStreamICENegotiationDidFail
(
self
,
notification
):
def
_NH_RTPStreamICENegotiationDidFail
(
self
,
notification
):
if
notification
.
sender
.
type
==
'audio'
:
stream_info
=
self
.
info
.
streams
[
notification
.
sender
.
type
]
info
=
self
.
info
.
streams
.
audio
stream_info
.
ice_status
=
'failed'
elif
notification
.
sender
.
type
==
'video'
:
info
=
self
.
info
.
streams
.
video
else
:
raise
RuntimeError
(
'Unexpected stream type:
%
s'
%
notification
.
sender
.
type
)
info
.
ice_status
=
'failed'
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
notification
.
center
.
post_notification
(
'BlinkSessionInfoUpdated'
,
sender
=
self
,
data
=
NotificationData
(
elements
=
{
'media'
}))
def
_NH_AudioStreamGotDTMF
(
self
,
notification
):
def
_NH_AudioStreamGotDTMF
(
self
,
notification
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment