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
dd4d4e8f
authored
Oct 27, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add libopus/libvpx availability checks
parent
4422e8a0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
9 deletions
extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/LibopusAudioTrackRenderer.java
extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/OpusDecoder.java
extensions/vp9/src/main/java/com/google/android/exoplayer/ext/vp9/LibvpxVideoTrackRenderer.java
extensions/vp9/src/main/java/com/google/android/exoplayer/ext/vp9/VpxDecoder.java
extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/LibopusAudioTrackRenderer.java
View file @
dd4d4e8f
...
...
@@ -120,12 +120,19 @@ public final class LibopusAudioTrackRenderer extends SampleSourceTrackRenderer
}
/**
* Returns whether the underlying libopus library is available.
*/
public
static
boolean
isLibopusAvailable
()
{
return
OpusDecoder
.
isLibopusAvailable
();
}
/**
* Get the version of underlying libopus library.
*
* @return version of the underlying libopus library.
*/
public
static
String
getLibopusVersion
()
{
return
OpusDecoder
.
getLibopusVersion
()
;
return
isLibopusAvailable
()
?
OpusDecoder
.
getLibopusVersion
()
:
null
;
}
@Override
...
...
extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/OpusDecoder.java
View file @
dd4d4e8f
...
...
@@ -26,13 +26,21 @@ import java.nio.ByteBuffer;
*/
/* package */
class
OpusDecoder
{
private
final
long
nativeDecoderContext
;
private
static
final
boolean
IS_AVAILABLE
;
static
{
boolean
isAvailable
;
try
{
System
.
loadLibrary
(
"opus"
);
System
.
loadLibrary
(
"opusJNI"
);
isAvailable
=
true
;
}
catch
(
UnsatisfiedLinkError
exception
)
{
isAvailable
=
false
;
}
IS_AVAILABLE
=
isAvailable
;
}
private
final
long
nativeDecoderContext
;
/**
* Creates the Opus Decoder.
*
...
...
@@ -82,6 +90,13 @@ import java.nio.ByteBuffer;
}
/**
* Returns whether the underlying libopus library is available.
*/
public
static
boolean
isLibopusAvailable
()
{
return
IS_AVAILABLE
;
}
/**
* Returns the version string of the underlying libopus decoder.
*/
public
static
native
String
getLibopusVersion
();
...
...
extensions/vp9/src/main/java/com/google/android/exoplayer/ext/vp9/LibvpxVideoTrackRenderer.java
View file @
dd4d4e8f
...
...
@@ -151,12 +151,17 @@ public final class LibvpxVideoTrackRenderer extends SampleSourceTrackRenderer {
}
/**
* Get the version of underlying libvpx library.
*
* @return version of the underlying libvpx library.
* Returns whether the underlying libvpx library is available.
*/
public
static
boolean
isLibvpxAvailable
()
{
return
VpxDecoder
.
isLibvpxAvailable
();
}
/**
* Returns the version of the underlying libvpx library if available, otherwise {@code null}.
*/
public
static
String
getLibvpxVersion
()
{
return
VpxDecoder
.
getLibvpxVersion
()
;
return
isLibvpxAvailable
()
?
VpxDecoder
.
getLibvpxVersion
()
:
null
;
}
@Override
...
...
extensions/vp9/src/main/java/com/google/android/exoplayer/ext/vp9/VpxDecoder.java
View file @
dd4d4e8f
...
...
@@ -24,13 +24,21 @@ import java.nio.ByteBuffer;
*/
/* package */
class
VpxDecoder
{
private
final
long
vpxDecContext
;
private
static
final
boolean
IS_AVAILABLE
;
static
{
boolean
isAvailable
;
try
{
System
.
loadLibrary
(
"vpx"
);
System
.
loadLibrary
(
"vpxJNI"
);
isAvailable
=
true
;
}
catch
(
UnsatisfiedLinkError
exception
)
{
isAvailable
=
false
;
}
IS_AVAILABLE
=
isAvailable
;
}
private
final
long
vpxDecContext
;
/**
* Creates the VP9 Decoder.
*
...
...
@@ -70,6 +78,13 @@ import java.nio.ByteBuffer;
}
/**
* Returns whether the underlying libvpx library is available.
*/
public
static
boolean
isLibvpxAvailable
()
{
return
IS_AVAILABLE
;
}
/**
* Returns the version string of the underlying libvpx decoder.
*/
public
static
native
String
getLibvpxVersion
();
...
...
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