androidmedia: Add new effects and scene modes to Camera parameters

This commit is contained in:
Andrew Branson 2019-11-18 23:38:49 +01:00
parent 8de7b41015
commit 397a9edb35
2 changed files with 251 additions and 0 deletions

View file

@ -146,6 +146,9 @@ static struct
jstring EFFECT_WHITEBOARD;
jstring EFFECT_BLACKBOARD;
jstring EFFECT_AQUA;
jstring EFFECT_EMBOSS;
jstring EFFECT_SKETCH;
jstring EFFECT_NEON;
jstring ANTIBANDING_AUTO;
jstring ANTIBANDING_50HZ;
jstring ANTIBANDING_60HZ;
@ -171,6 +174,10 @@ static struct
jstring SCENE_MODE_PARTY;
jstring SCENE_MODE_CANDLELIGHT;
jstring SCENE_MODE_BARCODE;
jstring SCENE_MODE_BACKLIGHT;
jstring SCENE_MODE_FLOWERS;
jstring SCENE_MODE_AR;
jstring SCENE_MODE_HDR;
jstring FOCUS_MODE_AUTO;
jstring FOCUS_MODE_INFINITY;
jstring FOCUS_MODE_MACRO;
@ -198,6 +205,9 @@ const gchar *Parameters_EFFECT_POSTERIZE;
const gchar *Parameters_EFFECT_WHITEBOARD;
const gchar *Parameters_EFFECT_BLACKBOARD;
const gchar *Parameters_EFFECT_AQUA;
const gchar *Parameters_EFFECT_EMBOSS;
const gchar *Parameters_EFFECT_SKETCH;
const gchar *Parameters_EFFECT_NEON;
const gchar *Parameters_ANTIBANDING_AUTO;
const gchar *Parameters_ANTIBANDING_50HZ;
const gchar *Parameters_ANTIBANDING_60HZ;
@ -223,6 +233,10 @@ const gchar *Parameters_SCENE_MODE_SPORTS;
const gchar *Parameters_SCENE_MODE_PARTY;
const gchar *Parameters_SCENE_MODE_CANDLELIGHT;
const gchar *Parameters_SCENE_MODE_BARCODE;
const gchar *Parameters_SCENE_MODE_BACKLIGHT;
const gchar *Parameters_SCENE_MODE_FLOWERS;
const gchar *Parameters_SCENE_MODE_AR;
const gchar *Parameters_SCENE_MODE_HDR;
const gchar *Parameters_FOCUS_MODE_AUTO;
const gchar *Parameters_FOCUS_MODE_INFINITY;
const gchar *Parameters_FOCUS_MODE_MACRO;
@ -946,6 +960,63 @@ _init_classes (void)
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "EFFECT_EMBOSS",
"Ljava/lang/String;");
if (!fieldID)
goto failed;
if (!gst_amc_jni_get_static_object_field (env, &err, klass, fieldID,
&android_hardware_camera_parameters.EFFECT_EMBOSS))
goto failed;
Parameters_EFFECT_EMBOSS =
(*env)->GetStringUTFChars (env,
android_hardware_camera_parameters.EFFECT_EMBOSS, NULL);
{
jobject local = android_hardware_camera_parameters.EFFECT_EMBOSS;
android_hardware_camera_parameters.EFFECT_EMBOSS =
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "EFFECT_SKETCH",
"Ljava/lang/String;");
if (!fieldID)
goto failed;
if (!gst_amc_jni_get_static_object_field (env, &err, klass, fieldID,
&android_hardware_camera_parameters.EFFECT_SKETCH))
goto failed;
Parameters_EFFECT_SKETCH =
(*env)->GetStringUTFChars (env,
android_hardware_camera_parameters.EFFECT_SKETCH, NULL);
{
jobject local = android_hardware_camera_parameters.EFFECT_SKETCH;
android_hardware_camera_parameters.EFFECT_SKETCH =
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "EFFECT_NEON",
"Ljava/lang/String;");
if (!fieldID)
goto failed;
if (!gst_amc_jni_get_static_object_field (env, &err, klass, fieldID,
&android_hardware_camera_parameters.EFFECT_NEON))
goto failed;
Parameters_EFFECT_NEON =
(*env)->GetStringUTFChars (env,
android_hardware_camera_parameters.EFFECT_NEON, NULL);
{
jobject local = android_hardware_camera_parameters.EFFECT_NEON;
android_hardware_camera_parameters.EFFECT_NEON =
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "ANTIBANDING_AUTO",
"Ljava/lang/String;");
@ -1423,6 +1494,82 @@ _init_classes (void)
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "SCENE_MODE_BACKLIGHT",
"Ljava/lang/String;");
if (!fieldID)
goto failed;
if (!gst_amc_jni_get_static_object_field (env, &err, klass, fieldID,
&android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT))
goto failed;
Parameters_SCENE_MODE_BACKLIGHT =
(*env)->GetStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT, NULL);
{
jobject local = android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT;
android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT =
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "SCENE_MODE_FLOWERS",
"Ljava/lang/String;");
if (!fieldID)
goto failed;
if (!gst_amc_jni_get_static_object_field (env, &err, klass, fieldID,
&android_hardware_camera_parameters.SCENE_MODE_FLOWERS))
goto failed;
Parameters_SCENE_MODE_FLOWERS =
(*env)->GetStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_FLOWERS, NULL);
{
jobject local = android_hardware_camera_parameters.SCENE_MODE_FLOWERS;
android_hardware_camera_parameters.SCENE_MODE_FLOWERS =
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "SCENE_MODE_AR",
"Ljava/lang/String;");
if (!fieldID)
goto failed;
if (!gst_amc_jni_get_static_object_field (env, &err, klass, fieldID,
&android_hardware_camera_parameters.SCENE_MODE_AR))
goto failed;
Parameters_SCENE_MODE_AR =
(*env)->GetStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_AR, NULL);
{
jobject local = android_hardware_camera_parameters.SCENE_MODE_AR;
android_hardware_camera_parameters.SCENE_MODE_AR =
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "SCENE_MODE_HDR",
"Ljava/lang/String;");
if (!fieldID)
goto failed;
if (!gst_amc_jni_get_static_object_field (env, &err, klass, fieldID,
&android_hardware_camera_parameters.SCENE_MODE_HDR))
goto failed;
Parameters_SCENE_MODE_HDR =
(*env)->GetStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_HDR, NULL);
{
jobject local = android_hardware_camera_parameters.SCENE_MODE_HDR;
android_hardware_camera_parameters.SCENE_MODE_HDR =
gst_amc_jni_object_make_global (env, local);
}
fieldID =
gst_amc_jni_get_static_field_id (env, &err, klass, "FOCUS_MODE_AUTO",
"Ljava/lang/String;");
@ -1805,6 +1952,32 @@ gst_android_hardware_camera_deinit (void)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.EFFECT_AQUA);
android_hardware_camera_parameters.EFFECT_AQUA = NULL;
if (Parameters_EFFECT_EMBOSS)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.EFFECT_EMBOSS,
Parameters_EFFECT_EMBOSS);
Parameters_EFFECT_EMBOSS = NULL;
if (android_hardware_camera_parameters.EFFECT_EMBOSS)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.EFFECT_EMBOSS);
android_hardware_camera_parameters.EFFECT_EMBOSS = NULL;
if (Parameters_EFFECT_SKETCH)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.EFFECT_SKETCH,
Parameters_EFFECT_SKETCH);
Parameters_EFFECT_SKETCH = NULL;
if (android_hardware_camera_parameters.EFFECT_SKETCH)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.EFFECT_SKETCH);
android_hardware_camera_parameters.EFFECT_SKETCH = NULL;
if (Parameters_EFFECT_NEON)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.EFFECT_NEON, Parameters_EFFECT_NEON);
Parameters_EFFECT_NEON = NULL;
if (android_hardware_camera_parameters.EFFECT_NEON)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.EFFECT_NEON);
android_hardware_camera_parameters.EFFECT_NEON = NULL;
if (Parameters_ANTIBANDING_AUTO)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.ANTIBANDING_AUTO,
@ -2030,6 +2203,42 @@ gst_android_hardware_camera_deinit (void)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.SCENE_MODE_BARCODE);
android_hardware_camera_parameters.SCENE_MODE_BARCODE = NULL;
if (Parameters_SCENE_MODE_BACKLIGHT)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT,
Parameters_SCENE_MODE_BACKLIGHT);
Parameters_SCENE_MODE_BACKLIGHT = NULL;
if (android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT);
android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT = NULL;
if (Parameters_SCENE_MODE_FLOWERS)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_FLOWERS,
Parameters_SCENE_MODE_FLOWERS);
Parameters_SCENE_MODE_FLOWERS = NULL;
if (android_hardware_camera_parameters.SCENE_MODE_FLOWERS)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.SCENE_MODE_FLOWERS);
android_hardware_camera_parameters.SCENE_MODE_FLOWERS = NULL;
if (Parameters_SCENE_MODE_AR)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_AR,
Parameters_SCENE_MODE_AR);
Parameters_SCENE_MODE_AR = NULL;
if (android_hardware_camera_parameters.SCENE_MODE_AR)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.SCENE_MODE_AR);
android_hardware_camera_parameters.SCENE_MODE_AR = NULL;
if (Parameters_SCENE_MODE_HDR)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.SCENE_MODE_HDR,
Parameters_SCENE_MODE_HDR);
Parameters_SCENE_MODE_HDR = NULL;
if (android_hardware_camera_parameters.SCENE_MODE_HDR)
gst_amc_jni_object_unref (env,
android_hardware_camera_parameters.SCENE_MODE_HDR);
android_hardware_camera_parameters.SCENE_MODE_HDR = NULL;
if (Parameters_FOCUS_MODE_AUTO)
(*env)->ReleaseStringUTFChars (env,
android_hardware_camera_parameters.FOCUS_MODE_AUTO,
@ -2756,6 +2965,15 @@ _color_effect_to_gchar (JNIEnv * env, jstring color_effect)
else if (java_lang_string_equals (env, color_effect,
android_hardware_camera_parameters.EFFECT_AQUA))
return Parameters_EFFECT_AQUA;
else if (java_lang_string_equals (env, color_effect,
android_hardware_camera_parameters.EFFECT_EMBOSS))
return Parameters_EFFECT_EMBOSS;
else if (java_lang_string_equals (env, color_effect,
android_hardware_camera_parameters.EFFECT_SKETCH))
return Parameters_EFFECT_SKETCH;
else if (java_lang_string_equals (env, color_effect,
android_hardware_camera_parameters.EFFECT_NEON))
return Parameters_EFFECT_NEON;
return NULL;
}
@ -2784,6 +3002,12 @@ _color_effect_to_jstring (const gchar * color_effect)
return android_hardware_camera_parameters.EFFECT_BLACKBOARD;
else if (!g_strcmp0 (color_effect, Parameters_EFFECT_AQUA))
return android_hardware_camera_parameters.EFFECT_AQUA;
else if (!g_strcmp0 (color_effect, Parameters_EFFECT_EMBOSS))
return android_hardware_camera_parameters.EFFECT_EMBOSS;
else if (!g_strcmp0 (color_effect, Parameters_EFFECT_SKETCH))
return android_hardware_camera_parameters.EFFECT_SKETCH;
else if (!g_strcmp0 (color_effect, Parameters_EFFECT_NEON))
return android_hardware_camera_parameters.EFFECT_NEON;
return NULL;
}
@ -2927,6 +3151,18 @@ _scene_mode_to_gchar (JNIEnv * env, jstring scene_mode)
else if (java_lang_string_equals (env, scene_mode,
android_hardware_camera_parameters.SCENE_MODE_BARCODE))
return Parameters_SCENE_MODE_BARCODE;
else if (java_lang_string_equals (env, scene_mode,
android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT))
return Parameters_SCENE_MODE_BACKLIGHT;
else if (java_lang_string_equals (env, scene_mode,
android_hardware_camera_parameters.SCENE_MODE_FLOWERS))
return Parameters_SCENE_MODE_FLOWERS;
else if (java_lang_string_equals (env, scene_mode,
android_hardware_camera_parameters.SCENE_MODE_AR))
return Parameters_SCENE_MODE_AR;
else if (java_lang_string_equals (env, scene_mode,
android_hardware_camera_parameters.SCENE_MODE_HDR))
return Parameters_SCENE_MODE_HDR;
return NULL;
}
@ -2969,6 +3205,14 @@ _scene_mode_to_jstring (const gchar * scene_mode)
return android_hardware_camera_parameters.SCENE_MODE_CANDLELIGHT;
else if (!g_strcmp0 (scene_mode, Parameters_SCENE_MODE_BARCODE))
return android_hardware_camera_parameters.SCENE_MODE_BARCODE;
else if (!g_strcmp0 (scene_mode, Parameters_SCENE_MODE_BACKLIGHT))
return android_hardware_camera_parameters.SCENE_MODE_BACKLIGHT;
else if (!g_strcmp0 (scene_mode, Parameters_SCENE_MODE_FLOWERS))
return android_hardware_camera_parameters.SCENE_MODE_FLOWERS;
else if (!g_strcmp0 (scene_mode, Parameters_SCENE_MODE_AR))
return android_hardware_camera_parameters.SCENE_MODE_AR;
else if (!g_strcmp0 (scene_mode, Parameters_SCENE_MODE_HDR))
return android_hardware_camera_parameters.SCENE_MODE_HDR;
return NULL;
}

