summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2012-11-12 18:18:11 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2016-01-21 13:48:43 -0500
commiteea2904e9d8a5e1cc1e4b58745b661021a7eb25f (patch)
tree48c9effb7851b7ce3b9fe4066c0bc37d4151a2c7 /sys
parenta79beef1c3971f45667f3d41eab1e757711ee3f9 (diff)
downloadgstreamer-plugins-bad-eea2904e9d8a5e1cc1e4b58745b661021a7eb25f.tar.gz
androidcamera: Add video stabilization API
Diffstat (limited to 'sys')
-rw-r--r--sys/androidcamera/gst-android-hardware-camera.c45
-rw-r--r--sys/androidcamera/gst-android-hardware-camera.h5
2 files changed, 50 insertions, 0 deletions
diff --git a/sys/androidcamera/gst-android-hardware-camera.c b/sys/androidcamera/gst-android-hardware-camera.c
index 2352e93c8..92dc95d4d 100644
--- a/sys/androidcamera/gst-android-hardware-camera.c
+++ b/sys/androidcamera/gst-android-hardware-camera.c
@@ -104,10 +104,12 @@ static struct
jmethodID getSupportedSceneModes;
jmethodID getSupportedWhiteBalance;
jmethodID getVerticalViewAngle;
+ jmethodID getVideoStabilization;
jmethodID getWhiteBalance;
jmethodID getZoom;
jmethodID getZoomRatios;
jmethodID isSmoothZoomSupported;
+ jmethodID isVideoStabilizationSupported;
jmethodID isZoomSupported;
jmethodID setAntibanding;
jmethodID setColorEffect;
@@ -118,6 +120,7 @@ static struct
jmethodID setPreviewFpsRange;
jmethodID setPreviewSize;
jmethodID setSceneMode;
+ jmethodID setVideoStabilization;
jmethodID setWhiteBalance;
jmethodID setZoom;
jmethodID unflatten;
@@ -371,6 +374,8 @@ _init_classes (void)
getExposureCompensationStep, "()F");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, getFlashMode,
"()Ljava/lang/String;");
+ GST_DVM_GET_METHOD (android_hardware_camera_parameters, getFocalLength,
+ "()F");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, getFocusMode,
"()Ljava/lang/String;");
GST_DVM_GET_METHOD (android_hardware_camera_parameters,
@@ -408,6 +413,8 @@ _init_classes (void)
getSupportedWhiteBalance, "()Ljava/util/List;");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, getVerticalViewAngle,
"()F");
+ GST_DVM_GET_METHOD (android_hardware_camera_parameters, getVideoStabilization,
+ "()Z");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, getWhiteBalance,
"()Ljava/lang/String;");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, getZoom, "()I");
@@ -415,6 +422,8 @@ _init_classes (void)
"()Ljava/util/List;");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, isSmoothZoomSupported,
"()Z");
+ GST_DVM_GET_METHOD (android_hardware_camera_parameters,
+ isVideoStabilizationSupported, "()Z");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, isZoomSupported,
"()Z");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, setAntibanding,
@@ -437,6 +446,8 @@ _init_classes (void)
"(Ljava/lang/String;)V");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, setWhiteBalance,
"(Ljava/lang/String;)V");
+ GST_DVM_GET_METHOD (android_hardware_camera_parameters, setVideoStabilization,
+ "(Z)V");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, setZoom, "(I)V");
GST_DVM_GET_METHOD (android_hardware_camera_parameters, unflatten,
"(Ljava/lang/String;)V");
@@ -3034,6 +3045,17 @@ gst_ahc_parameters_get_vertical_view_angle (GstAHCParameters * self)
return angle;
}
+gboolean
+gst_ahc_parameters_get_video_stabilization (GstAHCParameters * self)
+{
+ JNIEnv *env = gst_dvm_get_env ();
+ gboolean ret;
+
+ ret = AHCP_CALL (return FALSE, Boolean, getVideoStabilization);
+
+ return ret;
+}
+
const gchar *
gst_ahc_parameters_get_white_balance (GstAHCParameters * self)
{
@@ -3112,6 +3134,17 @@ gst_ahc_parameters_is_smooth_zoom_supported (GstAHCParameters * self)
}
gboolean
+gst_ahc_parameters_is_video_stabilization_supported (GstAHCParameters * self)
+{
+ JNIEnv *env = gst_dvm_get_env ();
+ gboolean supported;
+
+ supported = AHCP_CALL (return FALSE, Boolean, isVideoStabilizationSupported);
+
+ return supported;
+}
+
+gboolean
gst_ahc_parameters_is_zoom_supported (GstAHCParameters * self)
{
JNIEnv *env = gst_dvm_get_env ();
@@ -3242,6 +3275,18 @@ gst_ahc_parameters_set_scene_mode (GstAHCParameters * self, const gchar * value)
return TRUE;
}
+
+gboolean
+gst_ahc_parameters_set_video_stabilization (GstAHCParameters * self,
+ gboolean toggle)
+{
+ JNIEnv *env = gst_dvm_get_env ();
+
+ AHCP_CALL (return FALSE, Void, setVideoStabilization, toggle);
+
+ return TRUE;
+}
+
gboolean
gst_ahc_parameters_set_white_balance (GstAHCParameters * self,
const gchar * value)
diff --git a/sys/androidcamera/gst-android-hardware-camera.h b/sys/androidcamera/gst-android-hardware-camera.h
index 6ce80337c..9e58ac302 100644
--- a/sys/androidcamera/gst-android-hardware-camera.h
+++ b/sys/androidcamera/gst-android-hardware-camera.h
@@ -204,12 +204,15 @@ void gst_ahc_parameters_supported_scene_modes_free (GList * list);
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);
+gboolean gst_ahc_parameters_get_video_stabilization (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_video_stabilization_supported (
+ GstAHCParameters * self);
gboolean gst_ahc_parameters_is_zoom_supported (GstAHCParameters * self);
gboolean gst_ahc_parameters_set_antibanding (GstAHCParameters * self,
const gchar * antibanding);
@@ -231,6 +234,8 @@ 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_video_stabilization (GstAHCParameters * self,
+ gboolean toggle);
gboolean gst_ahc_parameters_set_zoom (GstAHCParameters * self, gint value);
gboolean gst_ahc_parameters_unflatten (GstAHCParameters * self,
const gchar * flattened);