androidcamera: Add more wrappers for the Camera.Parameters class

This commit is contained in:
Youness Alaoui 2012-11-01 11:58:33 -04:00 committed by Nicolas Dufresne
parent 2e745fa1b1
commit 77ba73ca7e
2 changed files with 2348 additions and 45 deletions

File diff suppressed because it is too large Load diff

View file

@ -34,13 +34,15 @@ typedef struct _GstAHCSize GstAHCSize;
typedef struct _GstAHCParameters GstAHCParameters;
/* android.hardware.Camera */
struct _GstAHCamera {
struct _GstAHCamera
{
/* < private > */
jobject object; /* global reference */
jobject object; /* global reference */
};
/* android.hardware.Camera.CameraInfo */
struct _GstAHCCameraInfo {
struct _GstAHCCameraInfo
{
gint facing;
gint orientation;
};
@ -48,16 +50,67 @@ extern gint CameraInfo_CAMERA_FACING_BACK;
extern gint CameraInfo_CAMERA_FACING_FRONT;
/* android.hardware.Camera.Size */
struct _GstAHCSize {
struct _GstAHCSize
{
gint width;
gint height;
};
/* android.hardware.Camera.Parameters */
struct _GstAHCParameters {
struct _GstAHCParameters
{
/* < private > */
jobject object; /* global reference */
jobject object; /* global reference */
};
extern const gchar *Parameters_WHITE_BALANCE_AUTO;
extern const gchar *Parameters_WHITE_BALANCE_INCANDESCENT;
extern const gchar *Parameters_WHITE_BALANCE_FLUORESCENT;
extern const gchar *Parameters_WHITE_BALANCE_WARM_FLUORESCENT;
extern const gchar *Parameters_WHITE_BALANCE_DAYLIGHT;
extern const gchar *Parameters_WHITE_BALANCE_CLOUDY_DAYLIGHT;
extern const gchar *Parameters_WHITE_BALANCE_TWILIGHT;
extern const gchar *Parameters_WHITE_BALANCE_SHADE;
extern const gchar *Parameters_EFFECT_NONE;
extern const gchar *Parameters_EFFECT_MONO;
extern const gchar *Parameters_EFFECT_NEGATIVE;
extern const gchar *Parameters_EFFECT_SOLARIZE;
extern const gchar *Parameters_EFFECT_SEPIA;
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_ANTIBANDING_AUTO;
extern const gchar *Parameters_ANTIBANDING_50HZ;
extern const gchar *Parameters_ANTIBANDING_60HZ;
extern const gchar *Parameters_ANTIBANDING_OFF;
extern const gchar *Parameters_FLASH_MODE_OFF;
extern const gchar *Parameters_FLASH_MODE_AUTO;
extern const gchar *Parameters_FLASH_MODE_ON;
extern const gchar *Parameters_FLASH_MODE_RED_EYE;
extern const gchar *Parameters_FLASH_MODE_TORCH;
extern const gchar *Parameters_SCENE_MODE_AUTO;
extern const gchar *Parameters_SCENE_MODE_ACTION;
extern const gchar *Parameters_SCENE_MODE_PORTRAIT;
extern const gchar *Parameters_SCENE_MODE_LANDSCAPE;
extern const gchar *Parameters_SCENE_MODE_NIGHT;
extern const gchar *Parameters_SCENE_MODE_NIGHT_PORTRAIT;
extern const gchar *Parameters_SCENE_MODE_THEATRE;
extern const gchar *Parameters_SCENE_MODE_BEACH;
extern const gchar *Parameters_SCENE_MODE_SNOW;
extern const gchar *Parameters_SCENE_MODE_SUNSET;
extern const gchar *Parameters_SCENE_MODE_STEADYPHOTO;
extern const gchar *Parameters_SCENE_MODE_FIREWORKS;
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_FOCUS_MODE_AUTO;
extern const gchar *Parameters_FOCUS_MODE_INFINITY;
extern const gchar *Parameters_FOCUS_MODE_MACRO;
extern const gchar *Parameters_FOCUS_MODE_FIXED;
extern const gchar *Parameters_FOCUS_MODE_EDOF;
extern const gchar *Parameters_FOCUS_MODE_CONTINUOUS_VIDEO;
extern const gchar *Parameters_FOCUS_MODE_CONTINUOUS_PICTURE;
/* android.hardware.Camera.ErrorCallback */
typedef void (*GstAHCErrorCallback) (gint error, gpointer user_data);
@ -69,57 +122,113 @@ gboolean gst_android_hardware_camera_init (void);
void gst_android_hardware_camera_deinit (void);
/* android.hardware.Camera */
void gst_ah_camera_add_callback_buffer (GstAHCamera *self,
jbyteArray buffer);
void gst_ah_camera_add_callback_buffer (GstAHCamera * self, jbyteArray buffer);
gboolean gst_ah_camera_get_camera_info (gint camera_id,
GstAHCCameraInfo *camera_info);
GstAHCCameraInfo * camera_info);
gint gst_ah_camera_get_number_of_cameras (void);
GstAHCParameters *gst_ah_camera_get_parameters (GstAHCamera *self);
gboolean gst_ah_camera_lock (GstAHCamera *self);
GstAHCamera * gst_ah_camera_open (gint camera_id);
gboolean gst_ah_camera_reconnect (GstAHCamera *self);
void gst_ah_camera_release (GstAHCamera *self);
gboolean gst_ah_camera_set_parameters (GstAHCamera *self,
GstAHCParameters *params);
gboolean gst_ah_camera_set_error_callback (GstAHCamera *self,
GstAHCParameters *gst_ah_camera_get_parameters (GstAHCamera * self);
gboolean gst_ah_camera_lock (GstAHCamera * self);
GstAHCamera *gst_ah_camera_open (gint camera_id);
gboolean gst_ah_camera_reconnect (GstAHCamera * self);
void gst_ah_camera_release (GstAHCamera * self);
gboolean gst_ah_camera_set_parameters (GstAHCamera * self,
GstAHCParameters * params);
gboolean gst_ah_camera_set_error_callback (GstAHCamera * self,
GstAHCErrorCallback cb, gpointer user_data);
gboolean gst_ah_camera_set_preview_callback_with_buffer (GstAHCamera *self,
gboolean gst_ah_camera_set_preview_callback_with_buffer (GstAHCamera * self,
GstAHCPreviewCallback cb, gpointer user_data);
void gst_ah_camera_set_preview_texture (GstAHCamera *self,
GstAGSurfaceTexture *surfaceTexture);
gboolean gst_ah_camera_start_preview (GstAHCamera *self);
gboolean gst_ah_camera_start_smooth_zoom (GstAHCamera *self, gint value);
gboolean gst_ah_camera_stop_preview (GstAHCamera *self);
gboolean gst_ah_camera_stop_smooth_zoom (GstAHCamera *self);
gboolean gst_ah_camera_unlock (GstAHCamera *self);
void gst_ah_camera_set_preview_texture (GstAHCamera * self,
GstAGSurfaceTexture * surfaceTexture);
gboolean gst_ah_camera_start_preview (GstAHCamera * self);
gboolean gst_ah_camera_start_smooth_zoom (GstAHCamera * self, gint value);
gboolean gst_ah_camera_stop_preview (GstAHCamera * self);
gboolean gst_ah_camera_stop_smooth_zoom (GstAHCamera * self);
gboolean gst_ah_camera_unlock (GstAHCamera * self);
/* android.hardware.Camera.Size */
GstAHCSize *gst_ahc_size_new (gint width, gint height);
void gst_ahc_size_free (GstAHCSize *self);
void gst_ahc_size_free (GstAHCSize * self);
/* android.hardware.Camera.Parameters */
gchar * gst_ahc_parameters_flatten (GstAHCParameters *self);
gint gst_ahc_parameters_get_preview_format (GstAHCParameters *self);
gboolean gst_ahc_parameters_get_preview_fps_range (GstAHCParameters *self,
gint *min, gint *max);
GstAHCSize *gst_ahc_parameters_get_preview_size (GstAHCParameters *self);
gchar *gst_ahc_parameters_flatten (GstAHCParameters * self);
const gchar *gst_ahc_parameters_get_antibanding (GstAHCParameters * self);
const gchar *gst_ahc_parameters_get_color_effect (GstAHCParameters * self);
gint gst_ahc_parameters_get_exposure_compensation (GstAHCParameters * self);
gfloat gst_ahc_parameters_get_exposure_compensation_step (GstAHCParameters
* self);
const gchar *gst_ahc_parameters_get_flash_mode (GstAHCParameters * self);
gfloat gst_ahc_parameters_get_focal_length (GstAHCParameters * self);
const gchar *gst_ahc_parameters_get_focus_mode (GstAHCParameters * self);
gfloat gst_ahc_parameters_get_horizontal_view_angle (GstAHCParameters * self);
gint gst_ahc_parameters_get_max_exposure_compensation (GstAHCParameters * self);
gint gst_ahc_parameters_get_max_zoom (GstAHCParameters * self);
gint gst_ahc_parameters_get_min_exposure_compensation (GstAHCParameters * self);
gint gst_ahc_parameters_get_preview_format (GstAHCParameters * self);
gboolean gst_ahc_parameters_get_preview_fps_range (GstAHCParameters * self,
gint * min, gint * max);
GstAHCSize *gst_ahc_parameters_get_preview_size (GstAHCParameters * self);
const gchar *gst_ahc_parameters_get_scene_mode (GstAHCParameters * self);
/* GList <const gchar *> */
GList *gst_ahc_parameters_get_supported_antibanding (GstAHCParameters * self);
void gst_ahc_parameters_supported_antibanding_free (GList * list);
/* GList <const gchar *> */
GList *gst_ahc_parameters_get_supported_color_effects (GstAHCParameters * self);
void gst_ahc_parameters_supported_color_effects_free (GList * list);
/* GList <const gchar *> */
GList *gst_ahc_parameters_get_supported_flash_modes (GstAHCParameters * self);
void gst_ahc_parameters_supported_flash_modes_free (GList * list);
/* GList <const gchar *> */
GList *gst_ahc_parameters_get_supported_focus_modes (GstAHCParameters * self);
void gst_ahc_parameters_supported_focus_modes_free (GList * list);
/* GList <int> */
GList *gst_ahc_parameters_get_supported_preview_formats (GstAHCParameters *self);
void gst_ahc_parameters_supported_preview_formats_free (GList *list);
GList *gst_ahc_parameters_get_supported_preview_formats (GstAHCParameters
* self);
void gst_ahc_parameters_supported_preview_formats_free (GList * list);
/* GList <int [2]> */
GList *gst_ahc_parameters_get_supported_preview_fps_range (GstAHCParameters *self);
void gst_ahc_parameters_supported_preview_fps_range_free (GList *list);
GList *gst_ahc_parameters_get_supported_preview_fps_range (GstAHCParameters
* self);
void gst_ahc_parameters_supported_preview_fps_range_free (GList * list);
/* GList <GstAHCSize *> */
GList *gst_ahc_parameters_get_supported_preview_sizes (GstAHCParameters *self);
void gst_ahc_parameters_supported_preview_sizes_free (GList *list);
gboolean gst_ahc_parameters_set_preview_format (GstAHCParameters *self, gint format);
gboolean gst_ahc_parameters_set_preview_fps_range (GstAHCParameters *self,
GList *gst_ahc_parameters_get_supported_preview_sizes (GstAHCParameters * self);
void gst_ahc_parameters_supported_preview_sizes_free (GList * list);
/* GList <const gchar *> */
GList *gst_ahc_parameters_get_supported_scene_modes (GstAHCParameters * self);
void gst_ahc_parameters_supported_scene_modes_free (GList * list);
/* GList <const gchar *> */
GList *gst_ahc_parameters_get_supported_white_balance (GstAHCParameters * self);
void gst_ahc_parameters_supported_white_balance_free (GList * list);
gfloat gst_ahc_parameters_get_vertical_view_angle (GstAHCParameters * self);
const gchar *gst_ahc_parameters_get_white_balance (GstAHCParameters * self);
gint gst_ahc_parameters_get_zoom (GstAHCParameters * self);
/* GList <int> */
GList *gst_ahc_parameters_get_zoom_ratios (GstAHCParameters * self);
void gst_ahc_parameters_zoom_ratios_free (GList * list);
gboolean gst_ahc_parameters_is_smooth_zoom_supported (GstAHCParameters * self);
gboolean gst_ahc_parameters_is_zoom_supported (GstAHCParameters * self);
gboolean gst_ahc_parameters_set_antibanding (GstAHCParameters * self,
const gchar * antibanding);
gboolean gst_ahc_parameters_set_color_effect (GstAHCParameters * self,
const gchar * value);
gboolean gst_ahc_parameters_set_exposure_compensation (GstAHCParameters * self,
gint value);
gboolean gst_ahc_parameters_set_flash_mode (GstAHCParameters * self,
const gchar * value);
gboolean gst_ahc_parameters_set_focus_mode (GstAHCParameters * self,
const gchar * value);
gboolean gst_ahc_parameters_set_preview_format (GstAHCParameters * self,
gint format);
gboolean gst_ahc_parameters_set_preview_fps_range (GstAHCParameters * self,
gint min, gint max);
gboolean gst_ahc_parameters_set_preview_size (GstAHCParameters *self,
gboolean gst_ahc_parameters_set_preview_size (GstAHCParameters * self,
gint width, gint height);
gboolean gst_ahc_parameters_unflatten (GstAHCParameters *self, gchar *flattened);
void gst_ahc_parameters_free (GstAHCParameters *self);
gboolean gst_ahc_parameters_set_scene_mode (GstAHCParameters * self,
const gchar * value);
gboolean gst_ahc_parameters_set_white_balance (GstAHCParameters * self,
const gchar * value);
gboolean gst_ahc_parameters_set_zoom (GstAHCParameters * self, gint value);
gboolean gst_ahc_parameters_unflatten (GstAHCParameters * self,
const gchar * flattened);
void gst_ahc_parameters_free (GstAHCParameters * self);
#endif /* __GST_ANDROID_HARDWARE_CAMERA_H__ */