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
2bd5351e
authored
Feb 15, 2022
by
hschlueter
Committed by
Ian Baker
Feb 22, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Track presentation timestamps in FrameEditor.
PiperOrigin-RevId: 428763554
parent
37391a85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Codec.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameEditor.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Codec.java
View file @
2bd5351e
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.transformer;
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.transformer;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkNotNull
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkNotNull
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkState
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkState
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Assertions
.
checkStateNotNull
;
import
android.media.MediaCodec
;
import
android.media.MediaCodec
;
import
android.media.MediaCodec.BufferInfo
;
import
android.media.MediaCodec.BufferInfo
;
...
@@ -27,6 +28,7 @@ import androidx.annotation.Nullable;
...
@@ -27,6 +28,7 @@ import androidx.annotation.Nullable;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.decoder.DecoderInputBuffer
;
import
com.google.android.exoplayer2.decoder.DecoderInputBuffer
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.ImmutableList
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
...
@@ -312,7 +314,13 @@ public final class Codec {
...
@@ -312,7 +314,13 @@ public final class Codec {
public
void
releaseOutputBuffer
(
boolean
render
)
throws
TransformationException
{
public
void
releaseOutputBuffer
(
boolean
render
)
throws
TransformationException
{
outputBuffer
=
null
;
outputBuffer
=
null
;
try
{
try
{
mediaCodec
.
releaseOutputBuffer
(
outputBufferIndex
,
render
);
if
(
render
)
{
mediaCodec
.
releaseOutputBuffer
(
outputBufferIndex
,
/* renderTimestampNs= */
checkStateNotNull
(
outputBufferInfo
).
presentationTimeUs
*
1000
);
}
else
{
mediaCodec
.
releaseOutputBuffer
(
outputBufferIndex
,
/* render= */
false
);
}
}
catch
(
RuntimeException
e
)
{
}
catch
(
RuntimeException
e
)
{
throw
createTransformationException
(
e
);
throw
createTransformationException
(
e
);
}
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameEditor.java
View file @
2bd5351e
...
@@ -325,8 +325,8 @@ import java.util.concurrent.atomic.AtomicInteger;
...
@@ -325,8 +325,8 @@ import java.util.concurrent.atomic.AtomicInteger;
glProgram
.
bindAttributesAndUniforms
();
glProgram
.
bindAttributesAndUniforms
();
focusAndDrawQuad
(
eglSurface
,
outputWidth
,
outputHeight
);
focusAndDrawQuad
(
eglSurface
,
outputWidth
,
outputHeight
);
long
surfaceTextureTimestamp
Ns
=
inputSurfaceTexture
.
getTimestamp
();
long
presentationTime
Ns
=
inputSurfaceTexture
.
getTimestamp
();
EGLExt
.
eglPresentationTimeANDROID
(
eglDisplay
,
eglSurface
,
surfaceTextureTimestamp
Ns
);
EGLExt
.
eglPresentationTimeANDROID
(
eglDisplay
,
eglSurface
,
presentationTime
Ns
);
EGL14
.
eglSwapBuffers
(
eglDisplay
,
eglSurface
);
EGL14
.
eglSwapBuffers
(
eglDisplay
,
eglSurface
);
if
(
debugPreviewEglSurface
!=
null
)
{
if
(
debugPreviewEglSurface
!=
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