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
3730c1e4
authored
May 04, 2022
by
huangdarwin
Committed by
Ian Baker
May 04, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
GL: Update exoplayer to use bindTexture.
Refactoring change only. PiperOrigin-RevId: 446475708
parent
e62338e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java
library/core/src/main/java/com/google/android/exoplayer2/video/VideoDecoderGLSurfaceView.java
library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java
View file @
3730c1e4
...
...
@@ -462,7 +462,7 @@ public final class GlUtil {
* GLES20#GL_TEXTURE_2D} for a two-dimensional texture or {@link
* GLES11Ext#GL_TEXTURE_EXTERNAL_OES} for an external texture.
*/
/* package */
static
void
bindTexture
(
int
textureTarget
,
int
texId
)
{
public
static
void
bindTexture
(
int
textureTarget
,
int
texId
)
{
GLES20
.
glBindTexture
(
textureTarget
,
texId
);
checkGlError
();
GLES20
.
glTexParameteri
(
textureTarget
,
GLES20
.
GL_TEXTURE_MAG_FILTER
,
GLES20
.
GL_LINEAR
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/video/VideoDecoderGLSurfaceView.java
View file @
3730c1e4
...
...
@@ -298,19 +298,11 @@ public final class VideoDecoderGLSurfaceView extends GLSurfaceView
@RequiresNonNull
(
"program"
)
private
void
setupTextures
()
{
GLES20
.
glGenTextures
(
3
,
yuvTextures
,
/* offset= */
0
);
GLES20
.
glGenTextures
(
/* n= */
3
,
yuvTextures
,
/* offset= */
0
);
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
GLES20
.
glUniform1i
(
program
.
getUniformLocation
(
TEXTURE_UNIFORMS
[
i
]),
i
);
GLES20
.
glActiveTexture
(
GLES20
.
GL_TEXTURE0
+
i
);
GLES20
.
glBindTexture
(
GLES20
.
GL_TEXTURE_2D
,
yuvTextures
[
i
]);
GLES20
.
glTexParameterf
(
GLES20
.
GL_TEXTURE_2D
,
GLES20
.
GL_TEXTURE_MIN_FILTER
,
GLES20
.
GL_LINEAR
);
GLES20
.
glTexParameterf
(
GLES20
.
GL_TEXTURE_2D
,
GLES20
.
GL_TEXTURE_MAG_FILTER
,
GLES20
.
GL_LINEAR
);
GLES20
.
glTexParameterf
(
GLES20
.
GL_TEXTURE_2D
,
GLES20
.
GL_TEXTURE_WRAP_S
,
GLES20
.
GL_CLAMP_TO_EDGE
);
GLES20
.
glTexParameterf
(
GLES20
.
GL_TEXTURE_2D
,
GLES20
.
GL_TEXTURE_WRAP_T
,
GLES20
.
GL_CLAMP_TO_EDGE
);
GlUtil
.
bindTexture
(
GLES20
.
GL_TEXTURE_2D
,
yuvTextures
[
i
]);
}
GlUtil
.
checkGlError
();
}
...
...
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