Loading core/jni/android/graphics/SurfaceTexture.cpp +20 −20 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <stdio.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <gui/SurfaceTextureClient.h> #include <android_runtime/AndroidRuntime.h> Loading Loading @@ -48,10 +48,10 @@ static fields_t fields; // ---------------------------------------------------------------------------- static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz, const sp<SurfaceTexture>& surfaceTexture) const sp<GLConsumer>& surfaceTexture) { SurfaceTexture* const p = (SurfaceTexture*)env->GetIntField(thiz, fields.surfaceTexture); GLConsumer* const p = (GLConsumer*)env->GetIntField(thiz, fields.surfaceTexture); if (surfaceTexture.get()) { surfaceTexture->incStrong(thiz); } Loading @@ -62,10 +62,10 @@ static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz, } static void SurfaceTexture_setFrameAvailableListener(JNIEnv* env, jobject thiz, sp<SurfaceTexture::FrameAvailableListener> listener) jobject thiz, sp<GLConsumer::FrameAvailableListener> listener) { SurfaceTexture::FrameAvailableListener* const p = (SurfaceTexture::FrameAvailableListener*) GLConsumer::FrameAvailableListener* const p = (GLConsumer::FrameAvailableListener*) env->GetIntField(thiz, fields.frameAvailableListener); if (listener.get()) { listener->incStrong(thiz); Loading @@ -76,16 +76,16 @@ static void SurfaceTexture_setFrameAvailableListener(JNIEnv* env, env->SetIntField(thiz, fields.frameAvailableListener, (int)listener.get()); } sp<SurfaceTexture> SurfaceTexture_getSurfaceTexture(JNIEnv* env, sp<GLConsumer> SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz) { return (SurfaceTexture*)env->GetIntField(thiz, fields.surfaceTexture); return (GLConsumer*)env->GetIntField(thiz, fields.surfaceTexture); } sp<ANativeWindow> android_SurfaceTexture_getNativeWindow( JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<SurfaceTextureClient> surfaceTextureClient(surfaceTexture != NULL ? new SurfaceTextureClient(surfaceTexture->getBufferQueue()) : NULL); return surfaceTextureClient; Loading @@ -99,7 +99,7 @@ bool android_SurfaceTexture_isInstanceOf(JNIEnv* env, jobject thiz) // ---------------------------------------------------------------------------- class JNISurfaceTextureContext : public SurfaceTexture::FrameAvailableListener class JNISurfaceTextureContext : public GLConsumer::FrameAvailableListener { public: JNISurfaceTextureContext(JNIEnv* env, jobject weakThiz, jclass clazz); Loading Loading @@ -200,7 +200,7 @@ static void SurfaceTexture_classInit(JNIEnv* env, jclass clazz) static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jint texName, jobject weakThiz, jboolean allowSynchronous) { sp<SurfaceTexture> surfaceTexture(new SurfaceTexture(texName, allowSynchronous)); sp<GLConsumer> surfaceTexture(new GLConsumer(texName, allowSynchronous)); if (surfaceTexture == 0) { jniThrowException(env, OutOfResourcesException, "Unable to create native SurfaceTexture"); Loading @@ -223,7 +223,7 @@ static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jint texName, static void SurfaceTexture_finalize(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->setFrameAvailableListener(0); SurfaceTexture_setFrameAvailableListener(env, thiz, 0); SurfaceTexture_setSurfaceTexture(env, thiz, 0); Loading @@ -232,13 +232,13 @@ static void SurfaceTexture_finalize(JNIEnv* env, jobject thiz) static void SurfaceTexture_setDefaultBufferSize( JNIEnv* env, jobject thiz, jint width, jint height) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->setDefaultBufferSize(width, height); } static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); status_t err = surfaceTexture->updateTexImage(); if (err == INVALID_OPERATION) { jniThrowException(env, IllegalStateException, "Unable to update texture contents (see " Loading @@ -250,20 +250,20 @@ static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz) static jint SurfaceTexture_detachFromGLContext(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->detachFromContext(); } static jint SurfaceTexture_attachToGLContext(JNIEnv* env, jobject thiz, jint tex) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->attachToContext((GLuint)tex); } static void SurfaceTexture_getTransformMatrix(JNIEnv* env, jobject thiz, jfloatArray jmtx) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); float* mtx = env->GetFloatArrayElements(jmtx, NULL); surfaceTexture->getTransformMatrix(mtx); env->ReleaseFloatArrayElements(jmtx, mtx, 0); Loading @@ -271,13 +271,13 @@ static void SurfaceTexture_getTransformMatrix(JNIEnv* env, jobject thiz, static jlong SurfaceTexture_getTimestamp(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->getTimestamp(); } static void SurfaceTexture_release(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->abandon(); } Loading core/jni/android_hardware_Camera.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <cutils/properties.h> #include <utils/Vector.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <gui/Surface.h> #include <camera/Camera.h> #include <binder/IMemory.h> Loading Loading @@ -555,7 +555,7 @@ static void android_hardware_Camera_setPreviewTexture(JNIEnv *env, sp<BufferQueue> bufferQueue = NULL; if (jSurfaceTexture != NULL) { sp<SurfaceTexture> surfaceTexture = sp<GLConsumer> surfaceTexture = SurfaceTexture_getSurfaceTexture(env, jSurfaceTexture); if (surfaceTexture != NULL) { bufferQueue = surfaceTexture->getBufferQueue(); Loading core/jni/android_media_RemoteDisplay.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <binder/IServiceManager.h> #include <gui/ISurfaceTexture.h> #include <gui/IGraphicBufferProducer.h> #include <media/IMediaPlayerService.h> #include <media/IRemoteDisplay.h> Loading Loading @@ -60,14 +60,14 @@ protected: } public: virtual void onDisplayConnected(const sp<ISurfaceTexture>& surfaceTexture, virtual void onDisplayConnected(const sp<IGraphicBufferProducer>& bufferProducer, uint32_t width, uint32_t height, uint32_t flags) { JNIEnv* env = AndroidRuntime::getJNIEnv(); jobject surfaceObj = android_view_Surface_createFromISurfaceTexture(env, surfaceTexture); jobject surfaceObj = android_view_Surface_createFromISurfaceTexture(env, bufferProducer); if (surfaceObj == NULL) { ALOGE("Could not create Surface from surface texture %p provided by media server.", surfaceTexture.get()); bufferProducer.get()); return; } Loading core/jni/android_opengl_EGL14.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ #include <EGL/egl.h> #include <gui/Surface.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <gui/SurfaceTextureClient.h> #include <ui/ANativeObjectBase.h> Loading Loading @@ -605,7 +605,7 @@ android_eglCreateWindowSurfaceTexture jint _remaining; EGLint *attrib_list = (EGLint *) 0; android::sp<ANativeWindow> window; android::sp<android::SurfaceTexture> surfaceTexture; android::sp<android::GLConsumer> surfaceTexture; if (!attrib_list_ref) { _exception = 1; Loading core/jni/android_view_GLES20Canvas.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ #include <android_runtime/AndroidRuntime.h> #include <android_runtime/android_graphics_SurfaceTexture.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <androidfw/ResourceTypes.h> Loading Loading @@ -806,7 +806,7 @@ static void android_view_GLES20Canvas_setOpaqueLayer(JNIEnv* env, jobject clazz, static void android_view_GLES20Canvas_updateTextureLayer(JNIEnv* env, jobject clazz, Layer* layer, jint width, jint height, jboolean isOpaque, jobject surface) { float transform[16]; sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface)); if (surfaceTexture->updateTexImage() == NO_ERROR) { surfaceTexture->getTransformMatrix(transform); Loading Loading
core/jni/android/graphics/SurfaceTexture.cpp +20 −20 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <stdio.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <gui/SurfaceTextureClient.h> #include <android_runtime/AndroidRuntime.h> Loading Loading @@ -48,10 +48,10 @@ static fields_t fields; // ---------------------------------------------------------------------------- static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz, const sp<SurfaceTexture>& surfaceTexture) const sp<GLConsumer>& surfaceTexture) { SurfaceTexture* const p = (SurfaceTexture*)env->GetIntField(thiz, fields.surfaceTexture); GLConsumer* const p = (GLConsumer*)env->GetIntField(thiz, fields.surfaceTexture); if (surfaceTexture.get()) { surfaceTexture->incStrong(thiz); } Loading @@ -62,10 +62,10 @@ static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz, } static void SurfaceTexture_setFrameAvailableListener(JNIEnv* env, jobject thiz, sp<SurfaceTexture::FrameAvailableListener> listener) jobject thiz, sp<GLConsumer::FrameAvailableListener> listener) { SurfaceTexture::FrameAvailableListener* const p = (SurfaceTexture::FrameAvailableListener*) GLConsumer::FrameAvailableListener* const p = (GLConsumer::FrameAvailableListener*) env->GetIntField(thiz, fields.frameAvailableListener); if (listener.get()) { listener->incStrong(thiz); Loading @@ -76,16 +76,16 @@ static void SurfaceTexture_setFrameAvailableListener(JNIEnv* env, env->SetIntField(thiz, fields.frameAvailableListener, (int)listener.get()); } sp<SurfaceTexture> SurfaceTexture_getSurfaceTexture(JNIEnv* env, sp<GLConsumer> SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz) { return (SurfaceTexture*)env->GetIntField(thiz, fields.surfaceTexture); return (GLConsumer*)env->GetIntField(thiz, fields.surfaceTexture); } sp<ANativeWindow> android_SurfaceTexture_getNativeWindow( JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<SurfaceTextureClient> surfaceTextureClient(surfaceTexture != NULL ? new SurfaceTextureClient(surfaceTexture->getBufferQueue()) : NULL); return surfaceTextureClient; Loading @@ -99,7 +99,7 @@ bool android_SurfaceTexture_isInstanceOf(JNIEnv* env, jobject thiz) // ---------------------------------------------------------------------------- class JNISurfaceTextureContext : public SurfaceTexture::FrameAvailableListener class JNISurfaceTextureContext : public GLConsumer::FrameAvailableListener { public: JNISurfaceTextureContext(JNIEnv* env, jobject weakThiz, jclass clazz); Loading Loading @@ -200,7 +200,7 @@ static void SurfaceTexture_classInit(JNIEnv* env, jclass clazz) static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jint texName, jobject weakThiz, jboolean allowSynchronous) { sp<SurfaceTexture> surfaceTexture(new SurfaceTexture(texName, allowSynchronous)); sp<GLConsumer> surfaceTexture(new GLConsumer(texName, allowSynchronous)); if (surfaceTexture == 0) { jniThrowException(env, OutOfResourcesException, "Unable to create native SurfaceTexture"); Loading @@ -223,7 +223,7 @@ static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jint texName, static void SurfaceTexture_finalize(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->setFrameAvailableListener(0); SurfaceTexture_setFrameAvailableListener(env, thiz, 0); SurfaceTexture_setSurfaceTexture(env, thiz, 0); Loading @@ -232,13 +232,13 @@ static void SurfaceTexture_finalize(JNIEnv* env, jobject thiz) static void SurfaceTexture_setDefaultBufferSize( JNIEnv* env, jobject thiz, jint width, jint height) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->setDefaultBufferSize(width, height); } static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); status_t err = surfaceTexture->updateTexImage(); if (err == INVALID_OPERATION) { jniThrowException(env, IllegalStateException, "Unable to update texture contents (see " Loading @@ -250,20 +250,20 @@ static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz) static jint SurfaceTexture_detachFromGLContext(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->detachFromContext(); } static jint SurfaceTexture_attachToGLContext(JNIEnv* env, jobject thiz, jint tex) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->attachToContext((GLuint)tex); } static void SurfaceTexture_getTransformMatrix(JNIEnv* env, jobject thiz, jfloatArray jmtx) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); float* mtx = env->GetFloatArrayElements(jmtx, NULL); surfaceTexture->getTransformMatrix(mtx); env->ReleaseFloatArrayElements(jmtx, mtx, 0); Loading @@ -271,13 +271,13 @@ static void SurfaceTexture_getTransformMatrix(JNIEnv* env, jobject thiz, static jlong SurfaceTexture_getTimestamp(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->getTimestamp(); } static void SurfaceTexture_release(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->abandon(); } Loading
core/jni/android_hardware_Camera.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <cutils/properties.h> #include <utils/Vector.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <gui/Surface.h> #include <camera/Camera.h> #include <binder/IMemory.h> Loading Loading @@ -555,7 +555,7 @@ static void android_hardware_Camera_setPreviewTexture(JNIEnv *env, sp<BufferQueue> bufferQueue = NULL; if (jSurfaceTexture != NULL) { sp<SurfaceTexture> surfaceTexture = sp<GLConsumer> surfaceTexture = SurfaceTexture_getSurfaceTexture(env, jSurfaceTexture); if (surfaceTexture != NULL) { bufferQueue = surfaceTexture->getBufferQueue(); Loading
core/jni/android_media_RemoteDisplay.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #include <binder/IServiceManager.h> #include <gui/ISurfaceTexture.h> #include <gui/IGraphicBufferProducer.h> #include <media/IMediaPlayerService.h> #include <media/IRemoteDisplay.h> Loading Loading @@ -60,14 +60,14 @@ protected: } public: virtual void onDisplayConnected(const sp<ISurfaceTexture>& surfaceTexture, virtual void onDisplayConnected(const sp<IGraphicBufferProducer>& bufferProducer, uint32_t width, uint32_t height, uint32_t flags) { JNIEnv* env = AndroidRuntime::getJNIEnv(); jobject surfaceObj = android_view_Surface_createFromISurfaceTexture(env, surfaceTexture); jobject surfaceObj = android_view_Surface_createFromISurfaceTexture(env, bufferProducer); if (surfaceObj == NULL) { ALOGE("Could not create Surface from surface texture %p provided by media server.", surfaceTexture.get()); bufferProducer.get()); return; } Loading
core/jni/android_opengl_EGL14.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ #include <EGL/egl.h> #include <gui/Surface.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <gui/SurfaceTextureClient.h> #include <ui/ANativeObjectBase.h> Loading Loading @@ -605,7 +605,7 @@ android_eglCreateWindowSurfaceTexture jint _remaining; EGLint *attrib_list = (EGLint *) 0; android::sp<ANativeWindow> window; android::sp<android::SurfaceTexture> surfaceTexture; android::sp<android::GLConsumer> surfaceTexture; if (!attrib_list_ref) { _exception = 1; Loading
core/jni/android_view_GLES20Canvas.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ #include <android_runtime/AndroidRuntime.h> #include <android_runtime/android_graphics_SurfaceTexture.h> #include <gui/SurfaceTexture.h> #include <gui/GLConsumer.h> #include <androidfw/ResourceTypes.h> Loading Loading @@ -806,7 +806,7 @@ static void android_view_GLES20Canvas_setOpaqueLayer(JNIEnv* env, jobject clazz, static void android_view_GLES20Canvas_updateTextureLayer(JNIEnv* env, jobject clazz, Layer* layer, jint width, jint height, jboolean isOpaque, jobject surface) { float transform[16]; sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface)); sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface)); if (surfaceTexture->updateTexImage() == NO_ERROR) { surfaceTexture->getTransformMatrix(transform); Loading