mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-26 01:30:51 +00:00
(Android) Stub camera functions in Java
This commit is contained in:
parent
09f5037ca6
commit
bad7671159
@ -1,11 +1,47 @@
|
||||
package com.retroarch.browser;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.retroarch.browser.preferences.util.UserPreferences;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.NativeActivity;
|
||||
import android.graphics.SurfaceTexture;
|
||||
import android.hardware.Camera;
|
||||
import android.os.Build;
|
||||
|
||||
public final class RetroActivity extends NativeActivity
|
||||
{
|
||||
Camera mCamera;
|
||||
|
||||
public void onCameraStart()
|
||||
{
|
||||
mCamera.startPreview();
|
||||
}
|
||||
|
||||
public void onCameraStop()
|
||||
{
|
||||
mCamera.stopPreview();
|
||||
}
|
||||
|
||||
public void onCameraInit()
|
||||
{
|
||||
mCamera = Camera.open();
|
||||
}
|
||||
|
||||
public void onCameraFree()
|
||||
{
|
||||
mCamera.release();
|
||||
mCamera = null;
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public void onCameraSetTexture(int gl_texid) throws IOException
|
||||
{
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
mCamera.setPreviewTexture(new SurfaceTexture(gl_texid));
|
||||
else
|
||||
mCamera.setPreviewDisplay(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user