GstPhotography

GstPhotography — Interface for digital image capture elements

Synopsis

                    GstPhotography;
enum                GstWhiteBalanceMode;
enum                GstColourToneMode;
enum                GstSceneMode;
enum                GstFlashMode;
enum                GstFocusStatus;
enum                GstPhotoCaps;
enum                GstPhotoShakeRisk;
void                (*GstPhotoCapturePrepared)          (gpointer data,
                                                         const GstCaps *configured_caps);
gboolean            gst_photography_get_ev_compensation (GstPhotography *photo,
                                                         gfloat *ev_comp);
gboolean            gst_photography_get_iso_speed       (GstPhotography *photo,
                                                         guint *iso_speed);
gboolean            gst_photography_get_aperture        (GstPhotography *photo,
                                                         guint *aperture);
gboolean            gst_photography_get_exposure        (GstPhotography *photo,
                                                         guint32 *exposure);
gboolean            gst_photography_get_white_balance_mode
                                                        (GstPhotography *photo,
                                                         GstWhiteBalanceMode *wb_mode);
gboolean            gst_photography_get_colour_tone_mode
                                                        (GstPhotography *photo,
                                                         GstColourToneMode *tone_mode);
gboolean            gst_photography_get_scene_mode      (GstPhotography *photo,
                                                         GstSceneMode *scene_mode);
gboolean            gst_photography_get_flash_mode      (GstPhotography *photo,
                                                         GstFlashMode *flash_mode);
gboolean            gst_photography_get_zoom            (GstPhotography *photo,
                                                         gfloat *zoom);
gboolean            gst_photography_set_ev_compensation (GstPhotography *photo,
                                                         gfloat ev_comp);
gboolean            gst_photography_set_iso_speed       (GstPhotography *photo,
                                                         guint iso_speed);
gboolean            gst_photography_set_aperture        (GstPhotography *photo,
                                                         guint aperture);
gboolean            gst_photography_set_exposure        (GstPhotography *photo,
                                                         guint exposure);
gboolean            gst_photography_set_white_balance_mode
                                                        (GstPhotography *photo,
                                                         GstWhiteBalanceMode wb_mode);
gboolean            gst_photography_set_colour_tone_mode
                                                        (GstPhotography *photo,
                                                         GstColourToneMode tone_mode);
gboolean            gst_photography_set_scene_mode      (GstPhotography *photo,
                                                         GstSceneMode scene_mode);
gboolean            gst_photography_set_flash_mode      (GstPhotography *photo,
                                                         GstFlashMode flash_mode);
gboolean            gst_photography_set_zoom            (GstPhotography *photo,
                                                         gfloat zoom);
GstPhotoCaps        gst_photography_get_capabilities    (GstPhotography *photo);
gboolean            gst_photography_prepare_for_capture (GstPhotography *photo,
                                                         GstPhotoCapturePrepared func,
                                                         GstCaps *capture_caps,
                                                         gpointer user_data);
void                gst_photography_set_autofocus       (GstPhotography *photo,
                                                         gboolean on);
gboolean            gst_photography_set_config          (GstPhotography *photo,
                                                         GstPhotoSettings *config);
gboolean            gst_photography_get_config          (GstPhotography *photo,
                                                         GstPhotoSettings *config);

Object Hierarchy

  GInterface
   +----GstPhotography

Prerequisites

GstPhotography requires GstImplementsInterface and GstElement.

Known Implementations

GstPhotography is implemented by GstCameraBin.

Description

The interface allows access to some common digital image capture parameters.

Note

The GstPhotography interface is unstable API and may change in future. One can define GST_USE_UNSTABLE_API to acknowledge and avoid this warning.

Details

GstPhotography

typedef struct _GstPhotography GstPhotography;

Opaque GstPhotography data structure.


enum GstWhiteBalanceMode

typedef enum
{
  GST_PHOTOGRAPHY_WB_MODE_AUTO = 0,
  GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT,
  GST_PHOTOGRAPHY_WB_MODE_CLOUDY,
  GST_PHOTOGRAPHY_WB_MODE_SUNSET,
  GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN,
  GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT
} GstWhiteBalanceMode;


enum GstColourToneMode

typedef enum
{
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NORMAL = 0,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SEPIA,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NEGATIVE,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_GRAYSCALE,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NATURAL,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_VIVID,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_COLORSWAP,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE,
  GST_PHOTOGRAPHY_COLOUR_TONE_MODE_OUT_OF_FOCUS
} GstColourToneMode;


enum GstSceneMode

typedef enum
{
  GST_PHOTOGRAPHY_SCENE_MODE_MANUAL = 0,
  GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP,
  GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT,
  GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE,
  GST_PHOTOGRAPHY_SCENE_MODE_SPORT,
  GST_PHOTOGRAPHY_SCENE_MODE_NIGHT,
  GST_PHOTOGRAPHY_SCENE_MODE_AUTO
} GstSceneMode;


