Hello community it is me again,
and again i bother you with camera texture stuff. As some of you know i used a Texture2D for displaying a camera stream from my androids color camera, this was working well as i used googles project tango where i did only need to bind via GLuint
TangoService_updateTextureExternalOes(
TANGO_CAMERA_COLOR, textureID,
&ts)
Now i found this useful tutorial
https://www.sisik.eu/blog/android/ndk/camera
it allowed me to capture the camera stream myself and now i want to get rid off this Tango function.
The important part building a camera capturing session with the ndk is the following code, assume that surface is of type jobject, passed via jni from GLSurfaceView.
// Prepare surface
textureId = texId;
textureWindow = ANativeWindow_fromSurface(env, surface);
// Prepare outputs for session
ACaptureSessionOutput_create(textureWindow, &textureOutput);
ACaptureSessionOutputContainer_create(&outputs);
ACaptureSessionOutputContainer_add(outputs, textureOutput);
// Create the session
ACameraDevice_createCaptureSession(cameraDevice, outputs, &sessionStateCallbacks, &textureSession);
// Prepare request for texture target
ACameraDevice_createCaptureRequest(cameraDevice, TEMPLATE_PREVIEW, &textureRequest);
ANativeWindow_acquire(textureWindow);
ACameraOutputTarget_create(textureWindow, &textureTarget);
ACaptureRequest_addTarget(textureRequest, textureTarget);
// Start capturing continuously
ACameraCaptureSession_setRepeatingRequest(textureSession, &captureCallbacks, 1, &textureRequest, nullptr);
So now my question does anyone know how i can add the urho Texture2D into the output container?
auto surface = cameraTexture->GetRenderSurface()->GetSurface();
auto target = cameraTexture->GetRenderSurface()->GetTarget();
auto id = (int)cameraTexture->GetGPUObjectName();
Above are some parameter i can extract but i don’t know how to add this texture through the camera capture session output. Maybe anyone already did work with ndk camera api.
Best Regards