summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android/graphics/SurfaceTexture.cpp40
-rw-r--r--core/jni/android_hardware_Camera.cpp4
-rw-r--r--core/jni/android_media_RemoteDisplay.cpp8
-rw-r--r--core/jni/android_opengl_EGL14.cpp4
-rw-r--r--core/jni/android_view_GLES20Canvas.cpp4
-rw-r--r--core/jni/android_view_Surface.cpp20
-rw-r--r--core/jni/android_view_TextureView.cpp10
-rw-r--r--core/jni/com_google_android_gles_jni_EGLImpl.cpp6
8 files changed, 48 insertions, 48 deletions
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp
index 3315045..f8715fe 100644
--- a/core/jni/android/graphics/SurfaceTexture.cpp
+++ b/core/jni/android/graphics/SurfaceTexture.cpp
@@ -18,7 +18,7 @@
#include <stdio.h>
-#include <gui/SurfaceTexture.h>
+#include <gui/GLConsumer.h>
#include <gui/SurfaceTextureClient.h>
#include <android_runtime/AndroidRuntime.h>
@@ -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);
}
@@ -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);
@@ -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;
@@ -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);
@@ -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");
@@ -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);
@@ -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 "
@@ -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);
@@ -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();
}
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index d39f565c..0e0893b 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -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>
@@ -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();
diff --git a/core/jni/android_media_RemoteDisplay.cpp b/core/jni/android_media_RemoteDisplay.cpp
index 5d24f61..a340fa1 100644
--- a/core/jni/android_media_RemoteDisplay.cpp
+++ b/core/jni/android_media_RemoteDisplay.cpp
@@ -27,7 +27,7 @@
#include <binder/IServiceManager.h>
-#include <gui/ISurfaceTexture.h>
+#include <gui/IGraphicBufferProducer.h>
#include <media/IMediaPlayerService.h>
#include <media/IRemoteDisplay.h>
@@ -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;
}
diff --git a/core/jni/android_opengl_EGL14.cpp b/core/jni/android_opengl_EGL14.cpp
index 2b265db..9c7124a 100644
--- a/core/jni/android_opengl_EGL14.cpp
+++ b/core/jni/android_opengl_EGL14.cpp
@@ -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>
@@ -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;
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 5d306d2..d8d55b2 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -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>
@@ -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);
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index 2767e94..1f15370 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -28,7 +28,7 @@
#include <gui/ISurfaceComposer.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
-#include <gui/SurfaceTexture.h>
+#include <gui/GLConsumer.h>
#include <ui/DisplayInfo.h>
#include <ui/Rect.h>
@@ -234,7 +234,7 @@ static void setSurface(JNIEnv* env, jobject surfaceObj, const sp<Surface>& surfa
}
}
-static sp<ISurfaceTexture> getISurfaceTexture(JNIEnv* env, jobject surfaceObj) {
+static sp<IGraphicBufferProducer> getISurfaceTexture(JNIEnv* env, jobject surfaceObj) {
if (surfaceObj) {
sp<Surface> surface(getSurface(env, surfaceObj));
if (surface != NULL) {
@@ -245,12 +245,12 @@ static sp<ISurfaceTexture> getISurfaceTexture(JNIEnv* env, jobject surfaceObj) {
}
jobject android_view_Surface_createFromISurfaceTexture(JNIEnv* env,
- const sp<ISurfaceTexture>& surfaceTexture) {
- if (surfaceTexture == NULL) {
+ const sp<IGraphicBufferProducer>& bufferProducer) {
+ if (bufferProducer == NULL) {
return NULL;
}
- sp<Surface> surface(new Surface(surfaceTexture));
+ sp<Surface> surface(new Surface(bufferProducer));
if (surface == NULL) {
return NULL;
}
@@ -258,7 +258,7 @@ jobject android_view_Surface_createFromISurfaceTexture(JNIEnv* env,
jobject surfaceObj = env->NewObject(gSurfaceClassInfo.clazz, gSurfaceClassInfo.ctor);
if (surfaceObj == NULL) {
if (env->ExceptionCheck()) {
- ALOGE("Could not create instance of Surface from ISurfaceTexture.");
+ ALOGE("Could not create instance of Surface from IGraphicBufferProducer.");
LOGE_EX(env);
env->ExceptionClear();
}
@@ -289,14 +289,14 @@ static void nativeCreate(JNIEnv* env, jobject surfaceObj, jobject sessionObj,
static void nativeCreateFromSurfaceTexture(JNIEnv* env, jobject surfaceObj,
jobject surfaceTextureObj) {
- sp<SurfaceTexture> st(SurfaceTexture_getSurfaceTexture(env, surfaceTextureObj));
+ sp<GLConsumer> st(SurfaceTexture_getSurfaceTexture(env, surfaceTextureObj));
if (st == NULL) {
jniThrowException(env, "java/lang/IllegalArgumentException",
"SurfaceTexture has already been released");
return;
}
- sp<ISurfaceTexture> bq = st->getBufferQueue();
+ sp<IGraphicBufferProducer> bq = st->getBufferQueue();
sp<Surface> surface(new Surface(bq));
if (surface == NULL) {
@@ -667,8 +667,8 @@ static void nativeSetDisplaySurface(JNIEnv* env, jclass clazz,
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
if (token == NULL) return;
- sp<ISurfaceTexture> surfaceTexture(getISurfaceTexture(env, surfaceObj));
- SurfaceComposerClient::setDisplaySurface(token, surfaceTexture);
+ sp<IGraphicBufferProducer> bufferProducer(getISurfaceTexture(env, surfaceObj));
+ SurfaceComposerClient::setDisplaySurface(token, bufferProducer);
}
static void nativeSetDisplayLayerStack(JNIEnv* env, jclass clazz,
diff --git a/core/jni/android_view_TextureView.cpp b/core/jni/android_view_TextureView.cpp
index 854c9ae..87b312f 100644
--- a/core/jni/android_view_TextureView.cpp
+++ b/core/jni/android_view_TextureView.cpp
@@ -22,7 +22,7 @@
#include <ui/Region.h>
#include <ui/Rect.h>
-#include <gui/SurfaceTexture.h>
+#include <gui/GLConsumer.h>
#include <gui/SurfaceTextureClient.h>
#include <SkBitmap.h>
@@ -67,8 +67,8 @@ static struct {
static void android_view_TextureView_setDefaultBufferSize(JNIEnv* env, jobject,
jobject surface, jint width, jint height) {
- sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface));
- surfaceTexture->setDefaultBufferSize(width, height);
+ sp<GLConsumer> glConsumer(SurfaceTexture_getSurfaceTexture(env, surface));
+ glConsumer->setDefaultBufferSize(width, height);
}
static inline SkBitmap::Config convertPixelFormat(int32_t format) {
@@ -101,8 +101,8 @@ static int32_t native_window_unlockAndPost(ANativeWindow* window) {
static void android_view_TextureView_createNativeWindow(JNIEnv* env, jobject textureView,
jobject surface) {
- sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, surface));
- sp<ANativeWindow> window = new SurfaceTextureClient(surfaceTexture->getBufferQueue());
+ sp<GLConsumer> glConsumer(SurfaceTexture_getSurfaceTexture(env, surface));
+ sp<ANativeWindow> window = new SurfaceTextureClient(glConsumer->getBufferQueue());
window->incStrong(0);
SET_INT(textureView, gTextureViewClassInfo.nativeWindow, jint(window.get()));
diff --git a/core/jni/com_google_android_gles_jni_EGLImpl.cpp b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
index 1c9562e..199d5bf 100644
--- a/core/jni/com_google_android_gles_jni_EGLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
@@ -27,7 +27,7 @@
#include <GLES/gl.h>
#include <gui/Surface.h>
-#include <gui/SurfaceTexture.h>
+#include <gui/GLConsumer.h>
#include <gui/SurfaceTextureClient.h>
#include <SkBitmap.h>
@@ -353,9 +353,9 @@ not_valid_surface:
return 0;
}
- sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(_env, native_window));
+ sp<GLConsumer> glConsumer(SurfaceTexture_getSurfaceTexture(_env, native_window));
- window = new SurfaceTextureClient(surfaceTexture->getBufferQueue());
+ window = new SurfaceTextureClient(glConsumer->getBufferQueue());
if (window == NULL)
goto not_valid_surface;