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
47d8b7ff
authored
Dec 18, 2016
by
Drew Hill
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
get source dimensions from plane stored in subs
parent
5d0501be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
library/src/main/java/com/google/android/exoplayer2/text/ImageCue.java
library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java
library/src/main/java/com/google/android/exoplayer2/text/ImageCue.java
View file @
47d8b7ff
...
@@ -7,19 +7,25 @@ public class ImageCue extends Cue {
...
@@ -7,19 +7,25 @@ public class ImageCue extends Cue {
final
private
long
start_display_time
;
final
private
long
start_display_time
;
final
private
int
x
;
final
private
int
x
;
final
private
int
y
;
final
private
int
y
;
final
private
int
height
;
final
private
int
bitmap_height
;
final
private
int
width
;
final
private
int
bitmap_width
;
final
private
int
plane_height
;
final
private
int
plane_width
;
final
private
Bitmap
bitmap
;
final
private
Bitmap
bitmap
;
final
private
boolean
isForced
;
final
private
boolean
isForced
;
public
ImageCue
(
Bitmap
bitmap
,
long
start_display_time
,
int
x
,
int
y
,
int
width
,
int
height
,
boolean
isForced
)
{
public
ImageCue
(
Bitmap
bitmap
,
long
start_display_time
,
int
x
,
int
y
,
int
bitmap_width
,
int
bitmap_height
,
boolean
isForced
,
int
plane_width
,
int
plane_height
)
{
super
(
""
);
super
(
""
);
this
.
bitmap
=
bitmap
;
this
.
bitmap
=
bitmap
;
this
.
start_display_time
=
start_display_time
;
this
.
start_display_time
=
start_display_time
;
this
.
x
=
x
;
this
.
x
=
x
;
this
.
y
=
y
;
this
.
y
=
y
;
this
.
width
=
width
;
this
.
bitmap_width
=
bitmap_width
;
this
.
height
=
height
;
this
.
bitmap_height
=
bitmap_height
;
this
.
plane_width
=
plane_width
;
this
.
plane_height
=
plane_height
;
this
.
isForced
=
isForced
;
this
.
isForced
=
isForced
;
}
}
...
@@ -27,7 +33,9 @@ public class ImageCue extends Cue {
...
@@ -27,7 +33,9 @@ public class ImageCue extends Cue {
public
Bitmap
getBitmap
()
{
return
bitmap
;
}
public
Bitmap
getBitmap
()
{
return
bitmap
;
}
public
int
getX
()
{
return
x
;
}
public
int
getX
()
{
return
x
;
}
public
int
getY
()
{
return
y
;
}
public
int
getY
()
{
return
y
;
}
public
int
getWidth
()
{
return
width
;
}
public
int
getBitmapWidth
()
{
return
bitmap_width
;
}
public
int
getHeight
()
{
return
height
;
}
public
int
getBitmapHeight
()
{
return
bitmap_height
;
}
public
int
getPlaneWidth
()
{
return
plane_width
;
}
public
int
getPlaneHeight
()
{
return
plane_height
;
}
public
boolean
isForcedSubtitle
()
{
return
isForced
;
}
public
boolean
isForcedSubtitle
()
{
return
isForced
;
}
}
}
library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java
View file @
47d8b7ff
...
@@ -614,10 +614,6 @@ public final class SimpleExoPlayerView extends FrameLayout {
...
@@ -614,10 +614,6 @@ public final class SimpleExoPlayerView extends FrameLayout {
private
final
class
ComponentListener
implements
SimpleExoPlayer
.
VideoListener
,
private
final
class
ComponentListener
implements
SimpleExoPlayer
.
VideoListener
,
TextRenderer
.
Output
,
ExoPlayer
.
EventListener
{
TextRenderer
.
Output
,
ExoPlayer
.
EventListener
{
private
int
sourceWidth
=
0
;
private
int
sourceHeight
=
0
;
// TextRenderer.Output implementation
// TextRenderer.Output implementation
@Override
@Override
...
@@ -648,10 +644,12 @@ public final class SimpleExoPlayerView extends FrameLayout {
...
@@ -648,10 +644,12 @@ public final class SimpleExoPlayerView extends FrameLayout {
int
surfaceAnchorY
=
(
int
)
surfaceView
.
getY
();
int
surfaceAnchorY
=
(
int
)
surfaceView
.
getY
();
int
surfaceWidth
=
surfaceView
.
getWidth
();
int
surfaceWidth
=
surfaceView
.
getWidth
();
int
surfaceHeight
=
surfaceView
.
getHeight
();
int
surfaceHeight
=
surfaceView
.
getHeight
();
int
sourceWidth
=
cue
.
getPlaneWidth
();
int
sourceHeight
=
cue
.
getPlaneHeight
();
int
subAnchorX
=
cue
.
getX
();
int
subAnchorX
=
cue
.
getX
();
int
subAnchorY
=
cue
.
getY
();
int
subAnchorY
=
cue
.
getY
();
int
subScaleWidth
=
cue
.
getWidth
();
int
subScaleWidth
=
cue
.
get
Bitmap
Width
();
int
subScaleHeight
=
cue
.
getHeight
();
int
subScaleHeight
=
cue
.
get
Bitmap
Height
();
// they should change together as we keep the aspect ratio
// they should change together as we keep the aspect ratio
if
((
surfaceHeight
!=
sourceHeight
||
surfaceWidth
!=
sourceWidth
)
if
((
surfaceHeight
!=
sourceHeight
||
surfaceWidth
!=
sourceWidth
)
...
@@ -691,8 +689,6 @@ public final class SimpleExoPlayerView extends FrameLayout {
...
@@ -691,8 +689,6 @@ public final class SimpleExoPlayerView extends FrameLayout {
public
void
onVideoSizeChanged
(
int
width
,
int
height
,
int
unappliedRotationDegrees
,
public
void
onVideoSizeChanged
(
int
width
,
int
height
,
int
unappliedRotationDegrees
,
float
pixelWidthHeightRatio
)
{
float
pixelWidthHeightRatio
)
{
sourceWidth
=
width
;
sourceHeight
=
height
;
if
(
contentFrame
!=
null
)
{
if
(
contentFrame
!=
null
)
{
float
aspectRatio
=
height
==
0
?
1
:
(
width
*
pixelWidthHeightRatio
)
/
height
;
float
aspectRatio
=
height
==
0
?
1
:
(
width
*
pixelWidthHeightRatio
)
/
height
;
contentFrame
.
setAspectRatio
(
aspectRatio
);
contentFrame
.
setAspectRatio
(
aspectRatio
);
...
...
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