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
773e8907
authored
Nov 04, 2020
by
olly
Committed by
Andrew Lewis
Nov 06, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move another adaptation workaround into MediaCodecInfo
PiperOrigin-RevId: 340654217
parent
effbc22a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
17 deletions
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
View file @
773e8907
...
@@ -179,7 +179,10 @@ public final class MediaCodecInfo {
...
@@ -179,7 +179,10 @@ public final class MediaCodecInfo {
hardwareAccelerated
,
hardwareAccelerated
,
softwareOnly
,
softwareOnly
,
vendor
,
vendor
,
/* adaptive= */
!
forceDisableAdaptive
&&
capabilities
!=
null
&&
isAdaptive
(
capabilities
),
/* adaptive= */
!
forceDisableAdaptive
&&
capabilities
!=
null
&&
isAdaptive
(
capabilities
)
&&
!
needsDisableAdaptationWorkaround
(
name
),
/* tunneling= */
capabilities
!=
null
&&
isTunneling
(
capabilities
),
/* tunneling= */
capabilities
!=
null
&&
isTunneling
(
capabilities
),
/* secure= */
forceSecure
||
(
capabilities
!=
null
&&
isSecure
(
capabilities
)));
/* secure= */
forceSecure
||
(
capabilities
!=
null
&&
isSecure
(
capabilities
)));
}
}
...
@@ -654,6 +657,19 @@ public final class MediaCodecInfo {
...
@@ -654,6 +657,19 @@ public final class MediaCodecInfo {
}
}
/**
/**
* Returns whether the decoder is known to fail when adapting, despite advertising itself as an
* adaptive decoder.
*
* @param name The decoder name.
* @return True if the decoder is known to fail when adapting.
*/
private
static
boolean
needsDisableAdaptationWorkaround
(
String
name
)
{
return
Util
.
SDK_INT
<=
22
&&
(
"ODROID-XU3"
.
equals
(
Util
.
MODEL
)
||
"Nexus 10"
.
equals
(
Util
.
MODEL
))
&&
(
"OMX.Exynos.AVC.Decoder"
.
equals
(
name
)
||
"OMX.Exynos.AVC.Decoder.secure"
.
equals
(
name
));
}
/**
* Returns whether the decoder is known to fail when an attempt is made to reconfigure it with a
* Returns whether the decoder is known to fail when an attempt is made to reconfigure it with a
* new format's configuration data.
* new format's configuration data.
*
*
...
...
library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java
View file @
773e8907
...
@@ -312,7 +312,6 @@ public final class MediaCodecUtil {
...
@@ -312,7 +312,6 @@ public final class MediaCodecUtil {
boolean
hardwareAccelerated
=
isHardwareAccelerated
(
codecInfo
);
boolean
hardwareAccelerated
=
isHardwareAccelerated
(
codecInfo
);
boolean
softwareOnly
=
isSoftwareOnly
(
codecInfo
);
boolean
softwareOnly
=
isSoftwareOnly
(
codecInfo
);
boolean
vendor
=
isVendor
(
codecInfo
);
boolean
vendor
=
isVendor
(
codecInfo
);
boolean
forceDisableAdaptive
=
codecNeedsDisableAdaptationWorkaround
(
name
);
if
((
secureDecodersExplicit
&&
key
.
secure
==
secureSupported
)
if
((
secureDecodersExplicit
&&
key
.
secure
==
secureSupported
)
||
(!
secureDecodersExplicit
&&
!
key
.
secure
))
{
||
(!
secureDecodersExplicit
&&
!
key
.
secure
))
{
decoderInfos
.
add
(
decoderInfos
.
add
(
...
@@ -324,7 +323,7 @@ public final class MediaCodecUtil {
...
@@ -324,7 +323,7 @@ public final class MediaCodecUtil {
hardwareAccelerated
,
hardwareAccelerated
,
softwareOnly
,
softwareOnly
,
vendor
,
vendor
,
forceDisableAdaptiv
e
,
/* forceDisableAdaptive= */
fals
e
,
/* forceSecure= */
false
));
/* forceSecure= */
false
));
}
else
if
(!
secureDecodersExplicit
&&
secureSupported
)
{
}
else
if
(!
secureDecodersExplicit
&&
secureSupported
)
{
decoderInfos
.
add
(
decoderInfos
.
add
(
...
@@ -336,7 +335,7 @@ public final class MediaCodecUtil {
...
@@ -336,7 +335,7 @@ public final class MediaCodecUtil {
hardwareAccelerated
,
hardwareAccelerated
,
softwareOnly
,
softwareOnly
,
vendor
,
vendor
,
forceDisableAdaptiv
e
,
/* forceDisableAdaptive= */
fals
e
,
/* forceSecure= */
true
));
/* forceSecure= */
true
));
// It only makes sense to have one synthesized secure decoder, return immediately.
// It only makes sense to have one synthesized secure decoder, return immediately.
return
decoderInfos
;
return
decoderInfos
;
...
@@ -651,19 +650,6 @@ public final class MediaCodecUtil {
...
@@ -651,19 +650,6 @@ public final class MediaCodecUtil {
return
codecInfo
.
isVendor
();
return
codecInfo
.
isVendor
();
}
}
/**
* Returns whether the decoder is known to fail when adapting, despite advertising itself as an
* adaptive decoder.
*
* @param name The decoder name.
* @return True if the decoder is known to fail when adapting.
*/
private
static
boolean
codecNeedsDisableAdaptationWorkaround
(
String
name
)
{
return
Util
.
SDK_INT
<=
22
&&
(
"ODROID-XU3"
.
equals
(
Util
.
MODEL
)
||
"Nexus 10"
.
equals
(
Util
.
MODEL
))
&&
(
"OMX.Exynos.AVC.Decoder"
.
equals
(
name
)
||
"OMX.Exynos.AVC.Decoder.secure"
.
equals
(
name
));
}
@Nullable
@Nullable
private
static
Pair
<
Integer
,
Integer
>
getDolbyVisionProfileAndLevel
(
private
static
Pair
<
Integer
,
Integer
>
getDolbyVisionProfileAndLevel
(
String
codec
,
String
[]
parts
)
{
String
codec
,
String
[]
parts
)
{
...
...
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