1 /* 2 * Copyright (C) 2015, Collabora Ltd. 3 * Author: Matthieu Bouron <matthieu.bouron@collabora.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation 8 * version 2.1 of the License. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 * 19 */ 20 21 package org.freedesktop.gstreamer.androidmedia; 22 23 import android.graphics.SurfaceTexture; 24 import android.graphics.SurfaceTexture.OnFrameAvailableListener; 25 26 public class GstAmcOnFrameAvailableListener implements OnFrameAvailableListener 27 { 28 private long context = 0; 29 onFrameAvailable(SurfaceTexture surfaceTexture)30 public synchronized void onFrameAvailable (SurfaceTexture surfaceTexture) { 31 native_onFrameAvailable(context, surfaceTexture); 32 } 33 getContext()34 public synchronized long getContext () { 35 return context; 36 } 37 setContext(long c)38 public synchronized void setContext (long c) { 39 context = c; 40 } 41 native_onFrameAvailable(long context, SurfaceTexture surfaceTexture)42 private native void native_onFrameAvailable (long context, SurfaceTexture surfaceTexture); 43 } 44