summaryrefslogtreecommitdiffstats
path: root/core/jni/android_view_Surface.cpp
diff options
context:
space:
mode:
authortedbo <tedbo@google.com>2011-06-06 16:02:47 -0700
committertedbo <tedbo@google.com>2011-06-09 11:59:23 -0700
commit050316184b01c0d1a01c46afae7429b89a27c31b (patch)
treeb21b202cd5345f3989b512b74b227f3fc910383a /core/jni/android_view_Surface.cpp
parent890e013c05ed62bea9781168f3f65efebcbac4d5 (diff)
downloadframeworks_base-050316184b01c0d1a01c46afae7429b89a27c31b.zip
frameworks_base-050316184b01c0d1a01c46afae7429b89a27c31b.tar.gz
frameworks_base-050316184b01c0d1a01c46afae7429b89a27c31b.tar.bz2
Add ParcelSurfaceTexture Java class to enable ISurfaceTexture sharing via Binder.
This adds a new ParcelSurfaceTexture.java class that can be instantiated with a SurfaceTexture and used to send the corresponding ISurfaceTexture interface to another process via Binder. The ParcelSurfaceTexture java object can then be used to create an ANativeWindow based on the SurfaceTextureClient interface. Change-Id: Ie38ea948b866e52f36a6d0f6cde19b54a8546817
Diffstat (limited to 'core/jni/android_view_Surface.cpp')
-rw-r--r--core/jni/android_view_Surface.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index ec8b6e0..70c2f7b 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -55,6 +55,9 @@ enum {
static const char* const OutOfResourcesException =
"android/view/Surface$OutOfResourcesException";
+const char* const kSurfaceSessionClassPathName = "android/view/SurfaceSession";
+const char* const kSurfaceClassPathName = "android/view/Surface";
+
struct sso_t {
jfieldID client;
};
@@ -181,6 +184,11 @@ sp<ANativeWindow> android_Surface_getNativeWindow(
return getSurface(env, clazz);
}
+bool android_Surface_isInstanceOf(JNIEnv* env, jobject obj) {
+ jclass surfaceClass = env->FindClass(kSurfaceClassPathName);
+ return env->IsInstanceOf(obj, surfaceClass);
+}
+
static void setSurface(JNIEnv* env, jobject clazz, const sp<Surface>& surface)
{
Surface* const p = (Surface*)env->GetIntField(clazz, so.surface);
@@ -759,8 +767,6 @@ static void Surface_writeToParcel(
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-const char* const kSurfaceSessionClassPathName = "android/view/SurfaceSession";
-const char* const kSurfaceClassPathName = "android/view/Surface";
static void nativeClassInit(JNIEnv* env, jclass clazz);
static JNINativeMethod gSurfaceSessionMethods[] = {