[Android] [PATCH 2/3] libvlcjni: remove eventVideoPlayerActivityCreated

Thomas Guillem thomas at gllm.fr
Wed Apr 8 17:30:17 CEST 2015


---
 libvlc/jni/vout.c                                          | 14 --------------
 libvlc/src/org/videolan/libvlc/LibVLC.java                 |  2 --
 .../org/videolan/vlc/gui/video/VideoPlayerActivity.java    |  6 ------
 3 files changed, 22 deletions(-)

diff --git a/libvlc/jni/vout.c b/libvlc/jni/vout.c
index 19c2a73..da88952 100644
--- a/libvlc/jni/vout.c
+++ b/libvlc/jni/vout.c
@@ -30,7 +30,6 @@ pthread_mutex_t vout_android_lock;
 static void *vout_android_gui = NULL;
 static jobject vout_android_java_surf = NULL;
 static jobject vout_android_subtitles_surf = NULL;
-static bool vout_video_player_activity_created = false;
 
 void *jni_LockAndGetSubtitlesSurface() {
     pthread_mutex_lock(&vout_android_lock);
@@ -162,19 +161,6 @@ int jni_ConfigureSurface(jobject jsurf, int width, int height, int hal, bool *co
     return ret == -1 ? -1 : 0;
 }
 
-bool jni_IsVideoPlayerActivityCreated() {
-    pthread_mutex_lock(&vout_android_lock);
-    bool result = vout_video_player_activity_created;
-    pthread_mutex_unlock(&vout_android_lock);
-    return result;
-}
-
-void Java_org_videolan_libvlc_LibVLC_eventVideoPlayerActivityCreated(JNIEnv *env, jobject thiz, jboolean created) {
-    pthread_mutex_lock(&vout_android_lock);
-    vout_video_player_activity_created = created;
-    pthread_mutex_unlock(&vout_android_lock);
-}
-
 void Java_org_videolan_libvlc_LibVLC_attachSurface(JNIEnv *env, jobject thiz, jobject surf, jobject gui) {
     pthread_mutex_lock(&vout_android_lock);
 
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 2712414..2f4d6f6 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -103,8 +103,6 @@ public class LibVLC {
     public native void attachSubtitlesSurface(Surface surface);
     public native void detachSubtitlesSurface();
 
-    public native void eventVideoPlayerActivityCreated(boolean created);
-
     /* Load library before object instantiation */
     static {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD_MR1) {
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 0527e82..64ecba6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -671,10 +671,6 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
         final EventHandler em = EventHandler.getInstance();
         em.addHandler(mEventHandler);
 
-        // Signal to LibVLC that the videoPlayerActivity was created, thus the
-        // SurfaceView is now available for MediaCodec direct rendering.
-        mLibVLC.eventVideoPlayerActivityCreated(true);
-
         loadMedia();
 
         // Add any selected subtitle file from the file picker
@@ -766,8 +762,6 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
 
         Util.commitPreferences(editor);
 
-        // MediaCodec opaque direct rendering should not be used anymore since there is no surface to attach.
-        mLibVLC.eventVideoPlayerActivityCreated(false);
         // HW acceleration was temporarily disabled because of an error, restore the previous value.
         if (mDisabledHardwareAcceleration)
             mLibVLC.setHardwareAcceleration(mPreviousHardwareAccelerationMode);
-- 
2.1.3



More information about the Android mailing list