[vlc-devel] [PATCH] LibVLC/AWindow: add methods manage SurfaceTexture

Marvin Scholz epirat07 at gmail.com
Thu Apr 9 16:52:03 CEST 2020


On 6 Apr 2020, at 11:51, Louis Regnier wrote:

> In the NDK API, the onFrameAvailableListener callback doesnt exist and
> we cannot use the Java one without relying on JNI again, which defeat
> the purpose of the patchset.
>
> In any case, the listener doesn't seem useful as the updateTexImage is 
> called
> after the frame has been written and the matching vlc picture has been 
> sent by
> the decoder and received in the display.
>
> refs videolan/vlc#20344

Nitpick: I think this should just reference the issue number without the
videolan/vlc prefix

> ---
>  libvlc/src/org/videolan/libvlc/AWindow.java | 24 
> +++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/libvlc/src/org/videolan/libvlc/AWindow.java 
> b/libvlc/src/org/videolan/libvlc/AWindow.java
> index 6bdcd77bf..4fbe0e2c0 100644
> --- a/libvlc/src/org/videolan/libvlc/AWindow.java
> +++ b/libvlc/src/org/videolan/libvlc/AWindow.java
> @@ -690,6 +690,14 @@ public class AWindow implements IVLCVout {
>              return mSurface;
>          }
>
> +        private synchronized SurfaceTexture getSurfaceTexture() {
> +            return mSurfaceTexture;
> +        }
> +
> +        private synchronized void removeFrameAvailableListener() {
> +            mSurfaceTexture.setOnFrameAvailableListener(null);
> +        }
> +
>          private synchronized void release() {
>              if (mSurfaceTexture != null) {
>                  if (mIsAttached) {
> @@ -741,4 +749,20 @@ public class AWindow implements IVLCVout {
>      private Surface SurfaceTexture_getSurface() {
>          return mSurfaceTextureThread.getSurface();
>      }
> +
> +    /**
> +     * Get SurfaceTexture
> +     */
> +    @SuppressWarnings("unused") /* used by JNI */
> +    private SurfaceTexture SurfaceTexture_getSurfaceTexture() {
> +        return mSurfaceTextureThread.getSurfaceTexture();
> +    }
> +
> +    /**
> +     * Remove frameAvailableListener
> +     */
> +    @SuppressWarnings("unused") /* used by JNI */
> +    private void SurfaceTexture_removeFrameAvailableListener() {
> +        mSurfaceTextureThread.removeFrameAvailableListener();
> +    }
>  }
> -- 
> 2.26.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list