• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <android/surface_texture_jni.h>
18 #include <surfacetexture/surface_texture_platform.h>
19 
20 using namespace android;
21 
ASurfaceTexture_acquireANativeWindow(ASurfaceTexture * st)22 ANativeWindow* ASurfaceTexture_acquireANativeWindow(ASurfaceTexture* st) {
23     return ASurfaceTexture_routeAcquireANativeWindow(st);
24 }
25 
ASurfaceTexture_attachToGLContext(ASurfaceTexture * st,uint32_t texName)26 int ASurfaceTexture_attachToGLContext(ASurfaceTexture* st, uint32_t texName) {
27     return ASurfaceTexture_routeAttachToGLContext(st, texName);
28 }
29 
ASurfaceTexture_detachFromGLContext(ASurfaceTexture * st)30 int ASurfaceTexture_detachFromGLContext(ASurfaceTexture* st) {
31     return ASurfaceTexture_routeDetachFromGLContext(st);
32 }
33 
ASurfaceTexture_release(ASurfaceTexture * st)34 void ASurfaceTexture_release(ASurfaceTexture* st) {
35     return ASurfaceTexture_routeRelease(st);
36 }
37 
ASurfaceTexture_updateTexImage(ASurfaceTexture * st)38 int ASurfaceTexture_updateTexImage(ASurfaceTexture* st) {
39     return ASurfaceTexture_routeUpdateTexImage(st);
40 }
41 
ASurfaceTexture_getTransformMatrix(ASurfaceTexture * st,float mtx[16])42 void ASurfaceTexture_getTransformMatrix(ASurfaceTexture* st, float mtx[16]) {
43     return ASurfaceTexture_routeGetTransformMatrix(st, mtx);
44 }
45 
ASurfaceTexture_getTimestamp(ASurfaceTexture * st)46 int64_t ASurfaceTexture_getTimestamp(ASurfaceTexture* st) {
47     return ASurfaceTexture_routeGetTimestamp(st);
48 }
49 
ASurfaceTexture_fromSurfaceTexture(JNIEnv * env,jobject surfacetexture)50 ASurfaceTexture* ASurfaceTexture_fromSurfaceTexture(JNIEnv* env, jobject surfacetexture) {
51     return ASurfaceTexture_routeFromSurfaceTexture(env, surfacetexture);
52 }
53