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
6d9a1ed6
authored
Jun 22, 2020
by
olly
Committed by
Andrew Lewis
Jun 23, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Noop consistency fixes for extension decoders
PiperOrigin-RevId: 317609986
parent
aec5ff8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
extensions/av1/src/main/java/com/google/android/exoplayer2/ext/av1/Gav1Decoder.java
extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/VpxDecoder.java
extensions/vp9/src/main/jni/vpx_jni.cc
extensions/av1/src/main/java/com/google/android/exoplayer2/ext/av1/Gav1Decoder.java
View file @
6d9a1ed6
...
...
@@ -84,15 +84,6 @@ import java.nio.ByteBuffer;
return
"libgav1"
;
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public
void
setOutputMode
(
@C
.
VideoOutputMode
int
outputMode
)
{
this
.
outputMode
=
outputMode
;
}
@Override
protected
VideoDecoderInputBuffer
createInputBuffer
()
{
return
new
VideoDecoderInputBuffer
(
DecoderInputBuffer
.
BUFFER_REPLACEMENT_MODE_DIRECT
);
...
...
@@ -157,6 +148,15 @@ import java.nio.ByteBuffer;
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public
void
setOutputMode
(
@C
.
VideoOutputMode
int
outputMode
)
{
this
.
outputMode
=
outputMode
;
}
/**
* Renders output buffer to the given surface. Must only be called when in {@link
* C#VIDEO_OUTPUT_MODE_SURFACE_YUV} mode.
*
...
...
extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/VpxDecoder.java
View file @
6d9a1ed6
...
...
@@ -87,15 +87,6 @@ import java.nio.ByteBuffer;
return
"libvpx"
+
VpxLibrary
.
getVersion
();
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public
void
setOutputMode
(
@C
.
VideoOutputMode
int
outputMode
)
{
this
.
outputMode
=
outputMode
;
}
@Override
protected
VideoDecoderInputBuffer
createInputBuffer
()
{
return
new
VideoDecoderInputBuffer
(
DecoderInputBuffer
.
BUFFER_REPLACEMENT_MODE_DIRECT
);
...
...
@@ -183,6 +174,15 @@ import java.nio.ByteBuffer;
vpxClose
(
vpxDecContext
);
}
/**
* Sets the output mode for frames rendered by the decoder.
*
* @param outputMode The output mode.
*/
public
void
setOutputMode
(
@C
.
VideoOutputMode
int
outputMode
)
{
this
.
outputMode
=
outputMode
;
}
/** Renders the outputBuffer to the surface. Used with OUTPUT_MODE_SURFACE_YUV only. */
public
void
renderToSurface
(
VideoDecoderOutputBuffer
outputBuffer
,
Surface
surface
)
throws
VpxDecoderException
{
...
...
extensions/vp9/src/main/jni/vpx_jni.cc
View file @
6d9a1ed6
...
...
@@ -65,9 +65,11 @@ static jfieldID dataField;
static
jfieldID
outputModeField
;
static
jfieldID
decoderPrivateField
;
// android.graphics.ImageFormat.YV12.
static
const
int
kHalPixelFormatYV12
=
0x32315659
;
// Android YUV format. See:
// https://developer.android.com/reference/android/graphics/ImageFormat.html#YV12.
static
const
int
kImageFormatYV12
=
0x32315659
;
static
const
int
kDecoderPrivateBase
=
0x100
;
static
int
errorCode
;
jint
JNI_OnLoad
(
JavaVM
*
vm
,
void
*
reserved
)
{
...
...
@@ -635,7 +637,7 @@ DECODER_FUNC(jint, vpxRenderFrame, jlong jContext, jobject jSurface,
}
if
(
context
->
width
!=
srcBuffer
->
d_w
||
context
->
height
!=
srcBuffer
->
d_h
)
{
ANativeWindow_setBuffersGeometry
(
context
->
native_window
,
srcBuffer
->
d_w
,
srcBuffer
->
d_h
,
k
HalPixel
FormatYV12
);
srcBuffer
->
d_h
,
k
Image
FormatYV12
);
context
->
width
=
srcBuffer
->
d_w
;
context
->
height
=
srcBuffer
->
d_h
;
}
...
...
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