enum GstFlashMode

typedef enum
{
  GST_PHOTOGRAPHY_FLASH_MODE_AUTO = 0,
  GST_PHOTOGRAPHY_FLASH_MODE_OFF,
  GST_PHOTOGRAPHY_FLASH_MODE_ON,
  GST_PHOTOGRAPHY_FLASH_MODE_FILL_IN,
  GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE
} GstFlashMode;


enum GstFocusStatus

typedef enum
{
  GST_PHOTOGRAPHY_FOCUS_STATUS_NONE = 0,
  GST_PHOTOGRAPHY_FOCUS_STATUS_RUNNING,
  GST_PHOTOGRAPHY_FOCUS_STATUS_FAIL,
  GST_PHOTOGRAPHY_FOCUS_STATUS_SUCCESS
} GstFocusStatus;


enum GstPhotoCaps

typedef enum
{
  GST_PHOTOGRAPHY_CAPS_NONE = (0 << 0),
  GST_PHOTOGRAPHY_CAPS_EV_COMP = (1 << 0),
  GST_PHOTOGRAPHY_CAPS_ISO_SPEED = (1 << 1),
  GST_PHOTOGRAPHY_CAPS_WB_MODE = (1 << 2),
  GST_PHOTOGRAPHY_CAPS_TONE = (1 << 3),
  GST_PHOTOGRAPHY_CAPS_SCENE = (1 << 4),
  GST_PHOTOGRAPHY_CAPS_FLASH = (1 << 5),
  GST_PHOTOGRAPHY_CAPS_ZOOM = (1 << 6),
  GST_PHOTOGRAPHY_CAPS_FOCUS = (1 << 7),
  GST_PHOTOGRAPHY_CAPS_APERTURE = (1 << 8),
  GST_PHOTOGRAPHY_CAPS_EXPOSURE = (1 << 9),
  GST_PHOTOGRAPHY_CAPS_SHAKE = (1 << 10)
} GstPhotoCaps;


enum GstPhotoShakeRisk

typedef enum
{
  GST_PHOTOGRAPHY_SHAKE_RISK_LOW = 0,
  GST_PHOTOGRAPHY_SHAKE_RISK_MEDIUM,
  GST_PHOTOGRAPHY_SHAKE_RISK_HIGH,
} GstPhotoShakeRisk;


GstPhotoCapturePrepared ()

void                (*GstPhotoCapturePrepared)          (gpointer data,
                                                         const GstCaps *configured_caps);

This callback will be called when the element has finished preparations for photo capture.

data :

user data that has been given, when registering the callback

configured_caps :

GstCaps defining the configured capture format. Ownership of these caps stays in the element.

gst_photography_get_ev_compensation ()

gboolean            gst_photography_get_ev_compensation (GstPhotography *photo,
                                                         gfloat *ev_comp);

Get the ev compensation value for the GstElement

photo :

GstPhotography interface of a GstElement

ev_comp :

ev compensation value to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_iso_speed ()

gboolean            gst_photography_get_iso_speed       (GstPhotography *photo,
                                                         guint *iso_speed);

Get the ISO value (light sensivity) for the GstElement

photo :

GstPhotography interface of a GstElement

iso_speed :

ISO speed value to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_aperture ()

gboolean            gst_photography_get_aperture        (GstPhotography *photo,
                                                         guint *aperture);

Get the aperture value for the GstElement

photo :

GstPhotography interface of a GstElement

aperture :

aperture value to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_exposure ()

gboolean            gst_photography_get_exposure        (GstPhotography *photo,
                                                         guint32 *exposure);

Get the fixed exposure time (in us) for the GstElement

photo :

GstPhotography interface of a GstElement

exposure :

exposure time to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_white_balance_mode ()

gboolean            gst_photography_get_white_balance_mode
                                                        (GstPhotography *photo,
                                                         GstWhiteBalanceMode *wb_mode);

Get the white balance mode for the GstElement

photo :

GstPhotography interface of a GstElement

wb_mode :

GstWhiteBalanceMode to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_colour_tone_mode ()

gboolean            gst_photography_get_colour_tone_mode
                                                        (GstPhotography *photo,
                                                         GstColourToneMode *tone_mode);

Get the colour tone mode for the GstElement

photo :

GstPhotography interface of a GstElement

tone_mode :

GstColourToneMode to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_scene_mode ()

gboolean            gst_photography_get_scene_mode      (GstPhotography *photo,
                                                         GstSceneMode *scene_mode);

Get the scene mode for the GstElement

photo :

GstPhotography interface of a GstElement

scene_mode :

GstSceneMode to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_flash_mode ()

gboolean            gst_photography_get_flash_mode      (GstPhotography *photo,
                                                         GstFlashMode *flash_mode);

Get the flash mode for the GstElement

photo :

