rpicamsrc: Enable image effects

This commit is contained in:
Jan Schmidt 2013-10-14 02:39:00 +11:00 committed by Tim-Philipp Müller
parent 1b9a614272
commit 1dfb41bdce
2 changed files with 14 additions and 1 deletions

View file

@ -581,6 +581,7 @@ void raspicamcontrol_dump_parameters(const RASPICAM_CAMERA_PARAMETERS *params)
fprintf(stderr, "Sharpness %d, Contrast %d, Brightness %d\n", params->sharpness, params->contrast, params->brightness); fprintf(stderr, "Sharpness %d, Contrast %d, Brightness %d\n", params->sharpness, params->contrast, params->brightness);
fprintf(stderr, "Saturation %d, ISO %d, Video Stabilisation %s, Exposure compensation %d\n", params->saturation, params->ISO, params->videoStabilisation ? "Yes": "No", params->exposureCompensation); fprintf(stderr, "Saturation %d, ISO %d, Video Stabilisation %s, Exposure compensation %d\n", params->saturation, params->ISO, params->videoStabilisation ? "Yes": "No", params->exposureCompensation);
//fprintf(stderr, "Exposure Mode '%s', AWB Mode '%s', Image Effect '%s'\n", exp_mode, awb_mode, image_effect); //fprintf(stderr, "Exposure Mode '%s', AWB Mode '%s', Image Effect '%s'\n", exp_mode, awb_mode, image_effect);
fprintf(stderr, "Exposure Mode '%d', AWB Mode '%d', Image Effect '%d'\n", params->exposureMode, params->awbMode, params->imageEffect);
//fprintf(stderr, "Metering Mode '%s', Colour Effect Enabled %s with U = %d, V = %d\n", metering_mode, params->colourEffects.enable ? "Yes":"No", params->colourEffects.u, params->colourEffects.v); //fprintf(stderr, "Metering Mode '%s', Colour Effect Enabled %s with U = %d, V = %d\n", metering_mode, params->colourEffects.enable ? "Yes":"No", params->colourEffects.u, params->colourEffects.v);
fprintf(stderr, "Rotation %d, hflip %s, vflip %s\n", params->rotation, params->hflip ? "Yes":"No",params->vflip ? "Yes":"No"); fprintf(stderr, "Rotation %d, hflip %s, vflip %s\n", params->rotation, params->hflip ? "Yes":"No",params->vflip ? "Yes":"No");
fprintf(stderr, "ROI x %lf, y %f, w %f h %f\n", params->roi.x, params->roi.y, params->roi.w, params->roi.h); fprintf(stderr, "ROI x %lf, y %f, w %f h %f\n", params->roi.x, params->roi.y, params->roi.w, params->roi.h);

View file

@ -261,8 +261,14 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
"White Balance mode", GST_RPI_CAM_TYPE_RPI_CAM_SRC_AWB_MODE, "White Balance mode", GST_RPI_CAM_TYPE_RPI_CAM_SRC_AWB_MODE,
GST_RPI_CAM_SRC_AWB_MODE_AUTO, GST_RPI_CAM_SRC_AWB_MODE_AUTO,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_IMAGE_EFFECT,
g_param_spec_enum ("image-effect", "Image effect",
"Visual FX to apply to the image",
GST_RPI_CAM_TYPE_RPI_CAM_SRC_IMAGE_EFFECT,
GST_RPI_CAM_SRC_IMAGEFX_NONE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#if 0 #if 0
PROP_IMAGE_EFFECT, PROP_IMAGE_EFFECT_PARAMS, PROP_COLOUR_EFFECTS, PROP_IMAGE_EFFECT_PARAMS, PROP_COLOUR_EFFECTS,
#endif #endif
g_object_class_install_property (gobject_class, PROP_ROTATION, g_object_class_install_property (gobject_class, PROP_ROTATION,
g_param_spec_int ("rotation", "Rotation", g_param_spec_int ("rotation", "Rotation",
@ -387,6 +393,9 @@ gst_rpi_cam_src_set_property (GObject * object, guint prop_id,
case PROP_AWB_MODE: case PROP_AWB_MODE:
src->capture_config.camera_parameters.awbMode = g_value_get_enum (value); src->capture_config.camera_parameters.awbMode = g_value_get_enum (value);
break; break;
case PROP_IMAGE_EFFECT:
src->capture_config.camera_parameters.imageEffect = g_value_get_enum (value);
break;
case PROP_HFLIP: case PROP_HFLIP:
src->capture_config.camera_parameters.hflip = g_value_get_boolean (value); src->capture_config.camera_parameters.hflip = g_value_get_boolean (value);
break; break;
@ -472,6 +481,9 @@ gst_rpi_cam_src_get_property (GObject * object, guint prop_id,
case PROP_AWB_MODE: case PROP_AWB_MODE:
g_value_set_enum (value, src->capture_config.camera_parameters.awbMode); g_value_set_enum (value, src->capture_config.camera_parameters.awbMode);
break; break;
case PROP_IMAGE_EFFECT:
g_value_set_enum (value, src->capture_config.camera_parameters.imageEffect);
break;
case PROP_HFLIP: case PROP_HFLIP:
g_value_set_boolean (value, g_value_set_boolean (value,
! !(src->capture_config.camera_parameters.hflip)); ! !(src->capture_config.camera_parameters.hflip));