Merge "Remove jni function that exposes native window"
This commit is contained in:
committed by
Android (Google) Code Review
commit
9deede0297
@@ -131,13 +131,6 @@ sp<IGraphicBufferProducer> SurfaceTexture_getProducer(JNIEnv* env, jobject thiz)
|
||||
return (IGraphicBufferProducer*)env->GetLongField(thiz, fields.producer);
|
||||
}
|
||||
|
||||
sp<ANativeWindow> android_SurfaceTexture_getNativeWindow(JNIEnv* env, jobject thiz) {
|
||||
sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
|
||||
sp<IGraphicBufferProducer> producer(SurfaceTexture_getProducer(env, thiz));
|
||||
sp<Surface> surfaceTextureClient(surfaceTexture != NULL ? new Surface(producer) : NULL);
|
||||
return surfaceTextureClient;
|
||||
}
|
||||
|
||||
bool android_SurfaceTexture_isInstanceOf(JNIEnv* env, jobject thiz) {
|
||||
jclass surfaceTextureClass = env->FindClass(kSurfaceTextureClassPathName);
|
||||
return env->IsInstanceOf(thiz, surfaceTextureClass);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "core_jni_helpers.h"
|
||||
#include "android_runtime/android_view_Surface.h"
|
||||
#include "android_runtime/android_graphics_SurfaceTexture.h"
|
||||
#include "surfacetexture/SurfaceTexture.h"
|
||||
|
||||
#include <gui/Surface.h>
|
||||
#include <gui/IGraphicBufferProducer.h>
|
||||
@@ -394,10 +395,17 @@ static sp<ANativeWindow> getNativeWindow(JNIEnv* env, jobject surface) {
|
||||
return anw;
|
||||
}
|
||||
|
||||
static sp<ANativeWindow> getSurfaceTextureNativeWindow(JNIEnv* env, jobject thiz) {
|
||||
sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
|
||||
sp<IGraphicBufferProducer> producer(SurfaceTexture_getProducer(env, thiz));
|
||||
sp<Surface> surfaceTextureClient(surfaceTexture != NULL ? new Surface(producer) : NULL);
|
||||
return surfaceTextureClient;
|
||||
}
|
||||
|
||||
static sp<ANativeWindow> getNativeWindowFromTexture(JNIEnv* env, jobject surfaceTexture) {
|
||||
sp<ANativeWindow> anw;
|
||||
if (surfaceTexture) {
|
||||
anw = android_SurfaceTexture_getNativeWindow(env, surfaceTexture);
|
||||
anw = getSurfaceTextureNativeWindow(env, surfaceTexture);
|
||||
if (env->ExceptionCheck()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#ifndef _ANDROID_GRAPHICS_SURFACETEXTURE_H
|
||||
#define _ANDROID_GRAPHICS_SURFACETEXTURE_H
|
||||
|
||||
#include <android/native_window.h>
|
||||
|
||||
#include "jni.h"
|
||||
|
||||
namespace android {
|
||||
@@ -26,7 +24,6 @@ namespace android {
|
||||
class IGraphicBufferProducer;
|
||||
class SurfaceTexture;
|
||||
|
||||
extern sp<ANativeWindow> android_SurfaceTexture_getNativeWindow(JNIEnv* env, jobject thiz);
|
||||
extern bool android_SurfaceTexture_isInstanceOf(JNIEnv* env, jobject thiz);
|
||||
|
||||
/* Gets the underlying C++ SurfaceTexture object from a SurfaceTexture Java object. */
|
||||
|
||||
Reference in New Issue
Block a user