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
5168a356
authored
Feb 15, 2023
by
tofunmi
Committed by
christosts
Feb 15, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Change FrameProcessor.create() inputTrackType parameter to a boolean
PiperOrigin-RevId: 509808913
parent
6d9baa6e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
48 deletions
library/common/src/main/java/com/google/android/exoplayer2/util/FrameProcessor.java
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorFrameReleaseTest.java
library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorPixelTest.java
library/effect/src/main/java/com/google/android/exoplayer2/effect/FinalMatrixShaderProgramWrapper.java
library/effect/src/main/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessor.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/VideoSamplePipeline.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/FrameProcessorTestRunner.java
library/common/src/main/java/com/google/android/exoplayer2/util/FrameProcessor.java
View file @
5168a356
...
@@ -20,7 +20,6 @@ import android.graphics.Bitmap;
...
@@ -20,7 +20,6 @@ import android.graphics.Bitmap;
import
android.opengl.EGLExt
;
import
android.opengl.EGLExt
;
import
android.view.Surface
;
import
android.view.Surface
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.video.ColorInfo
;
import
com.google.android.exoplayer2.video.ColorInfo
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.Executor
;
...
@@ -51,8 +50,10 @@ public interface FrameProcessor {
...
@@ -51,8 +50,10 @@ public interface FrameProcessor {
* @param debugViewProvider A {@link DebugViewProvider}.
* @param debugViewProvider A {@link DebugViewProvider}.
* @param inputColorInfo The {@link ColorInfo} for input frames.
* @param inputColorInfo The {@link ColorInfo} for input frames.
* @param outputColorInfo The {@link ColorInfo} for output frames.
* @param outputColorInfo The {@link ColorInfo} for output frames.
* @param inputTrackType The {@link C.TrackType} of the input. Supported track types are {@link
* @param isInputTextureExternal Whether the input frames are produced externally (e.g. from a
* C#TRACK_TYPE_VIDEO} and {@link C#TRACK_TYPE_IMAGE}.
* video) or not (e.g. from a {@link Bitmap}). See <a
* href="https://source.android.com/docs/core/graphics/arch-st#ext_texture">the
* SurfaceTexture docs</a> for more information on external textures.
* @param releaseFramesAutomatically If {@code true}, the {@link FrameProcessor} will render
* @param releaseFramesAutomatically If {@code true}, the {@link FrameProcessor} will render
* output frames to the {@linkplain #setOutputSurfaceInfo(SurfaceInfo) output surface}
* output frames to the {@linkplain #setOutputSurfaceInfo(SurfaceInfo) output surface}
* automatically as {@link FrameProcessor} is done processing them. If {@code false}, the
* automatically as {@link FrameProcessor} is done processing them. If {@code false}, the
...
@@ -70,7 +71,7 @@ public interface FrameProcessor {
...
@@ -70,7 +71,7 @@ public interface FrameProcessor {
DebugViewProvider
debugViewProvider
,
DebugViewProvider
debugViewProvider
,
ColorInfo
inputColorInfo
,
ColorInfo
inputColorInfo
,
ColorInfo
outputColorInfo
,
ColorInfo
outputColorInfo
,
@C
.
TrackType
int
inputTrackType
,
boolean
isInputTextureExternal
,
boolean
releaseFramesAutomatically
,
boolean
releaseFramesAutomatically
,
Executor
executor
,
Executor
executor
,
Listener
listener
)
Listener
listener
)
...
@@ -127,8 +128,8 @@ public interface FrameProcessor {
...
@@ -127,8 +128,8 @@ public interface FrameProcessor {
/**
/**
* Provides an input {@link Bitmap} to the {@link FrameProcessor}.
* Provides an input {@link Bitmap} to the {@link FrameProcessor}.
*
*
* <p>This method should only be used for when the {@link FrameProcessor}
was created with {@link
* <p>This method should only be used for when the {@link FrameProcessor}
's {@code
*
C#TRACK_TYPE_IMAGE} as the {@code inputTrackTyp
e}.
*
isInputTextureExternal} parameter is set to {@code fals
e}.
*
*
* <p>Can be called on any thread.
* <p>Can be called on any thread.
*
*
...
@@ -143,8 +144,8 @@ public interface FrameProcessor {
...
@@ -143,8 +144,8 @@ public interface FrameProcessor {
/**
/**
* Returns the input {@link Surface}, where {@link FrameProcessor} consumes input frames from.
* Returns the input {@link Surface}, where {@link FrameProcessor} consumes input frames from.
*
*
* <p>This method should only be used for when the {@link FrameProcessor}
was created with {@link
* <p>This method should only be used for when the {@link FrameProcessor}
's {@code
*
C#TRACK_TYPE_VIDEO} as the {@code inputTrackTyp
e}.
*
isInputTextureExternal} parameter is set to {@code tru
e}.
*
*
* <p>Can be called on any thread.
* <p>Can be called on any thread.
*/
*/
...
@@ -172,8 +173,8 @@ public interface FrameProcessor {
...
@@ -172,8 +173,8 @@ public interface FrameProcessor {
*
*
* <p>Must be called before rendering a frame to the frame processor's input surface.
* <p>Must be called before rendering a frame to the frame processor's input surface.
*
*
* <p>This method should only be used for when the {@link FrameProcessor}
was created with {@link
* <p>This method should only be used for when the {@link FrameProcessor}
's {@code
*
C#TRACK_TYPE_VIDEO} as the {@code inputTrackTyp
e}.
*
isInputTextureExternal} parameter is set to {@code tru
e}.
*
*
* <p>Can be called on any thread.
* <p>Can be called on any thread.
*
*
...
@@ -186,8 +187,8 @@ public interface FrameProcessor {
...
@@ -186,8 +187,8 @@ public interface FrameProcessor {
* Returns the number of input frames that have been {@linkplain #registerInputFrame() registered}
* Returns the number of input frames that have been {@linkplain #registerInputFrame() registered}
* but not processed off the {@linkplain #getInputSurface() input surface} yet.
* but not processed off the {@linkplain #getInputSurface() input surface} yet.
*
*
* <p>This method should only be used for when the {@link FrameProcessor}
was created with {@link
* <p>This method should only be used for when the {@link FrameProcessor}
's {@code
*
C#TRACK_TYPE_VIDEO} as the {@code inputTrackTyp
e}.
*
isInputTextureExternal} parameter is set to {@code tru
e}.
*
*
* <p>Can be called on any thread.
* <p>Can be called on any thread.
*/
*/
...
@@ -246,8 +247,8 @@ public interface FrameProcessor {
...
@@ -246,8 +247,8 @@ public interface FrameProcessor {
* <p>All the frames that are {@linkplain #registerInputFrame() registered} prior to calling this
* <p>All the frames that are {@linkplain #registerInputFrame() registered} prior to calling this
* method are no longer considered to be registered when this method returns.
* method are no longer considered to be registered when this method returns.
*
*
* <p>This method should only be used for when the {@link FrameProcessor}
was created with {@link
* <p>This method should only be used for when the {@link FrameProcessor}
's {@code
*
C#TRACK_TYPE_VIDEO} as the {@code inputTrackTyp
e}.
*
isInputTextureExternal} parameter is set to {@code tru
e}.
*
*
* <p>{@link Listener} methods invoked prior to calling this method should be ignored.
* <p>{@link Listener} methods invoked prior to calling this method should be ignored.
*/
*/
...
...
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
View file @
5168a356
...
@@ -1988,7 +1988,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -1988,7 +1988,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
DebugViewProvider
.
NONE
,
DebugViewProvider
.
NONE
,
inputColorInfo
,
inputColorInfo
,
outputColorInfo
,
outputColorInfo
,
C
.
TRACK_TYPE_VIDEO
,
/* isInputTextureExternal= */
true
,
/* releaseFramesAutomatically= */
false
,
/* releaseFramesAutomatically= */
false
,
/* executor= */
handler:
:
post
,
/* executor= */
handler:
:
post
,
new
FrameProcessor
.
Listener
()
{
new
FrameProcessor
.
Listener
()
{
...
...
library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorFrameReleaseTest.java
View file @
5168a356
...
@@ -25,7 +25,6 @@ import android.media.Image;
...
@@ -25,7 +25,6 @@ import android.media.Image;
import
android.media.ImageReader
;
import
android.media.ImageReader
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.util.DebugViewProvider
;
import
com.google.android.exoplayer2.util.DebugViewProvider
;
import
com.google.android.exoplayer2.util.FrameInfo
;
import
com.google.android.exoplayer2.util.FrameInfo
;
import
com.google.android.exoplayer2.util.FrameProcessingException
;
import
com.google.android.exoplayer2.util.FrameProcessingException
;
...
@@ -296,7 +295,7 @@ public final class GlEffectsFrameProcessorFrameReleaseTest {
...
@@ -296,7 +295,7 @@ public final class GlEffectsFrameProcessorFrameReleaseTest {
DebugViewProvider
.
NONE
,
DebugViewProvider
.
NONE
,
/* inputColorInfo= */
ColorInfo
.
SDR_BT709_LIMITED
,
/* inputColorInfo= */
ColorInfo
.
SDR_BT709_LIMITED
,
/* outputColorInfo= */
ColorInfo
.
SDR_BT709_LIMITED
,
/* outputColorInfo= */
ColorInfo
.
SDR_BT709_LIMITED
,
C
.
TRACK_TYPE_VIDEO
,
/* isInputTextureExternal= */
true
,
releaseFramesAutomatically
,
releaseFramesAutomatically
,
MoreExecutors
.
directExecutor
(),
MoreExecutors
.
directExecutor
(),
new
FrameProcessor
.
Listener
()
{
new
FrameProcessor
.
Listener
()
{
...
...
library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessorPixelTest.java
View file @
5168a356
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
effect
;
package
com
.
google
.
android
.
exoplayer2
.
effect
;
import
static
com
.
google
.
android
.
exoplayer2
.
C
.
TRACK_TYPE_IMAGE
;
import
static
com
.
google
.
android
.
exoplayer2
.
effect
.
OverlayShaderProgramPixelTest
.
OVERLAY_PNG_ASSET_PATH
;
import
static
com
.
google
.
android
.
exoplayer2
.
effect
.
OverlayShaderProgramPixelTest
.
OVERLAY_PNG_ASSET_PATH
;
import
static
com
.
google
.
android
.
exoplayer2
.
testutil
.
BitmapPixelTestUtil
.
MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE
;
import
static
com
.
google
.
android
.
exoplayer2
.
testutil
.
BitmapPixelTestUtil
.
MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE
;
import
static
com
.
google
.
android
.
exoplayer2
.
testutil
.
BitmapPixelTestUtil
.
getBitmapAveragePixelAbsoluteDifferenceArgb8888
;
import
static
com
.
google
.
android
.
exoplayer2
.
testutil
.
BitmapPixelTestUtil
.
getBitmapAveragePixelAbsoluteDifferenceArgb8888
;
...
@@ -107,9 +106,7 @@ public final class GlEffectsFrameProcessorPixelTest {
...
@@ -107,9 +106,7 @@ public final class GlEffectsFrameProcessorPixelTest {
public
void
noEffects_withImageInput_matchesGoldenFile
()
throws
Exception
{
public
void
noEffects_withImageInput_matchesGoldenFile
()
throws
Exception
{
String
testId
=
"noEffects_withImageInput_matchesGoldenFile"
;
String
testId
=
"noEffects_withImageInput_matchesGoldenFile"
;
frameProcessorTestRunner
=
frameProcessorTestRunner
=
getDefaultFrameProcessorTestRunnerBuilder
(
testId
)
getDefaultFrameProcessorTestRunnerBuilder
(
testId
).
setIsInputTextureExternal
(
false
).
build
();
.
setInputTrackType
(
TRACK_TYPE_IMAGE
)
.
build
();
Bitmap
expectedBitmap
=
readBitmap
(
ORIGINAL_PNG_ASSET_PATH
);
Bitmap
expectedBitmap
=
readBitmap
(
ORIGINAL_PNG_ASSET_PATH
);
Bitmap
actualBitmap
=
frameProcessorTestRunner
.
processImageFrameAndEnd
(
expectedBitmap
);
Bitmap
actualBitmap
=
frameProcessorTestRunner
.
processImageFrameAndEnd
(
expectedBitmap
);
...
@@ -125,7 +122,7 @@ public final class GlEffectsFrameProcessorPixelTest {
...
@@ -125,7 +122,7 @@ public final class GlEffectsFrameProcessorPixelTest {
String
testId
=
"wrappedCrop_withImageInput_matchesGoldenFile"
;
String
testId
=
"wrappedCrop_withImageInput_matchesGoldenFile"
;
frameProcessorTestRunner
=
frameProcessorTestRunner
=
getDefaultFrameProcessorTestRunnerBuilder
(
testId
)
getDefaultFrameProcessorTestRunnerBuilder
(
testId
)
.
setI
nputTrackType
(
TRACK_TYPE_IMAGE
)
.
setI
sInputTextureExternal
(
false
)
.
setEffects
(
.
setEffects
(
new
GlEffectWrapper
(
new
GlEffectWrapper
(
new
Crop
(
new
Crop
(
...
...
library/effect/src/main/java/com/google/android/exoplayer2/effect/FinalMatrixShaderProgramWrapper.java
View file @
5168a356
...
@@ -72,7 +72,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -72,7 +72,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private
final
EGLContext
eglContext
;
private
final
EGLContext
eglContext
;
private
final
DebugViewProvider
debugViewProvider
;
private
final
DebugViewProvider
debugViewProvider
;
private
final
boolean
sampleFromInputTexture
;
private
final
boolean
sampleFromInputTexture
;
private
final
boolean
isInputExternal
;
private
final
boolean
isInput
Texture
External
;
private
final
ColorInfo
inputColorInfo
;
private
final
ColorInfo
inputColorInfo
;
private
final
ColorInfo
outputColorInfo
;
private
final
ColorInfo
outputColorInfo
;
private
final
boolean
releaseFramesAutomatically
;
private
final
boolean
releaseFramesAutomatically
;
...
@@ -110,7 +110,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -110,7 +110,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
ColorInfo
inputColorInfo
,
ColorInfo
inputColorInfo
,
ColorInfo
outputColorInfo
,
ColorInfo
outputColorInfo
,
boolean
sampleFromInputTexture
,
boolean
sampleFromInputTexture
,
boolean
isInputExternal
,
boolean
isInput
Texture
External
,
boolean
releaseFramesAutomatically
,
boolean
releaseFramesAutomatically
,
Executor
frameProcessorListenerExecutor
,
Executor
frameProcessorListenerExecutor
,
FrameProcessor
.
Listener
frameProcessorListener
)
{
FrameProcessor
.
Listener
frameProcessorListener
)
{
...
@@ -121,7 +121,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -121,7 +121,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
this
.
eglContext
=
eglContext
;
this
.
eglContext
=
eglContext
;
this
.
debugViewProvider
=
debugViewProvider
;
this
.
debugViewProvider
=
debugViewProvider
;
this
.
sampleFromInputTexture
=
sampleFromInputTexture
;
this
.
sampleFromInputTexture
=
sampleFromInputTexture
;
this
.
isInput
External
=
isInput
External
;
this
.
isInput
TextureExternal
=
isInputTexture
External
;
this
.
inputColorInfo
=
inputColorInfo
;
this
.
inputColorInfo
=
inputColorInfo
;
this
.
outputColorInfo
=
outputColorInfo
;
this
.
outputColorInfo
=
outputColorInfo
;
this
.
releaseFramesAutomatically
=
releaseFramesAutomatically
;
this
.
releaseFramesAutomatically
=
releaseFramesAutomatically
;
...
@@ -406,7 +406,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -406,7 +406,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
ImmutableList
<
GlMatrixTransformation
>
expandedMatrixTransformations
=
ImmutableList
<
GlMatrixTransformation
>
expandedMatrixTransformations
=
matrixTransformationListBuilder
.
build
();
matrixTransformationListBuilder
.
build
();
if
(
sampleFromInputTexture
)
{
if
(
sampleFromInputTexture
)
{
if
(
isInputExternal
)
{
if
(
isInput
Texture
External
)
{
matrixShaderProgram
=
matrixShaderProgram
=
MatrixShaderProgram
.
createWithExternalSampler
(
MatrixShaderProgram
.
createWithExternalSampler
(
context
,
context
,
...
...
library/effect/src/main/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessor.java
View file @
5168a356
...
@@ -96,7 +96,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -96,7 +96,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
DebugViewProvider
debugViewProvider
,
DebugViewProvider
debugViewProvider
,
ColorInfo
inputColorInfo
,
ColorInfo
inputColorInfo
,
ColorInfo
outputColorInfo
,
ColorInfo
outputColorInfo
,
@C
.
TrackType
int
inputTrackType
,
boolean
isInputTextureExternal
,
boolean
releaseFramesAutomatically
,
boolean
releaseFramesAutomatically
,
Executor
listenerExecutor
,
Executor
listenerExecutor
,
Listener
listener
)
Listener
listener
)
...
@@ -107,7 +107,6 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -107,7 +107,6 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
checkArgument
(
inputColorInfo
.
colorTransfer
!=
C
.
COLOR_TRANSFER_LINEAR
);
checkArgument
(
inputColorInfo
.
colorTransfer
!=
C
.
COLOR_TRANSFER_LINEAR
);
checkArgument
(
outputColorInfo
.
isValid
());
checkArgument
(
outputColorInfo
.
isValid
());
checkArgument
(
outputColorInfo
.
colorTransfer
!=
C
.
COLOR_TRANSFER_LINEAR
);
checkArgument
(
outputColorInfo
.
colorTransfer
!=
C
.
COLOR_TRANSFER_LINEAR
);
checkArgument
(
inputTrackType
==
C
.
TRACK_TYPE_VIDEO
||
inputTrackType
==
C
.
TRACK_TYPE_IMAGE
);
if
(
inputColorInfo
.
colorSpace
!=
outputColorInfo
.
colorSpace
if
(
inputColorInfo
.
colorSpace
!=
outputColorInfo
.
colorSpace
||
ColorInfo
.
isTransferHdr
(
inputColorInfo
)
!=
ColorInfo
.
isTransferHdr
(
outputColorInfo
))
{
||
ColorInfo
.
isTransferHdr
(
inputColorInfo
)
!=
ColorInfo
.
isTransferHdr
(
outputColorInfo
))
{
...
@@ -134,7 +133,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -134,7 +133,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
debugViewProvider
,
debugViewProvider
,
inputColorInfo
,
inputColorInfo
,
outputColorInfo
,
outputColorInfo
,
/* isInputExternal= */
inputTrackType
==
C
.
TRACK_TYPE_VIDEO
,
isInputTextureExternal
,
releaseFramesAutomatically
,
releaseFramesAutomatically
,
singleThreadExecutorService
,
singleThreadExecutorService
,
listenerExecutor
,
listenerExecutor
,
...
@@ -168,7 +167,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -168,7 +167,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
DebugViewProvider
debugViewProvider
,
DebugViewProvider
debugViewProvider
,
ColorInfo
inputColorInfo
,
ColorInfo
inputColorInfo
,
ColorInfo
outputColorInfo
,
ColorInfo
outputColorInfo
,
boolean
isInputExternal
,
boolean
isInput
Texture
External
,
boolean
releaseFramesAutomatically
,
boolean
releaseFramesAutomatically
,
ExecutorService
singleThreadExecutorService
,
ExecutorService
singleThreadExecutorService
,
Executor
executor
,
Executor
executor
,
...
@@ -210,7 +209,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -210,7 +209,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
debugViewProvider
,
debugViewProvider
,
inputColorInfo
,
inputColorInfo
,
outputColorInfo
,
outputColorInfo
,
isInputExternal
,
isInput
Texture
External
,
releaseFramesAutomatically
,
releaseFramesAutomatically
,
executor
,
executor
,
listener
);
listener
);
...
@@ -222,7 +221,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -222,7 +221,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
return
new
GlEffectsFrameProcessor
(
return
new
GlEffectsFrameProcessor
(
eglDisplay
,
eglDisplay
,
eglContext
,
eglContext
,
isInputExternal
,
isInput
Texture
External
,
frameProcessingTaskExecutor
,
frameProcessingTaskExecutor
,
shaderPrograms
,
shaderPrograms
,
releaseFramesAutomatically
);
releaseFramesAutomatically
);
...
@@ -247,7 +246,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -247,7 +246,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
DebugViewProvider
debugViewProvider
,
DebugViewProvider
debugViewProvider
,
ColorInfo
inputColorInfo
,
ColorInfo
inputColorInfo
,
ColorInfo
outputColorInfo
,
ColorInfo
outputColorInfo
,
boolean
isInputExternal
,
boolean
isInput
Texture
External
,
boolean
releaseFramesAutomatically
,
boolean
releaseFramesAutomatically
,
Executor
executor
,
Executor
executor
,
Listener
listener
)
Listener
listener
)
...
@@ -286,7 +285,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -286,7 +285,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
if
(!
matrixTransformations
.
isEmpty
()
||
!
rgbMatrices
.
isEmpty
()
||
sampleFromInputTexture
)
{
if
(!
matrixTransformations
.
isEmpty
()
||
!
rgbMatrices
.
isEmpty
()
||
sampleFromInputTexture
)
{
MatrixShaderProgram
matrixShaderProgram
;
MatrixShaderProgram
matrixShaderProgram
;
if
(
sampleFromInputTexture
)
{
if
(
sampleFromInputTexture
)
{
if
(
isInputExternal
)
{
if
(
isInput
Texture
External
)
{
matrixShaderProgram
=
matrixShaderProgram
=
MatrixShaderProgram
.
createWithExternalSampler
(
MatrixShaderProgram
.
createWithExternalSampler
(
context
,
matrixTransformations
,
rgbMatrices
,
inputColorInfo
,
linearColorInfo
);
context
,
matrixTransformations
,
rgbMatrices
,
inputColorInfo
,
linearColorInfo
);
...
@@ -319,7 +318,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -319,7 +318,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
/* inputColorInfo= */
sampleFromInputTexture
?
inputColorInfo
:
linearColorInfo
,
/* inputColorInfo= */
sampleFromInputTexture
?
inputColorInfo
:
linearColorInfo
,
outputColorInfo
,
outputColorInfo
,
sampleFromInputTexture
,
sampleFromInputTexture
,
isInputExternal
,
isInput
Texture
External
,
releaseFramesAutomatically
,
releaseFramesAutomatically
,
executor
,
executor
,
listener
));
listener
));
...
@@ -372,7 +371,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -372,7 +371,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
private
GlEffectsFrameProcessor
(
private
GlEffectsFrameProcessor
(
EGLDisplay
eglDisplay
,
EGLDisplay
eglDisplay
,
EGLContext
eglContext
,
EGLContext
eglContext
,
boolean
isInputExternal
,
boolean
isInput
Texture
External
,
FrameProcessingTaskExecutor
frameProcessingTaskExecutor
,
FrameProcessingTaskExecutor
frameProcessingTaskExecutor
,
ImmutableList
<
GlShaderProgram
>
shaderPrograms
,
ImmutableList
<
GlShaderProgram
>
shaderPrograms
,
boolean
releaseFramesAutomatically
)
boolean
releaseFramesAutomatically
)
...
@@ -388,7 +387,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -388,7 +387,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
GlShaderProgram
inputShaderProgram
=
shaderPrograms
.
get
(
0
);
GlShaderProgram
inputShaderProgram
=
shaderPrograms
.
get
(
0
);
if
(
isInputExternal
)
{
if
(
isInput
Texture
External
)
{
checkState
(
inputShaderProgram
instanceof
ExternalShaderProgram
);
checkState
(
inputShaderProgram
instanceof
ExternalShaderProgram
);
inputExternalTextureManager
=
inputExternalTextureManager
=
new
ExternalTextureManager
(
new
ExternalTextureManager
(
...
@@ -420,8 +419,8 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -420,8 +419,8 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
* call this method after instantiation to ensure that buffers are handled at full resolution. See
* call this method after instantiation to ensure that buffers are handled at full resolution. See
* {@link SurfaceTexture#setDefaultBufferSize(int, int)} for more information.
* {@link SurfaceTexture#setDefaultBufferSize(int, int)} for more information.
*
*
* <p>This method should only be used for when the {@link FrameProcessor}
was created with {@link
* <p>This method should only be used for when the {@link FrameProcessor}
's {@code
*
C#TRACK_TYPE_VIDEO} as the {@code inputTrackTyp
e}.
*
isInputTextureExternal} parameter is set to {@code tru
e}.
*
*
* @param width The default width for input buffers, in pixels.
* @param width The default width for input buffers, in pixels.
* @param height The default height for input buffers, in pixels.
* @param height The default height for input buffers, in pixels.
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/VideoSamplePipeline.java
View file @
5168a356
...
@@ -140,7 +140,7 @@ import org.checkerframework.dataflow.qual.Pure;
...
@@ -140,7 +140,7 @@ import org.checkerframework.dataflow.qual.Pure;
debugViewProvider
,
debugViewProvider
,
frameProcessorInputColor
,
frameProcessorInputColor
,
frameProcessorOutputColor
,
frameProcessorOutputColor
,
MimeTypes
.
getTrackType
(
firstInputFormat
.
sampleMimeType
),
MimeTypes
.
isVideo
(
firstInputFormat
.
sampleMimeType
),
/* releaseFramesAutomatically= */
true
,
/* releaseFramesAutomatically= */
true
,
MoreExecutors
.
directExecutor
(),
MoreExecutors
.
directExecutor
(),
new
FrameProcessor
.
Listener
()
{
new
FrameProcessor
.
Listener
()
{
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/FrameProcessorTestRunner.java
View file @
5168a356
...
@@ -60,12 +60,12 @@ public final class FrameProcessorTestRunner {
...
@@ -60,12 +60,12 @@ public final class FrameProcessorTestRunner {
private
float
pixelWidthHeightRatio
;
private
float
pixelWidthHeightRatio
;
private
@MonotonicNonNull
ColorInfo
inputColorInfo
;
private
@MonotonicNonNull
ColorInfo
inputColorInfo
;
private
@MonotonicNonNull
ColorInfo
outputColorInfo
;
private
@MonotonicNonNull
ColorInfo
outputColorInfo
;
private
@C
.
TrackType
int
inputTrackType
;
private
boolean
isInputTextureExternal
;
/** Creates a new instance with default values. */
/** Creates a new instance with default values. */
public
Builder
()
{
public
Builder
()
{
pixelWidthHeightRatio
=
DEFAULT_PIXEL_WIDTH_HEIGHT_RATIO
;
pixelWidthHeightRatio
=
DEFAULT_PIXEL_WIDTH_HEIGHT_RATIO
;
i
nputTrackType
=
C
.
TRACK_TYPE_VIDEO
;
i
sInputTextureExternal
=
true
;
}
}
/**
/**
...
@@ -171,11 +171,11 @@ public final class FrameProcessorTestRunner {
...
@@ -171,11 +171,11 @@ public final class FrameProcessorTestRunner {
/**
/**
* Sets the input track type. See {@link FrameProcessor.Factory#create}.
* Sets the input track type. See {@link FrameProcessor.Factory#create}.
*
*
* <p>The default value is {@
link C#TRACK_TYPE_VIDEO
}.
* <p>The default value is {@
code true
}.
*/
*/
@CanIgnoreReturnValue
@CanIgnoreReturnValue
public
Builder
setI
nputTrackType
(
@C
.
TrackType
int
inputTrackType
)
{
public
Builder
setI
sInputTextureExternal
(
boolean
isInputTextureExternal
)
{
this
.
i
nputTrackType
=
inputTrackType
;
this
.
i
sInputTextureExternal
=
isInputTextureExternal
;
return
this
;
return
this
;
}
}
...
@@ -193,7 +193,7 @@ public final class FrameProcessorTestRunner {
...
@@ -193,7 +193,7 @@ public final class FrameProcessorTestRunner {
pixelWidthHeightRatio
,
pixelWidthHeightRatio
,
inputColorInfo
==
null
?
ColorInfo
.
SDR_BT709_LIMITED
:
inputColorInfo
,
inputColorInfo
==
null
?
ColorInfo
.
SDR_BT709_LIMITED
:
inputColorInfo
,
outputColorInfo
==
null
?
ColorInfo
.
SDR_BT709_LIMITED
:
outputColorInfo
,
outputColorInfo
==
null
?
ColorInfo
.
SDR_BT709_LIMITED
:
outputColorInfo
,
i
nputTrackType
);
i
sInputTextureExternal
);
}
}
}
}
...
@@ -223,7 +223,7 @@ public final class FrameProcessorTestRunner {
...
@@ -223,7 +223,7 @@ public final class FrameProcessorTestRunner {
float
pixelWidthHeightRatio
,
float
pixelWidthHeightRatio
,
ColorInfo
inputColorInfo
,
ColorInfo
inputColorInfo
,
ColorInfo
outputColorInfo
,
ColorInfo
outputColorInfo
,
@C
.
TrackType
int
inputTrackType
)
boolean
isInputTextureExternal
)
throws
FrameProcessingException
{
throws
FrameProcessingException
{
this
.
testId
=
testId
;
this
.
testId
=
testId
;
this
.
videoAssetPath
=
videoAssetPath
;
this
.
videoAssetPath
=
videoAssetPath
;
...
@@ -238,7 +238,7 @@ public final class FrameProcessorTestRunner {
...
@@ -238,7 +238,7 @@ public final class FrameProcessorTestRunner {
DebugViewProvider
.
NONE
,
DebugViewProvider
.
NONE
,
inputColorInfo
,
inputColorInfo
,
outputColorInfo
,
outputColorInfo
,
i
nputTrackType
,
i
sInputTextureExternal
,
/* releaseFramesAutomatically= */
true
,
/* releaseFramesAutomatically= */
true
,
MoreExecutors
.
directExecutor
(),
MoreExecutors
.
directExecutor
(),
new
FrameProcessor
.
Listener
()
{
new
FrameProcessor
.
Listener
()
{
...
...
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