androidcamera: Implement new GstPhotography enums

This commit is contained in:
Youness Alaoui 2012-11-07 19:16:05 -05:00 committed by Nicolas Dufresne
parent 01d6df438d
commit 08298ef7f5

View file

@ -704,14 +704,16 @@ gst_ahc_src_get_white_balance_mode (GstPhotography * photo,
mode = GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN; mode = GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN;
else if (wb == Parameters_WHITE_BALANCE_FLUORESCENT) else if (wb == Parameters_WHITE_BALANCE_FLUORESCENT)
mode = GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT; mode = GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT;
//else if (wb == Parameters_WHITE_BALANCE_WARM_FLUORESCENT) else if (wb == Parameters_WHITE_BALANCE_WARM_FLUORESCENT)
mode = GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT;
else if (wb == Parameters_WHITE_BALANCE_DAYLIGHT) else if (wb == Parameters_WHITE_BALANCE_DAYLIGHT)
mode = GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT; mode = GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT;
else if (wb == Parameters_WHITE_BALANCE_CLOUDY_DAYLIGHT) else if (wb == Parameters_WHITE_BALANCE_CLOUDY_DAYLIGHT)
mode = GST_PHOTOGRAPHY_WB_MODE_CLOUDY; mode = GST_PHOTOGRAPHY_WB_MODE_CLOUDY;
else if (wb == Parameters_WHITE_BALANCE_TWILIGHT) else if (wb == Parameters_WHITE_BALANCE_TWILIGHT)
mode = GST_PHOTOGRAPHY_WB_MODE_SUNSET; mode = GST_PHOTOGRAPHY_WB_MODE_SUNSET;
//else if (wb == Parameters_WHITE_BALANCE_SHADE) else if (wb == Parameters_WHITE_BALANCE_SHADE)
mode = GST_PHOTOGRAPHY_WB_MODE_SHADE;
else else
ret = FALSE; ret = FALSE;
@ -751,10 +753,14 @@ gst_ahc_src_get_colour_tone_mode (GstPhotography * photo,
mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE; mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE;
else if (effect == Parameters_EFFECT_SEPIA) else if (effect == Parameters_EFFECT_SEPIA)
mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SEPIA; mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SEPIA;
//else if (effect == Parameters_EFFECT_POSTERIZE) else if (effect == Parameters_EFFECT_POSTERIZE)
//else if (effect == Parameters_EFFECT_WHITEBOARD) mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_POSTERIZE;
//else if (effect == Parameters_EFFECT_BLACKBOARD) else if (effect == Parameters_EFFECT_WHITEBOARD)
//else if (effect == Parameters_EFFECT_AQUA) mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_WHITEBOARD;
else if (effect == Parameters_EFFECT_BLACKBOARD)
mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_BLACKBOARD;
else if (effect == Parameters_EFFECT_AQUA)
mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_AQUA;
else else
ret = FALSE; ret = FALSE;
@ -785,25 +791,36 @@ gst_ahc_src_get_scene_mode (GstPhotography * photo, GstSceneMode * scene_mode)
ret = TRUE; ret = TRUE;
if (scene == Parameters_SCENE_MODE_AUTO) if (scene == Parameters_SCENE_MODE_AUTO)
mode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO; mode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO;
//else if (scene == Parameters_SCENE_MODE_ACTION) else if (scene == Parameters_SCENE_MODE_ACTION)
mode = GST_PHOTOGRAPHY_SCENE_MODE_ACTION;
else if (scene == Parameters_SCENE_MODE_PORTRAIT) else if (scene == Parameters_SCENE_MODE_PORTRAIT)
mode = GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT; mode = GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT;
else if (scene == Parameters_SCENE_MODE_LANDSCAPE) else if (scene == Parameters_SCENE_MODE_LANDSCAPE)
mode = GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE; mode = GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE;
else if (scene == Parameters_SCENE_MODE_NIGHT) else if (scene == Parameters_SCENE_MODE_NIGHT)
mode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT; mode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT;
//else if (scene == Parameters_SCENE_MODE_NIGHT_PORTRAIT) else if (scene == Parameters_SCENE_MODE_NIGHT_PORTRAIT)
//else if (scene == Parameters_SCENE_MODE_THEATRE) mode = GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT;
//else if (scene == Parameters_SCENE_MODE_BEACH) else if (scene == Parameters_SCENE_MODE_THEATRE)
//else if (scene == Parameters_SCENE_MODE_SNOW) mode = GST_PHOTOGRAPHY_SCENE_MODE_THEATRE;
//else if (scene == Parameters_SCENE_MODE_SUNSET) else if (scene == Parameters_SCENE_MODE_BEACH)
//else if (scene == Parameters_SCENE_MODE_STEADYPHOTO) mode = GST_PHOTOGRAPHY_SCENE_MODE_BEACH;
//else if (scene == Parameters_SCENE_MODE_FIREWORKS) else if (scene == Parameters_SCENE_MODE_SNOW)
mode = GST_PHOTOGRAPHY_SCENE_MODE_SNOW;
else if (scene == Parameters_SCENE_MODE_SUNSET)
mode = GST_PHOTOGRAPHY_SCENE_MODE_SUNSET;
else if (scene == Parameters_SCENE_MODE_STEADYPHOTO)
mode = GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO;
else if (scene == Parameters_SCENE_MODE_FIREWORKS)
mode = GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS;
else if (scene == Parameters_SCENE_MODE_SPORTS) else if (scene == Parameters_SCENE_MODE_SPORTS)
mode = GST_PHOTOGRAPHY_SCENE_MODE_SPORT; mode = GST_PHOTOGRAPHY_SCENE_MODE_SPORT;
//else if (scene == Parameters_SCENE_MODE_PARTY) else if (scene == Parameters_SCENE_MODE_PARTY)
//else if (scene == Parameters_SCENE_MODE_CANDLELIGHT) mode = GST_PHOTOGRAPHY_SCENE_MODE_PARTY;
//else if (scene == Parameters_SCENE_MODE_BARCODE) else if (scene == Parameters_SCENE_MODE_CANDLELIGHT)
mode = GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT;
else if (scene == Parameters_SCENE_MODE_BARCODE)
mode = GST_PHOTOGRAPHY_SCENE_MODE_BARCODE;
else else
ret = FALSE; ret = FALSE;
@ -946,9 +963,10 @@ gst_ahc_src_get_focus_mode (GstPhotography * photo, GstFocusMode * focus_mode)
mode = GST_PHOTOGRAPHY_FOCUS_MODE_INFINITY; mode = GST_PHOTOGRAPHY_FOCUS_MODE_INFINITY;
else if (focus == Parameters_FOCUS_MODE_MACRO) else if (focus == Parameters_FOCUS_MODE_MACRO)
mode = GST_PHOTOGRAPHY_FOCUS_MODE_MACRO; mode = GST_PHOTOGRAPHY_FOCUS_MODE_MACRO;
//else if (focus == Parameters_FOCUS_MODE_FIXED) else if (focus == Parameters_FOCUS_MODE_FIXED)
else if (focus == Parameters_FOCUS_MODE_EDOF)
mode = GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL; mode = GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL;
else if (focus == Parameters_FOCUS_MODE_EDOF)
mode = GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED;
else if (focus == Parameters_FOCUS_MODE_CONTINUOUS_VIDEO) else if (focus == Parameters_FOCUS_MODE_CONTINUOUS_VIDEO)
mode = GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED; mode = GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED;
else if (focus == Parameters_FOCUS_MODE_CONTINUOUS_PICTURE) else if (focus == Parameters_FOCUS_MODE_CONTINUOUS_PICTURE)
@ -1032,6 +1050,12 @@ gst_ahc_src_set_white_balance_mode (GstPhotography * photo,
case GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT: case GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT:
white_balance = Parameters_WHITE_BALANCE_FLUORESCENT; white_balance = Parameters_WHITE_BALANCE_FLUORESCENT;
break; break;
case GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT:
white_balance = Parameters_WHITE_BALANCE_WARM_FLUORESCENT;
break;
case GST_PHOTOGRAPHY_WB_MODE_SHADE:
white_balance = Parameters_WHITE_BALANCE_SHADE;
break;
default: default:
white_balance = NULL; white_balance = NULL;
break; break;
@ -1078,6 +1102,18 @@ gst_ahc_src_set_colour_tone_mode (GstPhotography * photo,
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE: case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE:
color_effect = Parameters_EFFECT_SOLARIZE; color_effect = Parameters_EFFECT_SOLARIZE;
break; break;
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_POSTERIZE:
color_effect = Parameters_EFFECT_POSTERIZE;
break;
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_WHITEBOARD:
color_effect = Parameters_EFFECT_WHITEBOARD;
break;
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_BLACKBOARD:
color_effect = Parameters_EFFECT_BLACKBOARD;
break;
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_AQUA:
color_effect = Parameters_EFFECT_AQUA;
break;
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NATURAL: case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NATURAL:
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_VIVID: case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_VIVID:
case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_COLORSWAP: case GST_PHOTOGRAPHY_COLOUR_TONE_MODE_COLORSWAP:
@ -1130,6 +1166,39 @@ gst_ahc_src_set_scene_mode (GstPhotography * photo, GstSceneMode scene_mode)
case GST_PHOTOGRAPHY_SCENE_MODE_AUTO: case GST_PHOTOGRAPHY_SCENE_MODE_AUTO:
scene = Parameters_SCENE_MODE_AUTO; scene = Parameters_SCENE_MODE_AUTO;
break; break;
case GST_PHOTOGRAPHY_SCENE_MODE_ACTION:
scene = Parameters_SCENE_MODE_ACTION;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT:
scene = Parameters_SCENE_MODE_NIGHT_PORTRAIT;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_THEATRE:
scene = Parameters_SCENE_MODE_THEATRE;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_BEACH:
scene = Parameters_SCENE_MODE_BEACH;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_SNOW:
scene = Parameters_SCENE_MODE_SNOW;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_SUNSET:
scene = Parameters_SCENE_MODE_SUNSET;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO:
scene = Parameters_SCENE_MODE_STEADYPHOTO;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS:
scene = Parameters_SCENE_MODE_FIREWORKS;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_PARTY:
scene = Parameters_SCENE_MODE_PARTY;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT:
scene = Parameters_SCENE_MODE_CANDLELIGHT;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_BARCODE:
scene = Parameters_SCENE_MODE_BARCODE;
break;
case GST_PHOTOGRAPHY_SCENE_MODE_MANUAL: case GST_PHOTOGRAPHY_SCENE_MODE_MANUAL:
case GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP: case GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP:
default: default:
@ -1297,7 +1366,7 @@ gst_ahc_src_set_focus_mode (GstPhotography * photo, GstFocusMode focus_mode)
focus = Parameters_FOCUS_MODE_INFINITY; focus = Parameters_FOCUS_MODE_INFINITY;
break; break;
case GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL: case GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL:
focus = Parameters_FOCUS_MODE_EDOF; focus = Parameters_FOCUS_MODE_FIXED;
break; break;
case GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL: case GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL:
focus = Parameters_FOCUS_MODE_CONTINUOUS_PICTURE; focus = Parameters_FOCUS_MODE_CONTINUOUS_PICTURE;
@ -1305,8 +1374,10 @@ gst_ahc_src_set_focus_mode (GstPhotography * photo, GstFocusMode focus_mode)
case GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED: case GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED:
focus = Parameters_FOCUS_MODE_CONTINUOUS_VIDEO; focus = Parameters_FOCUS_MODE_CONTINUOUS_VIDEO;
break; break;
case GST_PHOTOGRAPHY_FOCUS_MODE_PORTRAIT:
case GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED: case GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED:
focus = Parameters_FOCUS_MODE_EDOF;
break;
case GST_PHOTOGRAPHY_FOCUS_MODE_PORTRAIT:
default: default:
focus = NULL; focus = NULL;
break; break;