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
f62fa434
authored
Apr 26, 2019
by
andrewlewis
Committed by
Oliver Woodman
Apr 26, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Log warnings when extension libraries can't be used
Issue: #5788 PiperOrigin-RevId: 245440858
parent
b55e1758
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
RELEASENOTES.md
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegLibrary.java
library/core/src/main/java/com/google/android/exoplayer2/util/LibraryLoader.java
RELEASENOTES.md
View file @
f62fa434
...
@@ -115,6 +115,11 @@
...
@@ -115,6 +115,11 @@
order when in shuffle mode.
order when in shuffle mode.
*
Allow handling of custom commands via
`registerCustomCommandReceiver`
.
*
Allow handling of custom commands via
`registerCustomCommandReceiver`
.
*
Add ability to include an extras
`Bundle`
when reporting a custom error.
*
Add ability to include an extras
`Bundle`
when reporting a custom error.
*
LoadControl: Set minimum buffer for playbacks with video equal to maximum
buffer (
[
#2083
](
https://github.com/google/ExoPlayer/issues/2083
)
).
*
Log warnings when extension native libraries can't be used, to help with
diagnosing playback failures
(
[
#5788
](
https://github.com/google/ExoPlayer/issues/5788
)
).
### 2.9.6 ###
### 2.9.6 ###
...
...
extensions/ffmpeg/src/main/java/com/google/android/exoplayer2/ext/ffmpeg/FfmpegLibrary.java
View file @
f62fa434
...
@@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
...
@@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.util.LibraryLoader
;
import
com.google.android.exoplayer2.util.LibraryLoader
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.MimeTypes
;
/**
/**
...
@@ -30,6 +31,8 @@ public final class FfmpegLibrary {
...
@@ -30,6 +31,8 @@ public final class FfmpegLibrary {
ExoPlayerLibraryInfo
.
registerModule
(
"goog.exo.ffmpeg"
);
ExoPlayerLibraryInfo
.
registerModule
(
"goog.exo.ffmpeg"
);
}
}
private
static
final
String
TAG
=
"FfmpegLibrary"
;
private
static
final
LibraryLoader
LOADER
=
private
static
final
LibraryLoader
LOADER
=
new
LibraryLoader
(
"avutil"
,
"avresample"
,
"avcodec"
,
"ffmpeg"
);
new
LibraryLoader
(
"avutil"
,
"avresample"
,
"avcodec"
,
"ffmpeg"
);
...
@@ -69,7 +72,14 @@ public final class FfmpegLibrary {
...
@@ -69,7 +72,14 @@ public final class FfmpegLibrary {
return
false
;
return
false
;
}
}
String
codecName
=
getCodecName
(
mimeType
,
encoding
);
String
codecName
=
getCodecName
(
mimeType
,
encoding
);
return
codecName
!=
null
&&
ffmpegHasDecoder
(
codecName
);
if
(
codecName
==
null
)
{
return
false
;
}
if
(!
ffmpegHasDecoder
(
codecName
))
{
Log
.
w
(
TAG
,
"No "
+
codecName
+
" decoder available. Check the FFmpeg build configuration."
);
return
false
;
}
return
true
;
}
}
/**
/**
...
...
library/core/src/main/java/com/google/android/exoplayer2/util/LibraryLoader.java
View file @
f62fa434
...
@@ -15,11 +15,15 @@
...
@@ -15,11 +15,15 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
util
;
package
com
.
google
.
android
.
exoplayer2
.
util
;
import
java.util.Arrays
;
/**
/**
* Configurable loader for native libraries.
* Configurable loader for native libraries.
*/
*/
public
final
class
LibraryLoader
{
public
final
class
LibraryLoader
{
private
static
final
String
TAG
=
"LibraryLoader"
;
private
String
[]
nativeLibraries
;
private
String
[]
nativeLibraries
;
private
boolean
loadAttempted
;
private
boolean
loadAttempted
;
private
boolean
isAvailable
;
private
boolean
isAvailable
;
...
@@ -54,7 +58,9 @@ public final class LibraryLoader {
...
@@ -54,7 +58,9 @@ public final class LibraryLoader {
}
}
isAvailable
=
true
;
isAvailable
=
true
;
}
catch
(
UnsatisfiedLinkError
exception
)
{
}
catch
(
UnsatisfiedLinkError
exception
)
{
// Do nothing.
// Log a warning as an attempt to check for the library indicates that the app depends on an
// extension and generally would expect its native libraries to be available.
Log
.
w
(
TAG
,
"Failed to load "
+
Arrays
.
toString
(
nativeLibraries
));
}
}
return
isAvailable
;
return
isAvailable
;
}
}
...
...
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