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
1fbaa5c0
authored
Apr 08, 2022
by
hschlueter
Committed by
Ian Baker
Apr 26, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add WorkerThread annotation to FrameProcessorChain helpers.
PiperOrigin-RevId: 440347550
parent
187b45bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameProcessorChain.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameProcessorChain.java
View file @
1fbaa5c0
...
@@ -32,6 +32,7 @@ import android.util.Size;
...
@@ -32,6 +32,7 @@ import android.util.Size;
import
android.view.Surface
;
import
android.view.Surface
;
import
android.view.SurfaceView
;
import
android.view.SurfaceView
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.WorkerThread
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.util.GlUtil
;
import
com.google.android.exoplayer2.util.GlUtil
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
...
@@ -125,8 +126,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -125,8 +126,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* Creates the OpenGL textures, framebuffers, initializes the {@link GlFrameProcessor
* Creates the OpenGL textures, framebuffers, initializes the {@link GlFrameProcessor
* GlFrameProcessors} and returns a new {@code FrameProcessorChain}.
* GlFrameProcessors} and returns a new {@code FrameProcessorChain}.
*
*
* <p>This method must b
y
executed using the {@code singleThreadExecutorService}.
* <p>This method must b
e
executed using the {@code singleThreadExecutorService}.
*/
*/
@WorkerThread
private
static
FrameProcessorChain
createOpenGlObjectsAndFrameProcessorChain
(
private
static
FrameProcessorChain
createOpenGlObjectsAndFrameProcessorChain
(
int
inputWidth
,
int
inputWidth
,
int
inputHeight
,
int
inputHeight
,
...
@@ -312,7 +314,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -312,7 +314,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/**
/**
* Informs the {@code FrameProcessorChain} that a frame will be queued to its input surface.
* Informs the {@code FrameProcessorChain} that a frame will be queued to its input surface.
*
*
* <p>
Should
be called before rendering a frame to the frame processor chain's input surface.
* <p>
Must
be called before rendering a frame to the frame processor chain's input surface.
*
*
* @throws IllegalStateException If called after {@link #signalEndOfInputStream()}.
* @throws IllegalStateException If called after {@link #signalEndOfInputStream()}.
*/
*/
...
@@ -393,8 +395,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -393,8 +395,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/**
/**
* Creates the OpenGL surfaces.
* Creates the OpenGL surfaces.
*
*
* <p>This method
should only
be called on the {@linkplain #THREAD_NAME background thread}.
* <p>This method
must
be called on the {@linkplain #THREAD_NAME background thread}.
*/
*/
@WorkerThread
private
void
createOpenGlSurfaces
(
Surface
outputSurface
,
@Nullable
SurfaceView
debugSurfaceView
)
{
private
void
createOpenGlSurfaces
(
Surface
outputSurface
,
@Nullable
SurfaceView
debugSurfaceView
)
{
checkState
(
Thread
.
currentThread
().
getName
().
equals
(
THREAD_NAME
));
checkState
(
Thread
.
currentThread
().
getName
().
equals
(
THREAD_NAME
));
checkStateNotNull
(
eglDisplay
);
checkStateNotNull
(
eglDisplay
);
...
@@ -418,8 +421,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -418,8 +421,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/**
/**
* Processes an input frame.
* Processes an input frame.
*
*
* <p>This method
should only
be called on the {@linkplain #THREAD_NAME background thread}.
* <p>This method
must
be called on the {@linkplain #THREAD_NAME background thread}.
*/
*/
@WorkerThread
@RequiresNonNull
(
"inputSurfaceTexture"
)
@RequiresNonNull
(
"inputSurfaceTexture"
)
private
void
processFrame
()
{
private
void
processFrame
()
{
checkState
(
Thread
.
currentThread
().
getName
().
equals
(
THREAD_NAME
));
checkState
(
Thread
.
currentThread
().
getName
().
equals
(
THREAD_NAME
));
...
...
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