Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
dd5da98e
Commit
dd5da98e
authored
Mar 04, 2012
by
Sébastien Toque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a best fit mode and use it as default
parent
23d93b9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
vlc-android/res/values-fr/strings.xml
vlc-android/res/values-fr/strings.xml
+1
-0
vlc-android/res/values/strings.xml
vlc-android/res/values/strings.xml
+1
-0
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
...d/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+17
-7
No files found.
vlc-android/res/values-fr/strings.xml
View file @
dd5da98e
...
...
@@ -53,6 +53,7 @@
<string
name=
"validation"
>
Etes-vous sûr ?
</string>
<string
name=
"locked"
>
Verrouillé
</string>
<string
name=
"unlocked"
>
Déverrouillé
</string>
<string
name=
"surface_best_fit"
>
Ajuster au mieux
</string>
<string
name=
"surface_fit_horizontal"
>
Ajuster horizontalement
</string>
<string
name=
"surface_fit_vertical"
>
Ajuster verticalement
</string>
<string
name=
"surface_fill"
>
Etirer
</string>
...
...
vlc-android/res/values/strings.xml
View file @
dd5da98e
...
...
@@ -54,6 +54,7 @@
<string
name=
"validation"
>
Are you sure?
</string>
<string
name=
"locked"
>
Locked
</string>
<string
name=
"unlocked"
>
Unlocked
</string>
<string
name=
"surface_best_fit"
>
Best fit
</string>
<string
name=
"surface_fit_horizontal"
>
Fit horizontal
</string>
<string
name=
"surface_fit_vertical"
>
Fit vertical
</string>
<string
name=
"surface_fill"
>
Fill
</string>
...
...
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
View file @
dd5da98e
...
...
@@ -73,13 +73,14 @@ public class VideoPlayerActivity extends Activity {
private
SurfaceHolder
mSurfaceHolder
;
private
LibVLC
mLibVLC
;
private
static
final
int
SURFACE_FIT_HORIZONTAL
=
0
;
private
static
final
int
SURFACE_FIT_VERTICAL
=
1
;
private
static
final
int
SURFACE_FILL
=
2
;
private
static
final
int
SURFACE_16_9
=
3
;
private
static
final
int
SURFACE_4_3
=
4
;
private
static
final
int
SURFACE_ORIGINAL
=
5
;
private
int
mCurrentSize
=
SURFACE_FIT_HORIZONTAL
;
private
static
final
int
SURFACE_BEST_FIT
=
0
;
private
static
final
int
SURFACE_FIT_HORIZONTAL
=
1
;
private
static
final
int
SURFACE_FIT_VERTICAL
=
2
;
private
static
final
int
SURFACE_FILL
=
3
;
private
static
final
int
SURFACE_16_9
=
4
;
private
static
final
int
SURFACE_4_3
=
5
;
private
static
final
int
SURFACE_ORIGINAL
=
6
;
private
int
mCurrentSize
=
SURFACE_BEST_FIT
;
/** Overlay */
private
View
mOverlayHeader
;
...
...
@@ -403,6 +404,12 @@ public class VideoPlayerActivity extends Activity {
double
dar
=
(
double
)
dw
/
(
double
)
dh
;
switch
(
mCurrentSize
)
{
case
SURFACE_BEST_FIT:
if
(
dar
<
ar
)
dh
=
(
int
)
(
dw
/
ar
);
else
dw
=
(
int
)
(
dh
*
ar
);
break
;
case
SURFACE_FIT_HORIZONTAL:
dh
=
(
int
)
(
dw
/
ar
);
break
;
...
...
@@ -608,6 +615,9 @@ public class VideoPlayerActivity extends Activity {
}
changeSurfaceSize
();
switch
(
mCurrentSize
)
{
case
SURFACE_BEST_FIT:
showInfo
(
R
.
string
.
surface_best_fit
,
500
);
break
;
case
SURFACE_FIT_HORIZONTAL:
showInfo
(
R
.
string
.
surface_fit_horizontal
,
500
);
break
;
...
...
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