Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
6cb263e6
Commit
6cb263e6
authored
Nov 21, 2014
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jni: add jni_GetWindowSize
return the up to date window width and height.
parent
a8cccc77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
libvlc/jni/libvlcjni.c
libvlc/jni/libvlcjni.c
+20
-0
libvlc/src/org/videolan/libvlc/LibVLC.java
libvlc/src/org/videolan/libvlc/LibVLC.java
+1
-0
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
...d/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+2
-0
No files found.
libvlc/jni/libvlcjni.c
View file @
6cb263e6
...
...
@@ -646,3 +646,23 @@ void Java_org_videolan_libvlc_LibVLC_playerNavigate(JNIEnv *env, jobject thiz, j
libvlc_media_player_navigate
(
mp
,
(
unsigned
)
nav
);
}
// TODO: remove static variables
static
int
i_window_width
=
0
;
static
int
i_window_height
=
0
;
void
Java_org_videolan_libvlc_LibVLC_setWindowSize
(
JNIEnv
*
env
,
jobject
thiz
,
jint
width
,
jint
height
)
{
pthread_mutex_lock
(
&
vout_android_lock
);
i_window_width
=
width
;
i_window_height
=
height
;
pthread_mutex_unlock
(
&
vout_android_lock
);
}
int
jni_GetWindowSize
(
int
*
width
,
int
*
height
)
{
pthread_mutex_lock
(
&
vout_android_lock
);
*
width
=
i_window_width
;
*
height
=
i_window_height
;
pthread_mutex_unlock
(
&
vout_android_lock
);
return
0
;
}
libvlc/src/org/videolan/libvlc/LibVLC.java
View file @
6cb263e6
...
...
@@ -883,4 +883,5 @@ public class LibVLC {
public
native
String
getMeta
(
int
meta
);
public
native
int
setWindowSize
(
int
width
,
int
height
);
}
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
View file @
6cb263e6
...
...
@@ -1301,6 +1301,8 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
sw
=
mPresentation
.
getWindow
().
getDecorView
().
getWidth
();
sh
=
mPresentation
.
getWindow
().
getDecorView
().
getHeight
();
}
if
(
mLibVLC
!=
null
)
mLibVLC
.
setWindowSize
(
sw
,
sh
);
double
dw
=
sw
,
dh
=
sh
;
boolean
isPortrait
;
...
...
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