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
da80b17a
authored
Nov 23, 2021
by
kimvde
Committed by
kim-vde
Nov 26, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Transformer: rename OpenGlFrameEditor to FrameEditor
PiperOrigin-RevId: 411751425
parent
8618e4b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/OpenGlFrameEditor.java → library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameEditor.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/VideoSamplePipeline.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/
OpenGl
FrameEditor.java
→
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameEditor.java
View file @
da80b17a
...
@@ -29,26 +29,26 @@ import com.google.android.exoplayer2.util.GlUtil;
...
@@ -29,26 +29,26 @@ import com.google.android.exoplayer2.util.GlUtil;
import
java.io.IOException
;
import
java.io.IOException
;
/**
/**
*
OpenGlFrameEditor applies changes to individual video frames using OpenGL. Changes include just
*
FrameEditor applies changes to individual video frames. Changes include just resolution for now,
*
resolution for now,
but may later include brightness, cropping, rotation, etc.
* but may later include brightness, cropping, rotation, etc.
*/
*/
@RequiresApi
(
18
)
@RequiresApi
(
18
)
/* package */
final
class
OpenGl
FrameEditor
{
/* package */
final
class
FrameEditor
{
static
{
static
{
GlUtil
.
glAssertionsEnabled
=
true
;
GlUtil
.
glAssertionsEnabled
=
true
;
}
}
/**
/**
* Returns a new
OpenGlFrameEditor
for applying changes to individual frames.
* Returns a new
{@code FrameEditor}
for applying changes to individual frames.
*
*
* @param context A {@link Context}.
* @param context A {@link Context}.
* @param outputWidth The output width in pixels.
* @param outputWidth The output width in pixels.
* @param outputHeight The output height in pixels.
* @param outputHeight The output height in pixels.
* @param outputSurface The {@link Surface}.
* @param outputSurface The {@link Surface}.
* @return A configured
OpenGlFrameEditor
.
* @return A configured
{@code FrameEditor}
.
*/
*/
public
static
OpenGl
FrameEditor
create
(
public
static
FrameEditor
create
(
Context
context
,
int
outputWidth
,
int
outputHeight
,
Surface
outputSurface
)
{
Context
context
,
int
outputWidth
,
int
outputHeight
,
Surface
outputSurface
)
{
EGLDisplay
eglDisplay
=
GlUtil
.
createEglDisplay
();
EGLDisplay
eglDisplay
=
GlUtil
.
createEglDisplay
();
EGLContext
eglContext
;
EGLContext
eglContext
;
...
@@ -87,7 +87,7 @@ import java.io.IOException;
...
@@ -87,7 +87,7 @@ import java.io.IOException;
},
},
/* size= */
4
);
/* size= */
4
);
copyProgram
.
setSamplerTexIdUniform
(
"tex_sampler"
,
textureId
,
/* unit= */
0
);
copyProgram
.
setSamplerTexIdUniform
(
"tex_sampler"
,
textureId
,
/* unit= */
0
);
return
new
OpenGl
FrameEditor
(
eglDisplay
,
eglContext
,
eglSurface
,
textureId
,
copyProgram
);
return
new
FrameEditor
(
eglDisplay
,
eglContext
,
eglSurface
,
textureId
,
copyProgram
);
}
}
// Predefined shader values.
// Predefined shader values.
...
@@ -107,7 +107,7 @@ import java.io.IOException;
...
@@ -107,7 +107,7 @@ import java.io.IOException;
private
volatile
boolean
hasInputData
;
private
volatile
boolean
hasInputData
;
private
OpenGl
FrameEditor
(
private
FrameEditor
(
EGLDisplay
eglDisplay
,
EGLDisplay
eglDisplay
,
EGLContext
eglContext
,
EGLContext
eglContext
,
EGLSurface
eglSurface
,
EGLSurface
eglSurface
,
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/VideoSamplePipeline.java
View file @
da80b17a
...
@@ -44,7 +44,7 @@ import java.io.IOException;
...
@@ -44,7 +44,7 @@ import java.io.IOException;
private
final
DecoderInputBuffer
decoderInputBuffer
;
private
final
DecoderInputBuffer
decoderInputBuffer
;
private
final
MediaCodecAdapterWrapper
decoder
;
private
final
MediaCodecAdapterWrapper
decoder
;
private
final
OpenGlFrameEditor
openGlF
rameEditor
;
private
final
FrameEditor
f
rameEditor
;
private
boolean
waitingForPopulatedDecoderSurface
;
private
boolean
waitingForPopulatedDecoderSurface
;
...
@@ -84,8 +84,8 @@ import java.io.IOException;
...
@@ -84,8 +84,8 @@ import java.io.IOException;
throw
createRendererException
(
throw
createRendererException
(
e
,
rendererIndex
,
decoderInputFormat
,
PlaybackException
.
ERROR_CODE_UNSPECIFIED
);
e
,
rendererIndex
,
decoderInputFormat
,
PlaybackException
.
ERROR_CODE_UNSPECIFIED
);
}
}
openGlF
rameEditor
=
f
rameEditor
=
OpenGl
FrameEditor
.
create
(
FrameEditor
.
create
(
context
,
context
,
outputWidth
,
outputWidth
,
outputHeight
,
outputHeight
,
...
@@ -93,7 +93,7 @@ import java.io.IOException;
...
@@ -93,7 +93,7 @@ import java.io.IOException;
try
{
try
{
decoder
=
decoder
=
MediaCodecAdapterWrapper
.
createForVideoDecoding
(
MediaCodecAdapterWrapper
.
createForVideoDecoding
(
decoderInputFormat
,
openGlF
rameEditor
.
getInputSurface
());
decoderInputFormat
,
f
rameEditor
.
getInputSurface
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
createRendererException
(
throw
createRendererException
(
e
,
rendererIndex
,
decoderInputFormat
,
PlaybackException
.
ERROR_CODE_DECODER_INIT_FAILED
);
e
,
rendererIndex
,
decoderInputFormat
,
PlaybackException
.
ERROR_CODE_DECODER_INIT_FAILED
);
...
@@ -106,7 +106,7 @@ import java.io.IOException;
...
@@ -106,7 +106,7 @@ import java.io.IOException;
return
false
;
return
false
;
}
}
if
(!
openGlF
rameEditor
.
hasInputData
())
{
if
(!
f
rameEditor
.
hasInputData
())
{
if
(!
waitingForPopulatedDecoderSurface
)
{
if
(!
waitingForPopulatedDecoderSurface
)
{
if
(
decoder
.
getOutputBufferInfo
()
!=
null
)
{
if
(
decoder
.
getOutputBufferInfo
()
!=
null
)
{
decoder
.
releaseOutputBuffer
(
/* render= */
true
);
decoder
.
releaseOutputBuffer
(
/* render= */
true
);
...
@@ -120,7 +120,7 @@ import java.io.IOException;
...
@@ -120,7 +120,7 @@ import java.io.IOException;
}
}
waitingForPopulatedDecoderSurface
=
false
;
waitingForPopulatedDecoderSurface
=
false
;
openGlF
rameEditor
.
processData
();
f
rameEditor
.
processData
();
return
true
;
return
true
;
}
}
...
@@ -166,7 +166,7 @@ import java.io.IOException;
...
@@ -166,7 +166,7 @@ import java.io.IOException;
@Override
@Override
public
void
release
()
{
public
void
release
()
{
openGlF
rameEditor
.
release
();
f
rameEditor
.
release
();
decoder
.
release
();
decoder
.
release
();
encoder
.
release
();
encoder
.
release
();
}
}
...
...
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