androidcamera: Fix compilation issues

This commit is contained in:
Youness Alaoui 2012-10-17 19:42:59 -04:00 committed by Nicolas Dufresne
parent e42e7317f9
commit d56f094ce6
3 changed files with 33 additions and 22 deletions

View File

@ -38,7 +38,8 @@ static struct
jint UNKNOWN; jint UNKNOWN;
jint YUY2; jint YUY2;
jint YV12; jint YV12;
} android_graphics_imageformat = {0}; } android_graphics_imageformat = {
0};
gint ImageFormat_JPEG; gint ImageFormat_JPEG;
gint ImageFormat_NV16; gint ImageFormat_NV16;
@ -49,7 +50,7 @@ gint ImageFormat_YUY2;
gint ImageFormat_YV12; gint ImageFormat_YV12;
static gboolean static gboolean
_init_classes () _init_classes (void)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
@ -78,7 +79,7 @@ _init_classes ()
} }
gboolean gboolean
gst_android_graphics_imageformat_init () gst_android_graphics_imageformat_init (void)
{ {
if (!_init_classes ()) { if (!_init_classes ()) {
gst_android_graphics_imageformat_deinit (); gst_android_graphics_imageformat_deinit ();
@ -89,7 +90,7 @@ gst_android_graphics_imageformat_init ()
} }
void void
gst_android_graphics_imageformat_deinit () gst_android_graphics_imageformat_deinit (void)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
@ -105,7 +106,7 @@ gst_ag_imageformat_get_bits_per_pixel (gint format)
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
jint bpp = 0; jint bpp = 0;
bpp = GST_DVM_STATIC_CALL(return -1, Int, bpp = GST_DVM_STATIC_CALL (return -1, Int,
android_graphics_imageformat, getBitsPerPixel, format); android_graphics_imageformat, getBitsPerPixel, format);
return bpp; return bpp;

View File

@ -32,10 +32,11 @@ static struct
jclass klass; jclass klass;
jmethodID constructor; jmethodID constructor;
jmethodID release; jmethodID release;
} android_graphics_surfacetexture = {0}; } android_graphics_surfacetexture = {
0};
static gboolean static gboolean
_init_classes () _init_classes (void)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
@ -50,7 +51,7 @@ _init_classes ()
} }
gboolean gboolean
gst_android_graphics_surfacetexture_init () gst_android_graphics_surfacetexture_init (void)
{ {
if (!_init_classes ()) { if (!_init_classes ()) {
gst_android_graphics_surfacetexture_deinit (); gst_android_graphics_surfacetexture_deinit ();
@ -61,7 +62,7 @@ gst_android_graphics_surfacetexture_init ()
} }
void void
gst_android_graphics_surfacetexture_deinit () gst_android_graphics_surfacetexture_deinit (void)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
@ -105,7 +106,7 @@ gst_ag_surfacetexture_release (GstAGSurfaceTexture * self)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
GST_DVM_CALL(, self->object, Void, android_graphics_surfacetexture, release); GST_DVM_CALL (, self->object, Void, android_graphics_surfacetexture, release);
(*env)->DeleteGlobalRef (env, self->object); (*env)->DeleteGlobalRef (env, self->object);
g_slice_free (GstAGSurfaceTexture, self); g_slice_free (GstAGSurfaceTexture, self);

View File

@ -46,7 +46,8 @@ static struct
jmethodID stopPreview; jmethodID stopPreview;
jmethodID stopSmoothZoom; jmethodID stopSmoothZoom;
jmethodID unlock; jmethodID unlock;
} android_hardware_camera = {0}; } android_hardware_camera = {
0};
static struct static struct
{ {
@ -56,7 +57,9 @@ static struct
jfieldID orientation; jfieldID orientation;
jint CAMERA_FACING_BACK; jint CAMERA_FACING_BACK;
jint CAMERA_FACING_FRONT; jint CAMERA_FACING_FRONT;
} android_hardware_camera_camerainfo = {0}; } android_hardware_camera_camerainfo = {
0};
gint CameraInfo_CAMERA_FACING_BACK; gint CameraInfo_CAMERA_FACING_BACK;
gint CameraInfo_CAMERA_FACING_FRONT; gint CameraInfo_CAMERA_FACING_FRONT;
@ -65,7 +68,8 @@ static struct
jclass klass; jclass klass;
jfieldID width; jfieldID width;
jfieldID height; jfieldID height;
} android_hardware_camera_size = {0}; } android_hardware_camera_size = {
0};
/* TODO: Add other parameters */ /* TODO: Add other parameters */
static struct static struct
@ -82,32 +86,37 @@ static struct
jmethodID setPreviewFpsRange; jmethodID setPreviewFpsRange;
jmethodID setPreviewSize; jmethodID setPreviewSize;
jmethodID unflatten; jmethodID unflatten;
} android_hardware_camera_parameters = {0}; } android_hardware_camera_parameters = {
0};
static struct static struct
{ {
jclass klass; jclass klass;
jmethodID iterator; jmethodID iterator;
} java_util_list = {0}; } java_util_list = {
0};
static struct static struct
{ {
jclass klass; jclass klass;
jmethodID hasNext; jmethodID hasNext;
jmethodID next; jmethodID next;
} java_util_iterator = {0}; } java_util_iterator = {
0};
static struct static struct
{ {
jclass klass; jclass klass;
jmethodID intValue; jmethodID intValue;
} java_lang_integer = {0}; } java_lang_integer = {
0};
static struct static struct
{ {
jclass klass; jclass klass;
jmethodID constructor; jmethodID constructor;
} com_gstreamer_gstahccallback = {0}; } com_gstreamer_gstahccallback = {
0};
static void static void
gst_ah_camera_on_preview_frame (JNIEnv * env, jclass klass, jbyteArray data, gst_ah_camera_on_preview_frame (JNIEnv * env, jclass klass, jbyteArray data,
@ -135,7 +144,7 @@ static JNINativeMethod native_methods[] = {
}; };
static gboolean static gboolean
_init_classes () _init_classes (void)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
@ -244,7 +253,7 @@ _init_classes ()
gboolean gboolean
gst_android_hardware_camera_init () gst_android_hardware_camera_init (void)
{ {
if (!_init_classes ()) { if (!_init_classes ()) {
gst_android_hardware_camera_deinit (); gst_android_hardware_camera_deinit ();
@ -255,7 +264,7 @@ gst_android_hardware_camera_init ()
} }
void void
gst_android_hardware_camera_deinit () gst_android_hardware_camera_deinit (void)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
@ -353,7 +362,7 @@ done:
} }
gint gint
gst_ah_camera_get_number_of_cameras () gst_ah_camera_get_number_of_cameras (void)
{ {
JNIEnv *env = gst_dvm_get_env (); JNIEnv *env = gst_dvm_get_env ();
gint num_cameras; gint num_cameras;