[Android] VideoPlayerActivity: do not add callbacks for local surfaces while in presentation mode

Felix Abecassis git at videolan.org
Thu Aug 28 14:27:31 CEST 2014


vlc-ports/android | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Thu Aug 28 14:19:46 2014 +0200| [4404cceff3064b6576f23c441e41655361cddd83] | committer: Felix Abecassis

VideoPlayerActivity: do not add callbacks for local surfaces while in presentation mode

Presentation mode did not work with the full HW acceleration mode
since MediaCodec was rendering to the local surface instead of the
remote surface.

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=4404cceff3064b6576f23c441e41655361cddd83
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 0a108cc..230d481 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -351,13 +351,15 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         } else {
             mSurfaceHolder.setFormat(PixelFormat.RGBX_8888);
         }
-        mSurfaceHolder.addCallback(mSurfaceCallback);
 
         mSubtitlesSurface = (SurfaceView) findViewById(R.id.subtitles_surface);
         mSubtitlesSurfaceHolder = mSubtitlesSurface.getHolder();
         mSubtitlesSurfaceHolder.setFormat(PixelFormat.RGBA_8888);
         mSubtitlesSurface.setZOrderMediaOverlay(true);
-        mSubtitlesSurfaceHolder.addCallback(mSubtitlesSurfaceCallback);
+        if (mPresentation == null) {
+            mSurfaceHolder.addCallback(mSurfaceCallback);
+            mSubtitlesSurfaceHolder.addCallback(mSubtitlesSurfaceCallback);
+        }
 
         mSeekbar = (SeekBar) findViewById(R.id.player_overlay_seekbar);
         mSeekbar.setOnSeekBarChangeListener(mSeekListener);



More information about the Android mailing list