[Android] LibVlc: AWindow: add setters for SurfaceTexture
Thomas Guillem
git at videolan.org
Wed Jul 29 08:57:15 CEST 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 29 08:56:54 2015 +0200| [87263b5bfa4ca826fc7c28d28da0d7a4c9f5858c] | committer: Thomas Guillem
LibVlc: AWindow: add setters for SurfaceTexture
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=87263b5bfa4ca826fc7c28d28da0d7a4c9f5858c
---
libvlc/src/org/videolan/libvlc/AWindow.java | 12 ++++++++++++
libvlc/src/org/videolan/libvlc/IVLCVout.java | 21 ++++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/libvlc/src/org/videolan/libvlc/AWindow.java b/libvlc/src/org/videolan/libvlc/AWindow.java
index ce8e193..4cf582f 100644
--- a/libvlc/src/org/videolan/libvlc/AWindow.java
+++ b/libvlc/src/org/videolan/libvlc/AWindow.java
@@ -271,6 +271,12 @@ class AWindow implements IAWindowNativeHandler, IVLCVout {
}
@Override
+ @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+ public void setVideoSurface(SurfaceTexture videoSurfaceTexture) {
+ setSurface(ID_VIDEO, new Surface(videoSurfaceTexture), null);
+ }
+
+ @Override
@MainThread
public void setSubtitlesView(SurfaceView subtitlesSurfaceView) {
setView(ID_SUBTITLES, subtitlesSurfaceView);
@@ -288,6 +294,12 @@ class AWindow implements IAWindowNativeHandler, IVLCVout {
}
@Override
+ @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+ public void setSubtitlesSurface(SurfaceTexture subtitlesSurfaceTexture) {
+ setSurface(ID_SUBTITLES, new Surface(subtitlesSurfaceTexture), null);
+ }
+
+ @Override
@MainThread
public void attachViews() {
if (mSurfacesState.get() != SURFACE_STATE_INIT || mSurfaceHelpers[ID_VIDEO] == null)
diff --git a/libvlc/src/org/videolan/libvlc/IVLCVout.java b/libvlc/src/org/videolan/libvlc/IVLCVout.java
index 01c7056..f21b2bc 100644
--- a/libvlc/src/org/videolan/libvlc/IVLCVout.java
+++ b/libvlc/src/org/videolan/libvlc/IVLCVout.java
@@ -21,6 +21,7 @@
package org.videolan.libvlc;
import android.annotation.TargetApi;
+import android.graphics.SurfaceTexture;
import android.os.Build;
import android.support.annotation.MainThread;
import android.view.Surface;
@@ -84,6 +85,15 @@ public interface IVLCVout {
void setVideoSurface(Surface videoSurface, SurfaceHolder surfaceHolder);
/**
+ * Set a SurfaceTexture used for video out.
+ * @param videoSurfaceTexture this surface must be valid and attached.
+ * @see #attachViews()
+ */
+ @MainThread
+ @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+ void setVideoSurface(SurfaceTexture videoSurfaceTexture);
+
+ /**
* Set a surfaceView used for subtitles out.
* @see #attachViews()
*/
@@ -99,7 +109,7 @@ public interface IVLCVout {
void setSubtitlesView(TextureView subtitlesTextureView);
/**
- * Set a surface used for video out.
+ * Set a surface used for subtitles out.
* @param subtitlesSurface if surfaceHolder is null, this surface must be valid and attached.
* @param surfaceHolder optional, used to configure buffers geometry before Android ICS
* and to get notified when surface is destroyed.
@@ -109,6 +119,15 @@ public interface IVLCVout {
void setSubtitlesSurface(Surface subtitlesSurface, SurfaceHolder surfaceHolder);
/**
+ * Set a SurfaceTexture used for subtitles out.
+ * @param subtitlesSurfaceTexture this surface must be valid and attached.
+ * @see #attachViews()
+ */
+ @MainThread
+ @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+ void setSubtitlesSurface(SurfaceTexture subtitlesSurfaceTexture);
+
+ /**
* Attach views previously set by setVideoView, setSubtitlesView, setVideoSurface, setSubtitleSurface
* @see #setVideoView(SurfaceView)
* @see #setVideoView(TextureView)
More information about the Android
mailing list