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
c667feca
authored
Nov 27, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Get the physical display resolution if possible.
Issue: #800
parent
c62e535c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
library/src/main/java/com/google/android/exoplayer/chunk/VideoFormatSelectorUtil.java
library/src/main/java/com/google/android/exoplayer/chunk/VideoFormatSelectorUtil.java
View file @
c667feca
...
@@ -193,7 +193,7 @@ public final class VideoFormatSelectorUtil {
...
@@ -193,7 +193,7 @@ public final class VideoFormatSelectorUtil {
// Before API 23 the platform Display object does not provide a way to identify Android TVs that
// Before API 23 the platform Display object does not provide a way to identify Android TVs that
// can show 4k resolution in a SurfaceView, so check for supported devices here.
// can show 4k resolution in a SurfaceView, so check for supported devices here.
// See also https://developer.sony.com/develop/tvs/android-tv/design-guide/.
// See also https://developer.sony.com/develop/tvs/android-tv/design-guide/.
if
(
Util
.
MODEL
!=
null
&&
Util
.
MODEL
.
startsWith
(
"BRAVIA"
)
if
(
Util
.
SDK_INT
<
23
&&
Util
.
MODEL
!=
null
&&
Util
.
MODEL
.
startsWith
(
"BRAVIA"
)
&&
context
.
getPackageManager
().
hasSystemFeature
(
"com.sony.dtv.hardware.panel.qfhd"
))
{
&&
context
.
getPackageManager
().
hasSystemFeature
(
"com.sony.dtv.hardware.panel.qfhd"
))
{
return
new
Point
(
3840
,
2160
);
return
new
Point
(
3840
,
2160
);
}
}
...
@@ -204,7 +204,9 @@ public final class VideoFormatSelectorUtil {
...
@@ -204,7 +204,9 @@ public final class VideoFormatSelectorUtil {
private
static
Point
getDisplaySize
(
Display
display
)
{
private
static
Point
getDisplaySize
(
Display
display
)
{
Point
displaySize
=
new
Point
();
Point
displaySize
=
new
Point
();
if
(
Util
.
SDK_INT
>=
17
)
{
if
(
Util
.
SDK_INT
>=
23
)
{
getDisplaySizeV23
(
display
,
displaySize
);
}
else
if
(
Util
.
SDK_INT
>=
17
)
{
getDisplaySizeV17
(
display
,
displaySize
);
getDisplaySizeV17
(
display
,
displaySize
);
}
else
if
(
Util
.
SDK_INT
>=
16
)
{
}
else
if
(
Util
.
SDK_INT
>=
16
)
{
getDisplaySizeV16
(
display
,
displaySize
);
getDisplaySizeV16
(
display
,
displaySize
);
...
@@ -214,6 +216,13 @@ public final class VideoFormatSelectorUtil {
...
@@ -214,6 +216,13 @@ public final class VideoFormatSelectorUtil {
return
displaySize
;
return
displaySize
;
}
}
@TargetApi
(
23
)
private
static
void
getDisplaySizeV23
(
Display
display
,
Point
outSize
)
{
Display
.
Mode
mode
=
display
.
getMode
();
outSize
.
x
=
mode
.
getPhysicalWidth
();
outSize
.
y
=
mode
.
getPhysicalHeight
();
}
@TargetApi
(
17
)
@TargetApi
(
17
)
private
static
void
getDisplaySizeV17
(
Display
display
,
Point
outSize
)
{
private
static
void
getDisplaySizeV17
(
Display
display
,
Point
outSize
)
{
display
.
getRealSize
(
outSize
);
display
.
getRealSize
(
outSize
);
...
...
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