Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
b3506346
Commit
b3506346
authored
3 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
video: synchronize surface access
Change-Id: Idb2520831ccbb40cdf1dfeb71b8f6318026a1206
parent
d0843097
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ring-android/app/src/main/java/cx/ring/services/HardwareServiceImpl.kt
+10
-10
10 additions, 10 deletions
...app/src/main/java/cx/ring/services/HardwareServiceImpl.kt
with
10 additions
and
10 deletions
ring-android/app/src/main/java/cx/ring/services/HardwareServiceImpl.kt
+
10
−
10
View file @
b3506346
...
...
@@ -319,8 +319,8 @@ class HardwareServiceImpl(
bluetoothEvents
.
onNext
(
event
)
}
override
fun
decodingStarted
(
id
:
String
,
shmPath
:
String
,
width
:
Int
,
height
:
Int
,
isMixer
:
Boolean
)
{
Log
.
i
(
TAG
,
"
DEBUG
decodingStarted() "
+
id
+
" "
+
width
+
"x"
+
height
)
@Synchronized
override
fun
decodingStarted
(
id
:
String
,
shmPath
:
String
,
width
:
Int
,
height
:
Int
,
isMixer
:
Boolean
)
{
Log
.
i
(
TAG
,
"decodingStarted() "
+
id
+
" "
+
width
+
"x"
+
height
)
val
shm
=
Shm
(
id
,
width
,
height
)
videoInputs
[
id
]
=
shm
videoEvents
.
onNext
(
VideoEvent
(
id
,
start
=
true
))
...
...
@@ -334,8 +334,8 @@ class HardwareServiceImpl(
}
}
override
fun
decodingStopped
(
id
:
String
,
shmPath
:
String
,
isMixer
:
Boolean
)
{
Log
.
i
(
TAG
,
"
DEBUG
decodingStopped() $id"
)
@Synchronized
override
fun
decodingStopped
(
id
:
String
,
shmPath
:
String
,
isMixer
:
Boolean
)
{
Log
.
i
(
TAG
,
"decodingStopped() $id"
)
val
shm
=
videoInputs
.
remove
(
id
)
?:
return
if
(
shm
.
window
!=
0L
)
{
try
{
...
...
@@ -521,7 +521,7 @@ class HardwareServiceImpl(
mIsCapturing
=
false
}
override
fun
addVideoSurface
(
id
:
String
,
holder
:
Any
)
{
@Synchronized
override
fun
addVideoSurface
(
id
:
String
,
holder
:
Any
)
{
if
(
holder
!
is
SurfaceHolder
)
{
return
}
...
...
@@ -540,7 +540,7 @@ class HardwareServiceImpl(
}
}
override
fun
updateVideoSurfaceId
(
currentId
:
String
,
newId
:
String
)
{
@Synchronized
override
fun
updateVideoSurfaceId
(
currentId
:
String
,
newId
:
String
)
{
Log
.
w
(
TAG
,
"updateVideoSurfaceId $currentId $newId"
)
val
surfaceHolder
=
videoSurfaces
[
currentId
]
?:
return
val
surface
=
surfaceHolder
.
get
()
...
...
@@ -557,7 +557,7 @@ class HardwareServiceImpl(
surface
?.
let
{
addVideoSurface
(
newId
,
it
)
}
}
override
fun
addPreviewVideoSurface
(
holder
:
Any
,
conference
:
Conference
?)
{
@Synchronized
override
fun
addPreviewVideoSurface
(
holder
:
Any
,
conference
:
Conference
?)
{
if
(
holder
!
is
TextureView
)
return
Log
.
w
(
TAG
,
"addPreviewVideoSurface "
+
holder
.
hashCode
()
+
" mCapturingId "
+
mCapturingId
)
...
...
@@ -569,7 +569,7 @@ class HardwareServiceImpl(
}
}
override
fun
updatePreviewVideoSurface
(
conference
:
Conference
)
{
@Synchronized
override
fun
updatePreviewVideoSurface
(
conference
:
Conference
)
{
val
old
=
mCameraPreviewCall
.
get
()
mCameraPreviewCall
=
WeakReference
(
conference
)
if
(
old
!==
conference
&&
mIsCapturing
)
{
...
...
@@ -579,7 +579,7 @@ class HardwareServiceImpl(
}
}
override
fun
removeVideoSurface
(
id
:
String
)
{
@Synchronized
override
fun
removeVideoSurface
(
id
:
String
)
{
Log
.
i
(
TAG
,
"removeVideoSurface $id"
)
videoSurfaces
.
remove
(
id
)
val
shm
=
videoInputs
[
id
]
?:
return
...
...
@@ -652,6 +652,6 @@ class HardwareServiceImpl(
private
val
TAG
=
HardwareServiceImpl
::
class
.
simpleName
!!
private
var
mCameraPreviewSurface
=
WeakReference
<
TextureView
>(
null
)
private
var
mCameraPreviewCall
=
WeakReference
<
Conference
>(
null
)
private
val
videoSurfaces
=
Collections
.
synchronizedMap
(
HashMap
<
String
,
WeakReference
<
SurfaceHolder
>>()
)
private
val
videoSurfaces
=
HashMap
<
String
,
WeakReference
<
SurfaceHolder
>>()
}
}
\ No newline at end of file
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