Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4ac177c3
authored
Jul 25, 2022
by
Googler
Committed by
Marc Baechinger
Oct 19, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Only recreate output EGLSurface when Surface changed.
PiperOrigin-RevId: 463193768
parent
62881821
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FinalMatrixTransformationProcessorWrapper.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FinalMatrixTransformationProcessorWrapper.java
View file @
4ac177c3
...
@@ -75,6 +75,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -75,6 +75,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Nullable
private
SurfaceViewWrapper
debugSurfaceViewWrapper
;
@Nullable
private
SurfaceViewWrapper
debugSurfaceViewWrapper
;
private
@MonotonicNonNull
Listener
listener
;
private
@MonotonicNonNull
Listener
listener
;
private
@MonotonicNonNull
Size
outputSizeBeforeSurfaceTransformation
;
private
@MonotonicNonNull
Size
outputSizeBeforeSurfaceTransformation
;
private
@MonotonicNonNull
SurfaceView
debugSurfaceView
;
private
volatile
boolean
outputSizeOrRotationChanged
;
@GuardedBy
(
"this"
)
@GuardedBy
(
"this"
)
@Nullable
@Nullable
...
@@ -207,7 +210,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -207,7 +210,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
SurfaceInfo
outputSurfaceInfo
=
this
.
outputSurfaceInfo
;
SurfaceInfo
outputSurfaceInfo
=
this
.
outputSurfaceInfo
;
@Nullable
EGLSurface
outputEglSurface
=
this
.
outputEglSurface
;
@Nullable
EGLSurface
outputEglSurface
=
this
.
outputEglSurface
;
if
(
outputEglSurface
==
null
)
{
// This means that outputSurfaceInfo changed.
if
(
outputEglSurface
==
null
)
{
if
(
useHdr
)
{
if
(
useHdr
)
{
outputEglSurface
=
GlUtil
.
getEglSurfaceRgba1010102
(
eglDisplay
,
outputSurfaceInfo
.
surface
);
outputEglSurface
=
GlUtil
.
getEglSurfaceRgba1010102
(
eglDisplay
,
outputSurfaceInfo
.
surface
);
}
else
{
}
else
{
...
@@ -218,16 +221,17 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -218,16 +221,17 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
SurfaceView
debugSurfaceView
=
SurfaceView
debugSurfaceView
=
debugViewProvider
.
getDebugPreviewSurfaceView
(
debugViewProvider
.
getDebugPreviewSurfaceView
(
outputSurfaceInfo
.
width
,
outputSurfaceInfo
.
height
);
outputSurfaceInfo
.
width
,
outputSurfaceInfo
.
height
);
if
(
debugSurfaceView
!=
null
)
{
if
(
debugSurfaceView
!=
null
&&
!
Util
.
areEqual
(
this
.
debugSurfaceView
,
debugSurfaceView
)
)
{
debugSurfaceViewWrapper
=
debugSurfaceViewWrapper
=
new
SurfaceViewWrapper
(
eglDisplay
,
eglContext
,
useHdr
,
debugSurfaceView
);
new
SurfaceViewWrapper
(
eglDisplay
,
eglContext
,
useHdr
,
debugSurfaceView
);
}
}
if
(
matrixTransformationProcessor
!=
null
)
{
matrixTransformationProcessor
.
release
();
matrixTransformationProcessor
=
null
;
}
}
}
if
(
matrixTransformationProcessor
!=
null
&&
outputSizeOrRotationChanged
)
{
matrixTransformationProcessor
.
release
();
matrixTransformationProcessor
=
null
;
outputSizeOrRotationChanged
=
false
;
}
if
(
matrixTransformationProcessor
==
null
)
{
if
(
matrixTransformationProcessor
==
null
)
{
matrixTransformationProcessor
=
matrixTransformationProcessor
=
createMatrixTransformationProcessorForOutputSurface
(
outputSurfaceInfo
);
createMatrixTransformationProcessorForOutputSurface
(
outputSurfaceInfo
);
...
@@ -316,8 +320,18 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -316,8 +320,18 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
public
synchronized
void
setOutputSurfaceInfo
(
@Nullable
SurfaceInfo
outputSurfaceInfo
)
{
public
synchronized
void
setOutputSurfaceInfo
(
@Nullable
SurfaceInfo
outputSurfaceInfo
)
{
if
(!
Util
.
areEqual
(
this
.
outputSurfaceInfo
,
outputSurfaceInfo
))
{
if
(!
Util
.
areEqual
(
this
.
outputSurfaceInfo
,
outputSurfaceInfo
))
{
if
(
outputSurfaceInfo
!=
null
&&
this
.
outputSurfaceInfo
!=
null
&&
!
this
.
outputSurfaceInfo
.
surface
.
equals
(
outputSurfaceInfo
.
surface
))
{
this
.
outputEglSurface
=
null
;
}
outputSizeOrRotationChanged
=
this
.
outputSurfaceInfo
==
null
||
outputSurfaceInfo
==
null
||
this
.
outputSurfaceInfo
.
width
!=
outputSurfaceInfo
.
width
||
this
.
outputSurfaceInfo
.
height
!=
outputSurfaceInfo
.
height
||
this
.
outputSurfaceInfo
.
orientationDegrees
!=
outputSurfaceInfo
.
orientationDegrees
;
this
.
outputSurfaceInfo
=
outputSurfaceInfo
;
this
.
outputSurfaceInfo
=
outputSurfaceInfo
;
this
.
outputEglSurface
=
null
;
}
}
}
}
...
...
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