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
a82690a5
authored
Sep 27, 2021
by
kimvde
Committed by
bachinger
Sep 28, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use SurfaceTexture.getTimestamp
PiperOrigin-RevId: 399139842
parent
1e6a3aa6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerTranscodingVideoRenderer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerTranscodingVideoRenderer.java
View file @
a82690a5
...
...
@@ -71,7 +71,6 @@ import java.nio.ByteBuffer;
@Nullable
private
GlUtil
.
Uniform
decoderTextureTransformUniform
;
@Nullable
private
MediaCodecAdapterWrapper
encoder
;
private
long
nextEncoderTimeUs
;
/** Whether encoder's actual output format is obtained. */
private
boolean
hasEncoderActualOutputFormat
;
...
...
@@ -304,7 +303,6 @@ import java.nio.ByteBuffer;
if
(!
isDecoderSurfacePopulated
)
{
if
(!
waitingForPopulatedDecoderSurface
)
{
if
(
decoder
.
getOutputBuffer
()
!=
null
)
{
nextEncoderTimeUs
=
checkNotNull
(
decoder
.
getOutputBufferInfo
()).
presentationTimeUs
;
decoder
.
releaseOutputBuffer
(
/* render= */
true
);
waitingForPopulatedDecoderSurface
=
true
;
}
...
...
@@ -326,7 +324,8 @@ import java.nio.ByteBuffer;
GLES20
.
glDrawArrays
(
GLES20
.
GL_TRIANGLE_STRIP
,
0
,
4
);
EGLDisplay
eglDisplay
=
checkNotNull
(
this
.
eglDisplay
);
EGLSurface
eglSurface
=
checkNotNull
(
this
.
eglSurface
);
EGLExt
.
eglPresentationTimeANDROID
(
eglDisplay
,
eglSurface
,
nextEncoderTimeUs
*
1000L
);
long
decoderSurfaceTextureTimestampNs
=
decoderSurfaceTexture
.
getTimestamp
();
EGLExt
.
eglPresentationTimeANDROID
(
eglDisplay
,
eglSurface
,
decoderSurfaceTextureTimestampNs
);
EGL14
.
eglSwapBuffers
(
eglDisplay
,
eglSurface
);
isDecoderSurfacePopulated
=
false
;
return
true
;
...
...
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