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
6fe70ca4
authored
Jun 28, 2019
by
andrewlewis
Committed by
Oliver Woodman
Jul 02, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use the floor of the frame rate for capability checks
PiperOrigin-RevId: 255584000
parent
ae0aeb04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
View file @
6fe70ca4
...
...
@@ -520,9 +520,15 @@ public final class MediaCodecInfo {
@TargetApi
(
21
)
private
static
boolean
areSizeAndRateSupportedV21
(
VideoCapabilities
capabilities
,
int
width
,
int
height
,
double
frameRate
)
{
return
frameRate
==
Format
.
NO_VALUE
||
frameRate
<=
0
?
capabilities
.
isSizeSupported
(
width
,
height
)
:
capabilities
.
areSizeAndRateSupported
(
width
,
height
,
frameRate
);
if
(
frameRate
==
Format
.
NO_VALUE
||
frameRate
<=
0
)
{
return
capabilities
.
isSizeSupported
(
width
,
height
);
}
else
{
// The signaled frame rate may be slightly higher than the actual frame rate, so we take the
// floor to avoid situations where a range check in areSizeAndRateSupported fails due to
// slightly exceeding the limits for a standard format (e.g., 1080p at 30 fps).
double
floorFrameRate
=
Math
.
floor
(
frameRate
);
return
capabilities
.
areSizeAndRateSupported
(
width
,
height
,
floorFrameRate
);
}
}
@TargetApi
(
23
)
...
...
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