Lines Matching refs:env

54 static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz,
58 (GLConsumer*)env->GetLongField(thiz, fields.surfaceTexture);
65 env->SetLongField(thiz, fields.surfaceTexture, (jlong)surfaceTexture.get());
68 static void SurfaceTexture_setProducer(JNIEnv* env, jobject thiz,
72 (IGraphicBufferProducer*)env->GetLongField(thiz, fields.producer);
79 env->SetLongField(thiz, fields.producer, (jlong)producer.get());
82 static void SurfaceTexture_setFrameAvailableListener(JNIEnv* env,
87 env->GetLongField(thiz, fields.frameAvailableListener);
94 env->SetLongField(thiz, fields.frameAvailableListener, (jlong)listener.get());
97 sp<GLConsumer> SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz) {
98 return (GLConsumer*)env->GetLongField(thiz, fields.surfaceTexture);
101 sp<IGraphicBufferProducer> SurfaceTexture_getProducer(JNIEnv* env, jobject thiz) {
102 return (IGraphicBufferProducer*)env->GetLongField(thiz, fields.producer);
105 sp<ANativeWindow> android_SurfaceTexture_getNativeWindow(JNIEnv* env, jobject thiz) {
106 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
107 sp<IGraphicBufferProducer> producer(SurfaceTexture_getProducer(env, thiz));
112 bool android_SurfaceTexture_isInstanceOf(JNIEnv* env, jobject thiz) {
113 jclass surfaceTextureClass = env->FindClass(kSurfaceTextureClassPathName);
114 return env->IsInstanceOf(thiz, surfaceTextureClass);
122 JNISurfaceTextureContext(JNIEnv* env, jobject weakThiz, jclass clazz);
134 JNISurfaceTextureContext::JNISurfaceTextureContext(JNIEnv* env,
136 mWeakThiz(env->NewGlobalRef(weakThiz)),
137 mClazz((jclass)env->NewGlobalRef(clazz))
142 JNIEnv* env = AndroidRuntime::getJNIEnv();
143 if (env == NULL) {
147 int result = vm->AttachCurrentThread(&env, (void*) &args);
154 return env;
168 JNIEnv* env = getJNIEnv(&needsDetach);
169 if (env != NULL) {
170 env->DeleteGlobalRef(mWeakThiz);
171 env->DeleteGlobalRef(mClazz);
183 JNIEnv* env = getJNIEnv(&needsDetach);
184 if (env != NULL) {
185 env->CallStaticVoidMethod(mClazz, fields.postEvent, mWeakThiz);
202 static void SurfaceTexture_classInit(JNIEnv* env, jclass clazz)
204 fields.surfaceTexture = env->GetFieldID(clazz,
210 fields.producer = env->GetFieldID(clazz,
216 fields.frameAvailableListener = env->GetFieldID(clazz,
223 fields.postEvent = env->GetStaticMethodID(clazz, "postEventFromNative",
230 static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jboolean isDetached,
252 jniThrowException(env, OutOfResourcesException,
256 SurfaceTexture_setSurfaceTexture(env, thiz, surfaceTexture);
257 SurfaceTexture_setProducer(env, thiz, producer);
259 jclass clazz = env->GetObjectClass(thiz);
261 jniThrowRuntimeException(env,
266 sp<JNISurfaceTextureContext> ctx(new JNISurfaceTextureContext(env, weakThiz,
269 SurfaceTexture_setFrameAvailableListener(env, thiz, ctx);
272 static void SurfaceTexture_finalize(JNIEnv* env, jobject thiz)
274 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
276 SurfaceTexture_setFrameAvailableListener(env, thiz, 0);
277 SurfaceTexture_setSurfaceTexture(env, thiz, 0);
278 SurfaceTexture_setProducer(env, thiz, 0);
282 JNIEnv* env, jobject thiz, jint width, jint height) {
283 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
287 static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz)
289 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
292 jniThrowException(env, IllegalStateException, "Unable to update texture contents (see "
295 jniThrowRuntimeException(env, "Error during updateTexImage (see logcat for details)");
299 static void SurfaceTexture_releaseTexImage(JNIEnv* env, jobject thiz)
301 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
304 jniThrowException(env, IllegalStateException, "Unable to release texture contents (see "
307 jniThrowRuntimeException(env, "Error during updateTexImage (see logcat for details)");
311 static jint SurfaceTexture_detachFromGLContext(JNIEnv* env, jobject thiz)
313 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
317 static jint SurfaceTexture_attachToGLContext(JNIEnv* env, jobject thiz, jint tex)
319 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
323 static void SurfaceTexture_getTransformMatrix(JNIEnv* env, jobject thiz,
326 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
327 float* mtx = env->GetFloatArrayElements(jmtx, NULL);
329 env->ReleaseFloatArrayElements(jmtx, mtx, 0);
332 static jlong SurfaceTexture_getTimestamp(JNIEnv* env, jobject thiz)
334 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
338 static void SurfaceTexture_release(JNIEnv* env, jobject thiz)
340 sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
360 int register_android_graphics_SurfaceTexture(JNIEnv* env)
363 err = AndroidRuntime::registerNativeMethods(env, kSurfaceTextureClassPathName,