photography: Add additional settings relevant to Android

Exposure mode property, extra colour tone values (aqua, emboss, sketch, neon), extra scene modes (backlight, flowers, AR, HDR).
Missing vmethods for exposure mode, analog gain, lens focus, colour temperature, min & max exposure time

Contribs by Mohammed Sameer <msameer@foolab.org>, Adam Pigg <adam@piggz.co.uk>
This commit is contained in:
Andrew Branson 2019-10-10 18:18:26 +02:00 committed by Andrew Branson
parent 6af38c6ffe
commit 8de7b41015
3 changed files with 66 additions and 3 deletions

View file

@ -101,6 +101,18 @@ gst_photography_iface_base_init (GstPhotographyInterface * iface)
iface->set_autofocus = NULL;
iface->set_config = NULL;
iface->get_config = NULL;
iface->set_exposure_mode = NULL;
iface->get_exposure_mode = NULL;
iface->set_analog_gain = NULL;
iface->get_analog_gain = NULL;
iface->set_lens_focus = NULL;
iface->get_lens_focus = NULL;
iface->set_color_temperature = NULL;
iface->get_color_temperature = NULL;
iface->set_min_exposure_time = NULL;
iface->get_min_exposure_time = NULL;
iface->set_max_exposure_time = NULL;
iface->get_max_exposure_time = NULL;
}
#define GST_PHOTOGRAPHY_FUNC_TEMPLATE(function_name, param_type) \
@ -709,4 +721,12 @@ gst_photography_iface_class_init (gpointer g_class)
"Which noise reduction modes are enabled (0 = disabled)",
GST_TYPE_PHOTOGRAPHY_NOISE_REDUCTION,
0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/* Exposure mode */
g_object_interface_install_property (g_class,
g_param_spec_enum (GST_PHOTOGRAPHY_PROP_EXPOSURE_MODE,
"Exposure mode property",
"Exposure mode to either automatic or manual",
GST_TYPE_PHOTOGRAPHY_EXPOSURE_MODE,
0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

View file

@ -187,6 +187,10 @@ typedef enum
* @GST_PHOTOGRAPHY_COLOR_TONE_MODE_WHITEBOARD: Whiteboard (Since: 1.2)
* @GST_PHOTOGRAPHY_COLOR_TONE_MODE_BLACKBOARD: Blackboard (Since: 1.2)
* @GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA: Aqua (Since: 1.2)
* @GST_PHOTOGRAPHY_COLOR_TONE_MODE_EMBOSS: Emboss (Since: 1.18)
* @GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKETCH: Sketch (Since: 1.18)
* @GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEON: Neon (Since: 1.18)
*
*
* Modes for special color effects.
*/
@ -207,7 +211,10 @@ typedef enum
GST_PHOTOGRAPHY_COLOR_TONE_MODE_POSTERIZE,
GST_PHOTOGRAPHY_COLOR_TONE_MODE_WHITEBOARD,
GST_PHOTOGRAPHY_COLOR_TONE_MODE_BLACKBOARD,
GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA
GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA,
GST_PHOTOGRAPHY_COLOR_TONE_MODE_EMBOSS,
GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKETCH,
GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEON
} GstPhotographyColorToneMode;
/**
@ -236,6 +243,10 @@ typedef enum
* of scenes lit by candles (Since: 1.2)
* @GST_PHOTOGRAPHY_SCENE_MODE_BARCODE: Applications are looking for
* a barcode (Since: 1.2)
* @GST_PHOTOGRAPHY_SCENE_MODE_BACKLIGHT: Backlit photos (Since: 1.18)
* @GST_PHOTOGRAPHY_SCENE_MODE_FLOWERS: For shooting flowers (Since: 1.18)
* @GST_PHOTOGRAPHY_SCENE_MODE_AR: Specific for Augmented Reality (Since: 1.18)
* @GST_PHOTOGRAPHY_SCENE_MODE_HDR: High Dynamic Range photography (Since: 1.18)
*
* Each mode contains preset #GstPhotography options in order to produce
* good capturing result in certain scene.
@ -259,7 +270,11 @@ typedef enum
GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS,
GST_PHOTOGRAPHY_SCENE_MODE_PARTY,
GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT,
GST_PHOTOGRAPHY_SCENE_MODE_BARCODE
GST_PHOTOGRAPHY_SCENE_MODE_BARCODE,
GST_PHOTOGRAPHY_SCENE_MODE_BACKLIGHT,
GST_PHOTOGRAPHY_SCENE_MODE_FLOWERS,
GST_PHOTOGRAPHY_SCENE_MODE_AR,
GST_PHOTOGRAPHY_SCENE_MODE_HDR
} GstPhotographySceneMode;
/**
@ -474,6 +489,18 @@ typedef void (*GstPhotographyCapturePrepared) (gpointer data, const GstCaps *con
* @set_config: vmethod to set all configuration parameters at once
* @get_config: vmethod to get all configuration parameters at once
* @get_image_capture_supported_caps: vmethod to get caps describing supported image capture formats
* @set_exposure_mode: vmethod to set exposure mode (Since: 1.18)
* @get_exposure_mode: vmethod to get exposure mode (Since: 1.18)
* @set_analog_gain: vmethod to set analog gain (Since: 1.18)
* @get_analog_gain: vmethod to get analog gain (Since: 1.18)
* @set_lens_focus: vmethod to set lens focus (Since: 1.18)
* @get_lens_focus: vmethod to get lens focus (Since: 1.18)
* @set_color_temperature: vmethod to set color temperature (Since: 1.18)
* @get_color_temperature: vmethod to get color temperature (Since: 1.18)
* @set_min_exposure_time: vmethod to set min exposure time (Since: 1.18)
* @get_min_exposure_time: vmethod to get min exposure time (Since: 1.18)
* @set_max_exposure_time: vmethod to set max exposure time (Since: 1.18)
* @get_max_exposure_time: vmethod to get max exposure time (Since: 1.18)
*
* #GstPhotographyInterface interface.
*/
@ -518,6 +545,19 @@ typedef struct _GstPhotographyInterface
gboolean (*get_noise_reduction) (GstPhotography * photo, GstPhotographyNoiseReduction * noise_reduction);
gboolean (*set_noise_reduction) (GstPhotography * photo, GstPhotographyNoiseReduction noise_reduction);
gboolean (*set_exposure_mode) (GstPhotography * photo, GstPhotographyExposureMode exposure_mode);
gboolean (*get_exposure_mode) (GstPhotography * photo, GstPhotographyExposureMode * exposure_mode);
gboolean (*set_analog_gain) (GstPhotography * photo, gfloat analog_gain);
gboolean (*get_analog_gain) (GstPhotography * photo, gfloat * analog_gain);
gboolean (*set_lens_focus) (GstPhotography * photo, gfloat lens_focus);
gboolean (*get_lens_focus) (GstPhotography * photo, gfloat * lens_focus);
gboolean (*set_color_temperature) (GstPhotography * photo, guint color_temperature);
gboolean (*get_color_temperature) (GstPhotography * photo, guint * color_temperature);
gboolean (*set_min_exposure_time) (GstPhotography * photo, guint min_exposure_time);
gboolean (*get_min_exposure_time) (GstPhotography * photo, guint * min_exposure_time);
gboolean (*set_max_exposure_time) (GstPhotography * photo, guint max_exposure_time);
gboolean (*get_max_exposure_time) (GstPhotography * photo, guint * max_exposure_time);
/* FIXME: remove padding, not needed for interfaces */
/*< private > */
gpointer _gst_reserved[GST_PADDING];

View file

@ -256,7 +256,8 @@ enum
PROP_LENS_FOCUS,
PROP_MIN_EXPOSURE_TIME,
PROP_MAX_EXPORURE_TIME,
PROP_NOISE_REDUCTION
PROP_NOISE_REDUCTION,
PROP_EXPOSURE_MODE
};
static gboolean
@ -424,6 +425,8 @@ gst_test_video_src_class_init (GstTestVideoSrcClass * klass)
GST_PHOTOGRAPHY_PROP_MAX_EXPOSURE_TIME);
g_object_class_override_property (gobject_class, PROP_NOISE_REDUCTION,
GST_PHOTOGRAPHY_PROP_NOISE_REDUCTION);
g_object_class_override_property (gobject_class, PROP_EXPOSURE_MODE,
GST_PHOTOGRAPHY_PROP_EXPOSURE_MODE);
}
static void