View file

@ -84,6 +84,9 @@ extern const gchar *Parameters_EFFECT_POSTERIZE;
extern const gchar *Parameters_EFFECT_WHITEBOARD;
extern const gchar *Parameters_EFFECT_BLACKBOARD;
extern const gchar *Parameters_EFFECT_AQUA;
extern const gchar *Parameters_EFFECT_EMBOSS;
extern const gchar *Parameters_EFFECT_SKETCH;
extern const gchar *Parameters_EFFECT_NEON;
extern const gchar *Parameters_ANTIBANDING_AUTO;
extern const gchar *Parameters_ANTIBANDING_50HZ;
extern const gchar *Parameters_ANTIBANDING_60HZ;
@ -109,6 +112,10 @@ extern const gchar *Parameters_SCENE_MODE_SPORTS;
extern const gchar *Parameters_SCENE_MODE_PARTY;
extern const gchar *Parameters_SCENE_MODE_CANDLELIGHT;
extern const gchar *Parameters_SCENE_MODE_BARCODE;
extern const gchar *Parameters_SCENE_MODE_BACKLIGHT;
extern const gchar *Parameters_SCENE_MODE_FLOWERS;
extern const gchar *Parameters_SCENE_MODE_AR;
extern const gchar *Parameters_SCENE_MODE_HDR;
extern const gchar *Parameters_FOCUS_MODE_AUTO;
extern const gchar *Parameters_FOCUS_MODE_INFINITY;
extern const gchar *Parameters_FOCUS_MODE_MACRO;