(Android) Add skeleton camera driver

This commit is contained in:
twinaphex 2013-11-17 19:47:37 +01:00
parent ba250d1ca5
commit de1bae69c9
6 changed files with 26 additions and 1 deletions

View File

@ -47,7 +47,7 @@ ifeq ($(PERF_TEST), 1)
LOCAL_CFLAGS += -DPERF_TEST
endif
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_SCREENSHOTS -DWANT_MINIZ -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -I../../../deps/miniz -DHAVE_RSOUND -DHAVE_NETPLAY
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_SCREENSHOTS -DWANT_MINIZ -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -I../../../deps/miniz -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_CAMERA
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 $(LOGGER_LDLIBS) -ldl

View File

@ -83,6 +83,7 @@ enum
CAMERA_V4L2,
CAMERA_RWEBCAM,
CAMERA_ANDROID,
CAMERA_NULL,
OSK_PS3,
@ -189,6 +190,8 @@ enum
#define CAMERA_DEFAULT_DRIVER CAMERA_V4L2
#elif defined(EMSCRIPTEN)
#define CAMERA_DEFAULT_DRIVER CAMERA_RWEBCAM
#elif defined(ANDROID)
#define CAMERA_DEFAULT_DRIVER CAMERA_ANDROID
#else
#define CAMERA_DEFAULT_DRIVER CAMERA_NULL
#endif

View File

@ -239,6 +239,9 @@ static const camera_driver_t *camera_drivers[] = {
#endif
#ifdef EMSCRIPTEN
&camera_rwebcam,
#endif
#ifdef ANDROID
&camera_android,
#endif
NULL,
};

View File

@ -617,6 +617,7 @@ extern const input_driver_t input_qnx;
extern const input_driver_t input_rwebinput;
extern const input_driver_t input_null;
extern const camera_driver_t camera_v4l2;
extern const camera_driver_t camera_android;
extern const camera_driver_t camera_rwebcam;
extern const input_osk_driver_t input_ps3_osk;

View File

@ -345,6 +345,22 @@ AUDIO RESAMPLER
#include "../audio/resampler.c"
#include "../audio/sinc.c"
/*============================================================
CAMERA
============================================================ */
#ifdef HAVE_CAMERA
#if defined(ANDROID)
#include "../camera/android.c"
#elif defined(EMSCRIPTEN)
#include "../camera/rwebcam.c"
#endif
#ifdef HAVE_V4L2
#include "../camera/video4linux2.c"
#endif
#endif
/*============================================================
RSOUND
============================================================ */

View File

@ -174,6 +174,8 @@ const char *config_get_default_camera(void)
return "rwebcam";
case CAMERA_NULL:
return "null";
case CAMERA_ANDROID:
return "android";
default:
return NULL;
}