GstPhotography interface of a GstElement

flash_mode :

GstFlashMode to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_get_zoom ()

gboolean            gst_photography_get_zoom            (GstPhotography *photo,
                                                         gfloat *zoom);

Get the zoom value for the GstElement

photo :

GstPhotography interface of a GstElement

zoom :

zoom value to get

Returns :

TRUE if getting the value succeeded, FALSE otherwise

gst_photography_set_ev_compensation ()

gboolean            gst_photography_set_ev_compensation (GstPhotography *photo,
                                                         gfloat ev_comp);

Set the ev compensation value for the GstElement

photo :

GstPhotography interface of a GstElement

ev_comp :

ev compensation value to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_iso_speed ()

gboolean            gst_photography_set_iso_speed       (GstPhotography *photo,
                                                         guint iso_speed);

Set the ISO value (light sensivity) for the GstElement

photo :

GstPhotography interface of a GstElement

iso_speed :

ISO speed value to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_aperture ()

gboolean            gst_photography_set_aperture        (GstPhotography *photo,
                                                         guint aperture);

Set the aperture value for the GstElement

photo :

GstPhotography interface of a GstElement

aperture :

aperture value to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_exposure ()

gboolean            gst_photography_set_exposure        (GstPhotography *photo,
                                                         guint exposure);

Set the fixed exposure time (in us) for the GstElement

photo :

GstPhotography interface of a GstElement

exposure :

exposure time to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_white_balance_mode ()

gboolean            gst_photography_set_white_balance_mode
                                                        (GstPhotography *photo,
                                                         GstWhiteBalanceMode wb_mode);

Set the white balance mode for the GstElement

photo :

GstPhotography interface of a GstElement

wb_mode :

GstWhiteBalanceMode to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_colour_tone_mode ()

gboolean            gst_photography_set_colour_tone_mode
                                                        (GstPhotography *photo,
                                                         GstColourToneMode tone_mode);

Set the colour tone mode for the GstElement

photo :

GstPhotography interface of a GstElement

tone_mode :

GstColourToneMode to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_scene_mode ()

gboolean            gst_photography_set_scene_mode      (GstPhotography *photo,
                                                         GstSceneMode scene_mode);

Set the scene mode for the GstElement

photo :

GstPhotography interface of a GstElement

scene_mode :

GstSceneMode to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_flash_mode ()

gboolean            gst_photography_set_flash_mode      (GstPhotography *photo,
                                                         GstFlashMode flash_mode);

Set the flash mode for the GstElement

photo :

GstPhotography interface of a GstElement

flash_mode :

GstFlashMode to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_set_zoom ()

gboolean            gst_photography_set_zoom            (GstPhotography *photo,
                                                         gfloat zoom);

Set the zoom value for the GstElement. E.g. 1.0 to get original image and 3.0 for 3x zoom and so on.

photo :

GstPhotography interface of a GstElement

zoom :

zoom value to set

Returns :

TRUE if setting the value succeeded, FALSE otherwise

gst_photography_get_capabilities ()

GstPhotoCaps        gst_photography_get_capabilities    (GstPhotography *photo);

Get GstPhotoCaps bitmask value that indicates what photography interface features the GstElement supports

photo :

GstPhotography interface of a GstElement

Returns :

GstPhotoCaps value

gst_photography_prepare_for_capture ()

gboolean            gst_photography_prepare_for_capture (GstPhotography *photo,
                                                         GstPhotoCapturePrepared func,
                                                         GstCaps *capture_caps,
                                                         gpointer user_data);

Start preparations for capture. func callback is called after preparations are done.

photo :

GstPhotography interface of a GstElement

func :

callback that is called after capturing has been prepared

capture_caps :

user_data :

user data that will be passed to the callback func

Returns :

TRUE if preparations were started (caps were OK), otherwise FALSE.

gst_photography_set_autofocus ()

void                gst_photography_set_autofocus       (GstPhotography *photo,
                                                         gboolean on);

Start or stop autofocusing. GST_PHOTOGRAPHY_AUTOFOCUS_DONE message is posted to bus when autofocusing has finished.

photo :

GstPhotography interface of a GstElement

on :

TRUE to start autofocusing, FALSE to stop autofocusing

gst_photography_set_config ()

gboolean            gst_photography_set_config          (GstPhotography *photo,
                                                         GstPhotoSettings *config);

Set all configuration settings at once.

photo :

GstPhotography interface of a GstElement

config :

GstPhotoSettings containg the configuration

Returns :

TRUE if configuration was set successfully, otherwise FALSE.

gst_photography_get_config ()

gboolean            gst_photography_get_config          (GstPhotography *photo,
                                                         GstPhotoSettings *config);

Get all configuration settings at once.

photo :

GstPhotography interface of a GstElement

config :

GstPhotoSettings containg the configuration

Returns :

TRUE if configuration was got successfully, otherwise FALSE.