Commit 6cb263e6 authored by Thomas Guillem's avatar Thomas Guillem

jni: add jni_GetWindowSize

return the up to date window width and height.
parent a8cccc77
......@@ -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;
}
......@@ -883,4 +883,5 @@ public class LibVLC {
public native String getMeta(int meta);
public native int setWindowSize(int width, int height);
}
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment