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
bbbb0096
authored
Jul 05, 2022
by
huangdarwin
Committed by
Rohit Singh
Jul 07, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
HDR: Remove unused EGL_GL_COLORSPACE_KHR attribute.
PiperOrigin-RevId: 459106221
parent
d5b02e75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
31 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FinalMatrixTransformationProcessorWrapper.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/GlEffectsFrameProcessor.java
library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java
View file @
bbbb0096
...
...
@@ -63,9 +63,6 @@ public final class GlUtil {
// https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_surfaceless_context.txt
private
static
final
String
EXTENSION_SURFACELESS_CONTEXT
=
"EGL_KHR_surfaceless_context"
;
// https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_gl_colorspace.txt
private
static
final
int
EGL_GL_COLORSPACE_KHR
=
0x309D
;
private
static
final
int
[]
EGL_WINDOW_SURFACE_ATTRIBUTES_NONE
=
new
int
[]
{
EGL14
.
EGL_NONE
};
private
static
final
int
[]
EGL_CONFIG_ATTRIBUTES_RGBA_8888
=
new
int
[]
{
...
...
@@ -207,14 +204,13 @@ public final class GlUtil {
}
/**
* Returns a new {@link EGLSurface} wrapping the specified {@code surface}, for HDR rendering with
* Rec. 2020 color primaries.
* Returns a new RGBA 1010102 {@link EGLSurface} wrapping the specified {@code surface}.
*
* @param eglDisplay The {@link EGLDisplay} to attach the surface to.
* @param surface The surface to wrap; must be a surface, surface texture or surface holder.
*/
@RequiresApi
(
17
)
public
static
EGLSurface
getEglSurface
Bt2020
(
EGLDisplay
eglDisplay
,
Object
surface
)
public
static
EGLSurface
getEglSurface
Rgba1010102
(
EGLDisplay
eglDisplay
,
Object
surface
)
throws
GlException
{
return
Api17
.
getEglSurface
(
eglDisplay
,
...
...
@@ -229,18 +225,19 @@ public final class GlUtil {
* @param eglDisplay The {@link EGLDisplay} to attach the surface to.
* @param width The width of the pixel buffer.
* @param height The height of the pixel buffer.
* @param configAttributes EGL configuration attributes. Valid arguments include {@link
* #EGL_CONFIG_ATTRIBUTES_RGBA_8888} and {@link #EGL_CONFIG_ATTRIBUTES_RGBA_1010102}.
*/
@RequiresApi
(
17
)
private
static
EGLSurface
createPbufferSurface
(
EGLDisplay
eglDisplay
,
int
width
,
int
height
)
throws
GlException
{
private
static
EGLSurface
createPbufferSurface
(
EGLDisplay
eglDisplay
,
int
width
,
int
height
,
int
[]
configAttributes
)
throws
GlException
{
int
[]
pbufferAttributes
=
new
int
[]
{
EGL14
.
EGL_WIDTH
,
width
,
EGL14
.
EGL_HEIGHT
,
height
,
EGL14
.
EGL_NONE
};
return
Api17
.
createEglPbufferSurface
(
eglDisplay
,
EGL_CONFIG_ATTRIBUTES_RGBA_8888
,
pbufferAttributes
);
return
Api17
.
createEglPbufferSurface
(
eglDisplay
,
configAttributes
,
pbufferAttributes
);
}
/**
...
...
@@ -254,7 +251,8 @@ public final class GlUtil {
public
static
EGLSurface
createPlaceholderEglSurface
(
EGLDisplay
eglDisplay
)
throws
GlException
{
return
isSurfacelessContextExtensionSupported
()
?
EGL14
.
EGL_NO_SURFACE
:
createPbufferSurface
(
eglDisplay
,
/* width= */
1
,
/* height= */
1
);
:
createPbufferSurface
(
eglDisplay
,
/* width= */
1
,
/* height= */
1
,
EGL_CONFIG_ATTRIBUTES_RGBA_8888
);
}
/**
...
...
@@ -266,33 +264,24 @@ public final class GlUtil {
@RequiresApi
(
17
)
public
static
void
focusPlaceholderEglSurface
(
EGLContext
eglContext
,
EGLDisplay
eglDisplay
)
throws
GlException
{
EGLSurface
eglSurface
=
createPbufferSurface
(
eglDisplay
,
/* width= */
1
,
/* height= */
1
);
EGLSurface
eglSurface
=
createPbufferSurface
(
eglDisplay
,
/* width= */
1
,
/* height= */
1
,
EGL_CONFIG_ATTRIBUTES_RGBA_8888
);
focusEglSurface
(
eglDisplay
,
eglContext
,
eglSurface
,
/* width= */
1
,
/* height= */
1
);
}
/**
* Creates and focuses a new {@link EGLSurface} wrapping a 1x1 pixel buffer, for HDR rendering
* with Rec. 2020 color primaries.
* Creates and focuses a new RGBA 1010102 {@link EGLSurface} wrapping a 1x1 pixel buffer.
*
* @param eglContext The {@link EGLContext} to make current.
* @param eglDisplay The {@link EGLDisplay} to attach the surface to.
*/
@RequiresApi
(
17
)
public
static
void
focusPlaceholderEglSurfaceBt2020
(
EGLContext
eglContext
,
EGLDisplay
eglDisplay
)
throws
GlException
{
int
[]
pbufferAttributes
=
new
int
[]
{
EGL14
.
EGL_WIDTH
,
/* width= */
1
,
EGL14
.
EGL_HEIGHT
,
/* height= */
1
,
// TODO(b/227624622): Figure out if we can remove the EGL_GL_COLORSPACE_KHR item.
EGL_GL_COLORSPACE_KHR
,
EGL14
.
EGL_NONE
};
public
static
void
focusPlaceholderEglSurfaceRgba1010102
(
EGLContext
eglContext
,
EGLDisplay
eglDisplay
)
throws
GlException
{
EGLSurface
eglSurface
=
Api17
.
createEgl
PbufferSurface
(
eglDisplay
,
EGL_CONFIG_ATTRIBUTES_RGBA_1010102
,
pbufferAttributes
);
create
PbufferSurface
(
eglDisplay
,
/* width= */
1
,
/* height= */
1
,
EGL_CONFIG_ATTRIBUTES_RGBA_1010102
);
focusEglSurface
(
eglDisplay
,
eglContext
,
eglSurface
,
/* width= */
1
,
/* height= */
1
);
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FinalMatrixTransformationProcessorWrapper.java
View file @
bbbb0096
...
...
@@ -195,7 +195,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Nullable
EGLSurface
outputEglSurface
=
this
.
outputEglSurface
;
if
(
outputEglSurface
==
null
)
{
// This means that outputSurfaceInfo changed.
if
(
useHdr
)
{
outputEglSurface
=
GlUtil
.
getEglSurface
Bt2020
(
eglDisplay
,
outputSurfaceInfo
.
surface
);
outputEglSurface
=
GlUtil
.
getEglSurface
Rgba1010102
(
eglDisplay
,
outputSurfaceInfo
.
surface
);
}
else
{
outputEglSurface
=
GlUtil
.
getEglSurface
(
eglDisplay
,
outputSurfaceInfo
.
surface
);
}
...
...
@@ -317,7 +317,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
if
(
eglSurface
==
null
)
{
if
(
useHdr
)
{
eglSurface
=
GlUtil
.
getEglSurface
Bt2020
(
eglDisplay
,
surface
);
eglSurface
=
GlUtil
.
getEglSurface
Rgba1010102
(
eglDisplay
,
surface
);
}
else
{
eglSurface
=
GlUtil
.
getEglSurface
(
eglDisplay
,
surface
);
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/GlEffectsFrameProcessor.java
View file @
bbbb0096
...
...
@@ -121,7 +121,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
GlUtil
.
focusEglSurface
(
eglDisplay
,
eglContext
,
EGL14
.
EGL_NO_SURFACE
,
/* width= */
1
,
/* height= */
1
);
}
else
if
(
useHdr
)
{
GlUtil
.
focusPlaceholderEglSurface
Bt2020
(
eglContext
,
eglDisplay
);
GlUtil
.
focusPlaceholderEglSurface
Rgba1010102
(
eglContext
,
eglDisplay
);
}
else
{
GlUtil
.
focusPlaceholderEglSurface
(
eglContext
,
eglDisplay
);
}
...
...
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