Permalink
Browse files

Update C code

  • Loading branch information...
mmontero committed May 2, 2011
1 parent a3384c2 commit dd25c7e6514fe39b67b6f98e2569b1d432b0118e
Showing with 805 additions and 793 deletions.
  1. +1 −1 src/AbstcCliRegister.c
  2. +1 −1 src/AbstcSensor.c
  3. +8 −8 src/AbstcVideoProcessor.c
  4. +221 −229 src/cli_dm365ipipe.c
  5. +64 −56 src/cli_mt9p031.c
  6. +26 −48 src/command.c
  7. +118 −127 src/ipipe-client.c
  8. +173 −169 src/ipiped-dm365.c
  9. +95 −54 src/ipiped-mt9p031.c
  10. +69 −61 src/ipiped.c
  11. +29 −39 src/main.c
View
@@ -1,4 +1,4 @@
-/* AbstcCliRegister.c generated by valac 0.11.5, the Vala compiler
+/* AbstcCliRegister.c generated by valac 0.12.0, the Vala compiler
* generated from AbstcCliRegister.vala, do not modify */
View
@@ -1,4 +1,4 @@
-/* AbstcSensor.c generated by valac 0.11.5, the Vala compiler
+/* AbstcSensor.c generated by valac 0.12.0, the Vala compiler
* generated from AbstcSensor.vala, do not modify */
View
@@ -1,4 +1,4 @@
-/* AbstcVideoProcessor.c generated by valac 0.11.5, the Vala compiler
+/* AbstcVideoProcessor.c generated by valac 0.12.0, the Vala compiler
* generated from AbstcVideoProcessor.vala, do not modify */
@@ -29,7 +29,7 @@ struct _AbstcVideoProcessor {
struct _AbstcVideoProcessorClass {
GObjectClass parent_class;
- gint (*get_video_processor_data) (AbstcVideoProcessor* self, struct rraew_interface* interf);
+ gboolean (*get_video_processor_data) (AbstcVideoProcessor* self, struct rraew_interface* interf);
};
@@ -41,20 +41,20 @@ GType abstc_video_processor_get_type (void) G_GNUC_CONST;
enum {
ABSTC_VIDEO_PROCESSOR_DUMMY_PROPERTY
};
-gint abstc_video_processor_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf);
-static gint abstc_video_processor_real_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf);
+gboolean abstc_video_processor_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf);
+static gboolean abstc_video_processor_real_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf);
AbstcVideoProcessor* abstc_video_processor_construct (GType object_type);
static void abstc_video_processor_finalize (GObject* obj);
-static gint abstc_video_processor_real_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf) {
- g_return_val_if_fail (self != NULL, 0);
+static gboolean abstc_video_processor_real_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf) {
+ g_return_val_if_fail (self != NULL, FALSE);
g_critical ("Type `%s' does not implement abstract method `abstc_video_processor_get_video_processor_data'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
- return 0;
+ return FALSE;
}
-gint abstc_video_processor_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf) {
+gboolean abstc_video_processor_get_video_processor_data (AbstcVideoProcessor* self, struct rraew_interface* interf) {
return ABSTC_VIDEO_PROCESSOR_GET_CLASS (self)->get_video_processor_data (self, interf);
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* cli_mt9p031.c generated by valac 0.11.5, the Vala compiler
+/* cli_mt9p031.c generated by valac 0.12.0, the Vala compiler
* generated from cli_mt9p031.vala, do not modify */
@@ -259,7 +259,7 @@ GType imt9p031_get_type (void) {
}
-G_DEFINE_TYPE_EXTENDED (Imt9p031Proxy, imt9p031_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_IMT9P031, imt9p031_proxy_imt9p031_interface_init) );
+G_DEFINE_TYPE_EXTENDED (Imt9p031Proxy, imt9p031_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_IMT9P031, imt9p031_proxy_imt9p031_interface_init) )
static void imt9p031_proxy_class_init (Imt9p031ProxyClass* klass) {
G_DBUS_PROXY_CLASS (klass)->g_signal = imt9p031_proxy_g_signal;
}
@@ -281,7 +281,7 @@ static gint imt9p031_proxy_set_sensor_gain (Imt9p031* self, gdouble r_gain, gdou
GVariant *_reply;
GVariantIter _reply_iter;
gint _result;
- GVariant* _tmp29_;
+ GVariant* _tmp33_;
G_IO_ERROR;
_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.ridgerun.mt9p031Interface", "SetSensorGain");
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
@@ -301,9 +301,9 @@ static gint imt9p031_proxy_set_sensor_gain (Imt9p031* self, gdouble r_gain, gdou
}
_reply = g_dbus_message_get_body (_reply_message);
g_variant_iter_init (&_reply_iter, _reply);
- _tmp29_ = g_variant_iter_next_value (&_reply_iter);
- _result = g_variant_get_int32 (_tmp29_);
- g_variant_unref (_tmp29_);
+ _tmp33_ = g_variant_iter_next_value (&_reply_iter);
+ _result = g_variant_get_int32 (_tmp33_);
+ g_variant_unref (_tmp33_);
g_object_unref (_reply_message);
return _result;
}
@@ -317,7 +317,7 @@ static gint imt9p031_proxy_get_sensor_gain (Imt9p031* self, GError** error) {
GVariant *_reply;
GVariantIter _reply_iter;
gint _result;
- GVariant* _tmp30_;
+ GVariant* _tmp34_;
G_IO_ERROR;
_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.ridgerun.mt9p031Interface", "GetSensorGain");
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
@@ -334,9 +334,9 @@ static gint imt9p031_proxy_get_sensor_gain (Imt9p031* self, GError** error) {
}
_reply = g_dbus_message_get_body (_reply_message);
g_variant_iter_init (&_reply_iter, _reply);
- _tmp30_ = g_variant_iter_next_value (&_reply_iter);
- _result = g_variant_get_int32 (_tmp30_);
- g_variant_unref (_tmp30_);
+ _tmp34_ = g_variant_iter_next_value (&_reply_iter);
+ _result = g_variant_get_int32 (_tmp34_);
+ g_variant_unref (_tmp34_);
g_object_unref (_reply_message);
return _result;
}
@@ -350,7 +350,7 @@ static gint imt9p031_proxy_sensor_flip_vertically (Imt9p031* self, const gchar*
GVariant *_reply;
GVariantIter _reply_iter;
gint _result;
- GVariant* _tmp31_;
+ GVariant* _tmp35_;
G_IO_ERROR;
_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.ridgerun.mt9p031Interface", "SensorFlipVertically");
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
@@ -368,9 +368,9 @@ static gint imt9p031_proxy_sensor_flip_vertically (Imt9p031* self, const gchar*
}
_reply = g_dbus_message_get_body (_reply_message);
g_variant_iter_init (&_reply_iter, _reply);
- _tmp31_ = g_variant_iter_next_value (&_reply_iter);
- _result = g_variant_get_int32 (_tmp31_);
- g_variant_unref (_tmp31_);
+ _tmp35_ = g_variant_iter_next_value (&_reply_iter);
+ _result = g_variant_get_int32 (_tmp35_);
+ g_variant_unref (_tmp35_);
g_object_unref (_reply_message);
return _result;
}
@@ -384,7 +384,7 @@ static gint imt9p031_proxy_sensor_flip_horizontally (Imt9p031* self, const gchar
GVariant *_reply;
GVariantIter _reply_iter;
gint _result;
- GVariant* _tmp32_;
+ GVariant* _tmp36_;
G_IO_ERROR;
_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.ridgerun.mt9p031Interface", "SensorFlipHorizontally");
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
@@ -402,9 +402,9 @@ static gint imt9p031_proxy_sensor_flip_horizontally (Imt9p031* self, const gchar
}
_reply = g_dbus_message_get_body (_reply_message);
g_variant_iter_init (&_reply_iter, _reply);
- _tmp32_ = g_variant_iter_next_value (&_reply_iter);
- _result = g_variant_get_int32 (_tmp32_);
- g_variant_unref (_tmp32_);
+ _tmp36_ = g_variant_iter_next_value (&_reply_iter);
+ _result = g_variant_get_int32 (_tmp36_);
+ g_variant_unref (_tmp36_);
g_object_unref (_reply_message);
return _result;
}
@@ -418,7 +418,7 @@ static gint imt9p031_proxy_get_exposure_time (Imt9p031* self, GError** error) {
GVariant *_reply;
GVariantIter _reply_iter;
gint _result;
- GVariant* _tmp33_;
+ GVariant* _tmp37_;
G_IO_ERROR;
_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.ridgerun.mt9p031Interface", "GetExposureTime");
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
@@ -435,9 +435,9 @@ static gint imt9p031_proxy_get_exposure_time (Imt9p031* self, GError** error) {
}
_reply = g_dbus_message_get_body (_reply_message);
g_variant_iter_init (&_reply_iter, _reply);
- _tmp33_ = g_variant_iter_next_value (&_reply_iter);
- _result = g_variant_get_int32 (_tmp33_);
- g_variant_unref (_tmp33_);
+ _tmp37_ = g_variant_iter_next_value (&_reply_iter);
+ _result = g_variant_get_int32 (_tmp37_);
+ g_variant_unref (_tmp37_);
g_object_unref (_reply_message);
return _result;
}
@@ -451,7 +451,7 @@ static gint imt9p031_proxy_set_exposure_time (Imt9p031* self, gint _exp_time, GE
GVariant *_reply;
GVariantIter _reply_iter;
gint _result;
- GVariant* _tmp34_;
+ GVariant* _tmp38_;
G_IO_ERROR;
_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "com.ridgerun.mt9p031Interface", "SetExposureTime");
g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
@@ -469,9 +469,9 @@ static gint imt9p031_proxy_set_exposure_time (Imt9p031* self, gint _exp_time, GE
}
_reply = g_dbus_message_get_body (_reply_message);
g_variant_iter_init (&_reply_iter, _reply);
- _tmp34_ = g_variant_iter_next_value (&_reply_iter);
- _result = g_variant_get_int32 (_tmp34_);
- g_variant_unref (_tmp34_);
+ _tmp38_ = g_variant_iter_next_value (&_reply_iter);
+ _result = g_variant_get_int32 (_tmp38_);
+ g_variant_unref (_tmp38_);
g_object_unref (_reply_message);
return _result;
}
@@ -491,25 +491,25 @@ static void _dbus_imt9p031_set_sensor_gain (Imt9p031* self, GVariant* parameters
GError* error = NULL;
GVariantIter _arguments_iter;
gdouble r_gain = 0.0;
- GVariant* _tmp35_;
+ GVariant* _tmp39_;
gdouble g_gain = 0.0;
- GVariant* _tmp36_;
+ GVariant* _tmp40_;
gdouble b_gain = 0.0;
- GVariant* _tmp37_;
+ GVariant* _tmp41_;
GDBusMessage* _reply_message;
GVariant* _reply;
GVariantBuilder _reply_builder;
gint result;
g_variant_iter_init (&_arguments_iter, parameters);
- _tmp35_ = g_variant_iter_next_value (&_arguments_iter);
- r_gain = g_variant_get_double (_tmp35_);
- g_variant_unref (_tmp35_);
- _tmp36_ = g_variant_iter_next_value (&_arguments_iter);
- g_gain = g_variant_get_double (_tmp36_);
- g_variant_unref (_tmp36_);
- _tmp37_ = g_variant_iter_next_value (&_arguments_iter);
- b_gain = g_variant_get_double (_tmp37_);
- g_variant_unref (_tmp37_);
+ _tmp39_ = g_variant_iter_next_value (&_arguments_iter);
+ r_gain = g_variant_get_double (_tmp39_);
+ g_variant_unref (_tmp39_);
+ _tmp40_ = g_variant_iter_next_value (&_arguments_iter);
+ g_gain = g_variant_get_double (_tmp40_);
+ g_variant_unref (_tmp40_);
+ _tmp41_ = g_variant_iter_next_value (&_arguments_iter);
+ b_gain = g_variant_get_double (_tmp41_);
+ g_variant_unref (_tmp41_);
result = imt9p031_set_sensor_gain (self, r_gain, g_gain, b_gain, &error);
if (error) {
g_dbus_method_invocation_return_gerror (invocation, error);
@@ -554,15 +554,15 @@ static void _dbus_imt9p031_sensor_flip_vertically (Imt9p031* self, GVariant* par
GError* error = NULL;
GVariantIter _arguments_iter;
gchar* state = NULL;
- GVariant* _tmp38_;
+ GVariant* _tmp42_;
GDBusMessage* _reply_message;
GVariant* _reply;
GVariantBuilder _reply_builder;
gint result;
g_variant_iter_init (&_arguments_iter, parameters);
- _tmp38_ = g_variant_iter_next_value (&_arguments_iter);
- state = g_variant_dup_string (_tmp38_, NULL);
- g_variant_unref (_tmp38_);
+ _tmp42_ = g_variant_iter_next_value (&_arguments_iter);
+ state = g_variant_dup_string (_tmp42_, NULL);
+ g_variant_unref (_tmp42_);
result = imt9p031_sensor_flip_vertically (self, state, &error);
if (error) {
g_dbus_method_invocation_return_gerror (invocation, error);
@@ -584,15 +584,15 @@ static void _dbus_imt9p031_sensor_flip_horizontally (Imt9p031* self, GVariant* p
GError* error = NULL;
GVariantIter _arguments_iter;
gchar* state = NULL;
- GVariant* _tmp39_;
+ GVariant* _tmp43_;
GDBusMessage* _reply_message;
GVariant* _reply;
GVariantBuilder _reply_builder;
gint result;
g_variant_iter_init (&_arguments_iter, parameters);
- _tmp39_ = g_variant_iter_next_value (&_arguments_iter);
- state = g_variant_dup_string (_tmp39_, NULL);
- g_variant_unref (_tmp39_);
+ _tmp43_ = g_variant_iter_next_value (&_arguments_iter);
+ state = g_variant_dup_string (_tmp43_, NULL);
+ g_variant_unref (_tmp43_);
result = imt9p031_sensor_flip_horizontally (self, state, &error);
if (error) {
g_dbus_method_invocation_return_gerror (invocation, error);
@@ -638,15 +638,15 @@ static void _dbus_imt9p031_set_exposure_time (Imt9p031* self, GVariant* paramete
GError* error = NULL;
GVariantIter _arguments_iter;
gint _exp_time = 0;
- GVariant* _tmp40_;
+ GVariant* _tmp44_;
GDBusMessage* _reply_message;
GVariant* _reply;
GVariantBuilder _reply_builder;
gint result;
g_variant_iter_init (&_arguments_iter, parameters);
- _tmp40_ = g_variant_iter_next_value (&_arguments_iter);
- _exp_time = g_variant_get_int32 (_tmp40_);
- g_variant_unref (_tmp40_);
+ _tmp44_ = g_variant_iter_next_value (&_arguments_iter);
+ _exp_time = g_variant_get_int32 (_tmp44_);
+ g_variant_unref (_tmp44_);
result = imt9p031_set_exposure_time (self, _exp_time, &error);
if (error) {
g_dbus_method_invocation_return_gerror (invocation, error);
@@ -742,6 +742,16 @@ cli_mt9p031* cli_mt9p031_new (gboolean debug) {
}
+static gdouble double_parse (const gchar* str) {
+ gdouble result = 0.0;
+ gdouble _tmp0_;
+ g_return_val_if_fail (str != NULL, 0.0);
+ _tmp0_ = g_ascii_strtod (str, NULL);
+ result = _tmp0_;
+ return result;
+}
+
+
gint cli_mt9p031_cmd_set_sensor_gain (cli_mt9p031* self, gchar** args, int args_length1) {
gint result = 0;
gboolean _tmp0_ = FALSE;
@@ -771,11 +781,11 @@ gint cli_mt9p031_cmd_set_sensor_gain (cli_mt9p031* self, gchar** args, int args_
result = -1;
return result;
}
- _tmp2_ = g_ascii_strtod (args[1], NULL);
+ _tmp2_ = double_parse (args[1]);
red = _tmp2_;
- _tmp3_ = g_ascii_strtod (args[2], NULL);
+ _tmp3_ = double_parse (args[2]);
green = _tmp3_;
- _tmp4_ = g_ascii_strtod (args[3], NULL);
+ _tmp4_ = double_parse (args[3]);
blue = _tmp4_;
_tmp5_ = imt9p031_set_sensor_gain (self->sensor, red, green, blue, &_inner_error_);
ret = _tmp5_;
@@ -1081,7 +1091,6 @@ static void cli_mt9p031_real_registration (AbstcCliRegister* base, IpipeCli* cli
cli_mt9p031 * self;
Imt9p031* _tmp0_ = NULL;
Imt9p031* _tmp1_;
- Imt9p031* _tmp2_;
GError * _inner_error_ = NULL;
self = (cli_mt9p031*) base;
g_return_if_fail (cli != NULL);
@@ -1103,9 +1112,8 @@ static void cli_mt9p031_real_registration (AbstcCliRegister* base, IpipeCli* cli
return;
}
}
- _tmp2_ = _tmp1_;
_g_object_unref0 (self->sensor);
- self->sensor = _tmp2_;
+ self->sensor = _tmp1_;
return;
}
Oops, something went wrong.

0 comments on commit dd25c7e

Please sign in to comment.