Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairblue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairblue
Commits
c02170f3
Commit
c02170f3
authored
8 years ago
by
Richard Alam
Browse files
Options
Downloads
Patches
Plain Diff
- handle timeout when querying screen sharing session.
parent
b591106a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bbb-screenshare/app/src/main/scala/org/bigbluebutton/app/screenshare/ScreenShareApplication.scala
+53
-48
53 additions, 48 deletions
...igbluebutton/app/screenshare/ScreenShareApplication.scala
with
53 additions
and
48 deletions
bbb-screenshare/app/src/main/scala/org/bigbluebutton/app/screenshare/ScreenShareApplication.scala
+
53
−
48
View file @
c02170f3
...
...
@@ -18,16 +18,16 @@
*/
package
org.bigbluebutton.app.screenshare
import
scala.util.
{
Success
,
Failure
}
import
scala.util.
{
Failure
,
Success
}
import
akka.util.Timeout
import
akka.pattern.ask
import
org.bigbluebutton.app.screenshare.events.
{
IEventsMessageBus
}
import
org.bigbluebutton.app.screenshare.events.IEventsMessageBus
import
org.bigbluebutton.app.screenshare.server.sessions.ScreenshareManager
import
org.bigbluebutton.app.screenshare.server.sessions.messages._
import
org.bigbluebutton.app.screenshare.server.util.LogHelper
import
akka.actor.ActorSystem
import
scala.concurrent.Future
import
scala.concurrent.Await
import
scala.concurrent.
{
Await
,
Future
,
TimeoutException
}
import
scala.concurrent.duration._
class
ScreenShareApplication
(
val
bus
:
IEventsMessageBus
,
val
jnlpFile
:
String
,
...
...
@@ -93,54 +93,71 @@ class ScreenShareApplication(val bus: IEventsMessageBus, val jnlpFile: String,
logger
.
debug
(
"Received get screen sharing info on token="
+
token
+
"]"
)
}
val
future
=
screenShareManager
?
ScreenShareInfoRequest
(
meetingId
,
token
)
val
reply
=
Await
.
result
(
future
,
timeout
.
duration
).
asInstanceOf
[
ScreenShareInfoRequestReply
]
val
publishUrl
=
streamBaseUrl
+
"/"
+
meetingId
val
info
=
new
ScreenShareInfo
(
publishUrl
,
reply
.
streamId
)
new
ScreenShareInfoResponse
(
info
,
null
)
}
try
{
val
future
=
screenShareManager
?
ScreenShareInfoRequest
(
meetingId
,
token
)
val
reply
=
Await
.
result
(
future
,
timeout
.
duration
).
asInstanceOf
[
ScreenShareInfoRequestReply
]
def
recordStream
(
meetingId
:
String
,
streamId
:
String
)
:
java.lang.Boolean
=
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Received record stream request on stream="
+
streamId
+
"]"
)
val
publishUrl
=
streamBaseUrl
+
"/"
+
meetingId
val
info
=
new
ScreenShareInfo
(
publishUrl
,
reply
.
streamId
)
new
ScreenShareInfoResponse
(
info
,
null
)
}
catch
{
case
e
:
TimeoutException
=>
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"FAILED to get screen share info on meetingId="
+
meetingId
+
"]"
)
}
new
ScreenShareInfoResponse
(
null
,
initError
)
}
//var recorded = false
//sendIsStreamRecored(meetingId, streamId).onComplete {
// case Success(record) => recorded = record
// case Failure(ex) => recorded = false
//}
}
// if (logger.isDebugEnabled()) {
// logger.debug("Received record stream response=" + recorded + "] *************************************")
// }
// recorded
def
getSharingStatus
(
meetingId
:
String
,
streamId
:
String
)
:
SharingStatus
=
{
var
record
=
false
val
future
=
screenShareManager
?
IsStreamRecorded
(
meetingId
,
streamId
)
try
{
val
future
=
screenShareManager
?
GetSharingStatus
(
meetingId
,
streamId
)
val
reply
=
Await
.
result
(
future
,
timeout
.
duration
).
asInstanceOf
[
GetSharingStatusReply
]
val
reply
=
Await
.
result
(
future
,
timeout
.
duration
).
asInstanceOf
[
IsStreamRecordedReply
]
record
=
reply
.
record
record
reply
.
streamId
match
{
case
Some
(
streamId
)
=>
new
SharingStatus
(
reply
.
status
,
streamId
)
case
None
=>
new
SharingStatus
(
reply
.
status
,
null
)
}
}
catch
{
case
e
:
TimeoutException
=>
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"FAILED to get sharing status on stream="
+
streamId
+
"]"
)
}
new
SharingStatus
(
"STOP"
,
null
)
}
}
def
recordStream
(
meetingId
:
String
,
streamId
:
String
)
:
java.lang.Boolean
=
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Received record stream request on stream="
+
streamId
+
"]"
)
}
private
def
sendIsStreamRecored
(
meetingId
:
String
,
streamId
:
String
)
:
Future
[
Boolean
]
=
{
var
record
=
false
//screenShareManager ? IsStreamRecorded(meetingId, streamId)
try
{
val
future
=
screenShareManager
?
IsStreamRecorded
(
meetingId
,
streamId
)
val
reply
=
Await
.
result
(
future
,
timeout
.
duration
).
asInstanceOf
[
IsStreamRecordedReply
]
record
=
reply
.
record
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Received response SUCCESS request on stream="
+
streamId
+
"]"
)
}
}
catch
{
case
e
:
TimeoutException
=>
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"FAILED to get is stream recorded on stream="
+
streamId
+
"]"
)
}
record
=
false
}
(
screenShareManager
?
IsStreamRecorded
(
meetingId
,
streamId
))
.
mapTo
[
IsStreamRecordedReply
]
.
map
(
result
=>
result
.
record
)
//.recover {
// case _ => false
//}
record
}
def
startShareRequest
(
meetingId
:
String
,
userId
:
String
,
record
:
java.lang.Boolean
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Received start share request on meeting="
+
meetingId
+
"for user="
+
userId
+
"]"
)
...
...
@@ -209,19 +226,7 @@ class ScreenShareApplication(val bus: IEventsMessageBus, val jnlpFile: String,
screenShareManager
!
new
UpdateShareStatus
(
meetingId
,
streamId
,
seqNum
)
}
def
getSharingStatus
(
meetingId
:
String
,
streamId
:
String
)
:
SharingStatus
=
{
var
stopped
=
false
val
future
=
screenShareManager
?
GetSharingStatus
(
meetingId
,
streamId
)
val
reply
=
Await
.
result
(
future
,
timeout
.
duration
).
asInstanceOf
[
GetSharingStatusReply
]
reply
.
streamId
match
{
case
Some
(
streamId
)
=>
new
SharingStatus
(
reply
.
status
,
streamId
)
case
None
=>
new
SharingStatus
(
reply
.
status
,
null
)
}
}
def
screenShareClientPongMessage
(
meetingId
:
String
,
userId
:
String
,
streamId
:
String
,
timestamp
:
java.lang.Long
)
{
screenShareManager
!
new
ClientPongMessage
(
meetingId
,
userId
,
streamId
,
timestamp
)
...
...
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