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
9991f146
authored
Sep 03, 2021
by
kimvde
Committed by
Ian Baker
Sep 06, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add Open GL step to Transformer
PiperOrigin-RevId: 394708737
parent
dd19bc89
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
14 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/MediaCodecAdapterWrapper.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerBaseRenderer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerTranscodingVideoRenderer.java
library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java
View file @
9991f146
...
@@ -223,6 +223,9 @@ public final class GlUtil {
...
@@ -223,6 +223,9 @@ public final class GlUtil {
}
}
}
}
/** Represents an unset texture ID. */
public
static
final
int
TEXTURE_ID_UNSET
=
-
1
;
/** Whether to throw a {@link GlException} in case of an OpenGL error. */
/** Whether to throw a {@link GlException} in case of an OpenGL error. */
public
static
boolean
glAssertionsEnabled
=
false
;
public
static
boolean
glAssertionsEnabled
=
false
;
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/MediaCodecAdapterWrapper.java
View file @
9991f146
...
@@ -343,8 +343,21 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -343,8 +343,21 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* be available until the previous has been released.
* be available until the previous has been released.
*/
*/
public
void
releaseOutputBuffer
()
{
public
void
releaseOutputBuffer
()
{
releaseOutputBuffer
(
/* render= */
false
);
}
/**
* Releases the current output buffer. If the {@link MediaCodec} was configured with an output
* surface, setting {@code render} to {@code true} will first send the buffer to the output
* surface. The surface will release the buffer back to the codec once it is no longer
* used/displayed.
*
* <p>This should be called after the buffer has been processed. The next output buffer will not
* be available until the previous has been released.
*/
public
void
releaseOutputBuffer
(
boolean
render
)
{
outputBuffer
=
null
;
outputBuffer
=
null
;
codec
.
releaseOutputBuffer
(
outputBufferIndex
,
/* render= */
false
);
codec
.
releaseOutputBuffer
(
outputBufferIndex
,
render
);
outputBufferIndex
=
C
.
INDEX_UNSET
;
outputBufferIndex
=
C
.
INDEX_UNSET
;
}
}
...
@@ -359,18 +372,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -359,18 +372,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
codec
.
release
();
codec
.
release
();
}
}
/** Returns {@code true} if a buffer is successfully obtained, rendered and released. */
public
boolean
maybeDequeueRenderAndReleaseOutputBuffer
()
{
if
(!
maybeDequeueOutputBuffer
())
{
return
false
;
}
codec
.
releaseOutputBuffer
(
outputBufferIndex
,
/* render= */
true
);
outputBuffer
=
null
;
outputBufferIndex
=
C
.
INDEX_UNSET
;
return
true
;
}
/**
/**
* Tries obtaining an output buffer and sets {@link #outputBuffer} to the obtained output buffer.
* Tries obtaining an output buffer and sets {@link #outputBuffer} to the obtained output buffer.
*
*
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerBaseRenderer.java
View file @
9991f146
...
@@ -20,6 +20,7 @@ import androidx.annotation.Nullable;
...
@@ -20,6 +20,7 @@ import androidx.annotation.Nullable;
import
androidx.annotation.RequiresApi
;
import
androidx.annotation.RequiresApi
;
import
com.google.android.exoplayer2.BaseRenderer
;
import
com.google.android.exoplayer2.BaseRenderer
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.RendererCapabilities
;
import
com.google.android.exoplayer2.RendererCapabilities
;
import
com.google.android.exoplayer2.util.MediaClock
;
import
com.google.android.exoplayer2.util.MediaClock
;
...
@@ -75,7 +76,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
...
@@ -75,7 +76,7 @@ import com.google.android.exoplayer2.util.MimeTypes;
}
}
@Override
@Override
protected
final
void
onStarted
()
{
protected
void
onStarted
()
throws
ExoPlaybackException
{
isRendererStarted
=
true
;
isRendererStarted
=
true
;
}
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerTranscodingVideoRenderer.java
View file @
9991f146
This diff is collapsed.
Click to expand it.
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