我想在java返回的surface里面通过c来显示,看了一些JNI的代码:
static android::sp<android::Surface> native_surface;在哪个头文件定义呢?我一直都找不到相应的头文件
static android::sp<android::Surface> native_surface;static android::Surface* getNativeSurface(JNIEnv* env, jobject jsurface, jint version)
{
jclass clazz = env->FindClass("android/view/Surface");
jfieldID field_surface;
if(version <=8)
{
field_surface = env->GetFieldID(clazz, "mSurface", "I");
}
else
field_surface = env->GetFieldID(clazz, ANDROID_VIEW_SURFACE_JNI_ID, "I"); if (field_surface == NULL)
{
return NULL;
}
return (android::Surface *) env->GetIntField(jsurface, field_surface);
}
static android::sp<android::Surface> native_surface;在哪个头文件定义呢?我一直都找不到相应的头文件
static android::sp<android::Surface> native_surface;static android::Surface* getNativeSurface(JNIEnv* env, jobject jsurface, jint version)
{
jclass clazz = env->FindClass("android/view/Surface");
jfieldID field_surface;
if(version <=8)
{
field_surface = env->GetFieldID(clazz, "mSurface", "I");
}
else
field_surface = env->GetFieldID(clazz, ANDROID_VIEW_SURFACE_JNI_ID, "I"); if (field_surface == NULL)
{
return NULL;
}
return (android::Surface *) env->GetIntField(jsurface, field_surface);
}
这两个文件中定义了 sp这个模板类,不知lz要找的是不是这个
看了好多帖子,得用android源码