, texwidth(-1), texheight(-1)
, client(NULL), decoder(NULL), decoder_component(NULL)
, drop_state(false), resetting(false)
- , mVideoNativeWindow(NULL)
+ , mVideoNativeWindow(NULL)
{
if (!eglCreateImageKHR)
eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC) CEGLWrapper::GetProcAddress("eglCreateImageKHR");
for (int i=0; i<INBUFCOUNT; ++i)
if (inbuf[i]->refcount() == 0)
return true;
-
+
return false;
}
if (eglSurface != EGL_NO_SURFACE)
eglDestroySurface(eglDisplay, eglSurface);
eglSurface = EGL_NO_SURFACE;
-
+
eglInitialized = false;
}
{
if (mVideoNativeWindow != NULL)
return true;
-
+
JNIEnv* env = xbmc_jnienv();
mVideoTextureId = -1;
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
-
+
mSurfTexture = new CJNISurfaceTexture(mVideoTextureId);
- mSurface = new CJNISurface(mSurfTexture);
-
+ mSurface = new CJNISurface(*mSurfTexture);
+
mVideoNativeWindow = ANativeWindow_fromSurface(env, mSurface->get_raw());
+ native_window_api_connect(mVideoNativeWindow.get(), NATIVE_WINDOW_API_MEDIA);
return true;
}
if (mVideoNativeWindow == NULL)
return;
+ native_window_api_disconnect(mVideoNativeWindow.get(), NATIVE_WINDOW_API_MEDIA);
ANativeWindow_release(mVideoNativeWindow.get());
mVideoNativeWindow = NULL;