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
bb851c99
authored
Oct 14, 2020
by
krocard
Committed by
Oliver Woodman
Oct 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add MiTV devices requiring the output surface workaround
Issue: #8014 PiperOrigin-RevId: 337142176
parent
75513e58
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
39 deletions
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java
View file @
bb851c99
...
@@ -1525,19 +1525,55 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -1525,19 +1525,55 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
}
}
synchronized
(
MediaCodecVideoRenderer
.
class
)
{
synchronized
(
MediaCodecVideoRenderer
.
class
)
{
if
(!
evaluatedDeviceNeedsSetOutputSurfaceWorkaround
)
{
if
(!
evaluatedDeviceNeedsSetOutputSurfaceWorkaround
)
{
if
(
"dangal"
.
equals
(
Util
.
DEVICE
))
{
deviceNeedsSetOutputSurfaceWorkaround
=
evaluateDeviceNeedsSetOutputSurfaceWorkaround
();
// Workaround for MiTV devices:
evaluatedDeviceNeedsSetOutputSurfaceWorkaround
=
true
;
}
}
return
deviceNeedsSetOutputSurfaceWorkaround
;
}
protected
Surface
getSurface
()
{
return
surface
;
}
protected
static
final
class
CodecMaxValues
{
public
final
int
width
;
public
final
int
height
;
public
final
int
inputSize
;
public
CodecMaxValues
(
int
width
,
int
height
,
int
inputSize
)
{
this
.
width
=
width
;
this
.
height
=
height
;
this
.
inputSize
=
inputSize
;
}
}
private
static
boolean
evaluateDeviceNeedsSetOutputSurfaceWorkaround
()
{
if
(
Util
.
SDK_INT
<=
28
)
{
// Workaround for MiTV devices which have been observed broken up to API 28.
// https://github.com/google/ExoPlayer/issues/5169,
// https://github.com/google/ExoPlayer/issues/5169,
// https://github.com/google/ExoPlayer/issues/6899.
// https://github.com/google/ExoPlayer/issues/6899.
deviceNeedsSetOutputSurfaceWorkaround
=
true
;
// https://github.com/google/ExoPlayer/issues/8014.
}
else
if
(
Util
.
SDK_INT
<=
27
&&
"HWEML"
.
equals
(
Util
.
DEVICE
))
{
switch
(
Util
.
DEVICE
)
{
case
"dangal"
:
case
"dangalUHD"
:
case
"dangalFHD"
:
case
"magnolia"
:
case
"machuca"
:
return
true
;
default
:
break
;
// Do nothing.
}
}
if
(
Util
.
SDK_INT
<=
27
&&
"HWEML"
.
equals
(
Util
.
DEVICE
))
{
// Workaround for Huawei P20:
// Workaround for Huawei P20:
// https://github.com/google/ExoPlayer/issues/4468#issuecomment-459291645.
// https://github.com/google/ExoPlayer/issues/4468#issuecomment-459291645.
deviceNeedsSetOutputSurfaceWorkaround
=
true
;
return
true
;
}
else
if
(
Util
.
SDK_INT
>=
27
)
{
}
// In general, devices running API level 27 or later should be unaffected. Do nothing.
if
(
Util
.
SDK_INT
<=
26
)
{
}
else
{
// In general, devices running API level 27 or later should be unaffected unless observed
//
Enable the workaround on a per-device basis. Works around:
// otherwise.
Enable the workaround on a per-device basis. Works around:
// https://github.com/google/ExoPlayer/issues/3236,
// https://github.com/google/ExoPlayer/issues/3236,
// https://github.com/google/ExoPlayer/issues/3355,
// https://github.com/google/ExoPlayer/issues/3355,
// https://github.com/google/ExoPlayer/issues/3439,
// https://github.com/google/ExoPlayer/issues/3439,
...
@@ -1553,6 +1589,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -1553,6 +1589,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
// https://github.com/google/ExoPlayer/issues/4468,
// https://github.com/google/ExoPlayer/issues/4468,
// https://github.com/google/ExoPlayer/issues/5312,
// https://github.com/google/ExoPlayer/issues/5312,
// https://github.com/google/ExoPlayer/issues/6503.
// https://github.com/google/ExoPlayer/issues/6503.
// https://github.com/google/ExoPlayer/issues/8014.
switch
(
Util
.
DEVICE
)
{
switch
(
Util
.
DEVICE
)
{
case
"1601"
:
case
"1601"
:
case
"1713"
:
case
"1713"
:
...
@@ -1639,6 +1676,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -1639,6 +1676,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
case
"p212"
:
case
"p212"
:
case
"P681"
:
case
"P681"
:
case
"P85"
:
case
"P85"
:
case
"pacificrim"
:
case
"panell_d"
:
case
"panell_d"
:
case
"panell_dl"
:
case
"panell_dl"
:
case
"panell_ds"
:
case
"panell_ds"
:
...
@@ -1682,45 +1720,20 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
...
@@ -1682,45 +1720,20 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
case
"XT1663"
:
case
"XT1663"
:
case
"Z12_PRO"
:
case
"Z12_PRO"
:
case
"Z80"
:
case
"Z80"
:
deviceNeedsSetOutputSurfaceWorkaround
=
true
;
return
true
;
break
;
default
:
default
:
// Do nothing.
break
;
// Do nothing.
break
;
}
}
switch
(
Util
.
MODEL
)
{
switch
(
Util
.
MODEL
)
{
case
"AFTA"
:
case
"AFTA"
:
case
"AFTN"
:
case
"AFTN"
:
case
"JSN-L21"
:
case
"JSN-L21"
:
deviceNeedsSetOutputSurfaceWorkaround
=
true
;
return
true
;
break
;
default
:
default
:
// Do nothing.
break
;
// Do nothing.
break
;
}
}
evaluatedDeviceNeedsSetOutputSurfaceWorkaround
=
true
;
}
}
return
deviceNeedsSetOutputSurfaceWorkaround
;
}
protected
Surface
getSurface
()
{
return
surface
;
}
}
protected
static
final
class
CodecMaxValues
{
public
final
int
width
;
public
final
int
height
;
public
final
int
inputSize
;
public
CodecMaxValues
(
int
width
,
int
height
,
int
inputSize
)
{
this
.
width
=
width
;
this
.
height
=
height
;
this
.
inputSize
=
inputSize
;
}
}
return
false
;
}
}
@RequiresApi
(
23
)
@RequiresApi
(
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