static GObject * arv_camera_constructor (GType gtype, guint n_properties, GObjectConstructParam *properties) { GObject *object; ArvCamera *camera; ArvCameraVendor vendor; ArvCameraSeries series; const char *vendor_name; const char *model_name; /* always call parent constructor */ object = parent_class->constructor(gtype, n_properties, properties); camera = ARV_CAMERA (object); if (!camera->priv->device) camera->priv->device = arv_open_device (NULL); if (!ARV_IS_DEVICE (camera->priv->device)) return NULL; camera->priv->genicam = arv_device_get_genicam (camera->priv->device); vendor_name = arv_camera_get_vendor_name (camera); model_name = arv_camera_get_model_name (camera); if (g_strcmp0 (vendor_name, "Basler") == 0) { vendor = ARV_CAMERA_VENDOR_BASLER; if (g_str_has_prefix (model_name, "acA")) series = ARV_CAMERA_SERIES_BASLER_ACE; else if (g_str_has_prefix (model_name, "scA")) series = ARV_CAMERA_SERIES_BASLER_SCOUT; else series = ARV_CAMERA_SERIES_BASLER_OTHER; } else if (g_strcmp0 (vendor_name, "Prosilica") == 0) { vendor = ARV_CAMERA_VENDOR_PROSILICA; series = ARV_CAMERA_SERIES_PROSILICA; } else if (g_strcmp0 (vendor_name, "The Imaging Source Europe GmbH") == 0) { vendor = ARV_CAMERA_VENDOR_TIS; series = ARV_CAMERA_SERIES_TIS; } else if (g_strcmp0 (vendor_name, "DALSA") == 0) { vendor = ARV_CAMERA_VENDOR_DALSA; series = ARV_CAMERA_SERIES_DALSA; } else { vendor = ARV_CAMERA_VENDOR_UNKNOWN; series = ARV_CAMERA_SERIES_UNKNOWN; } camera->priv->vendor = vendor; camera->priv->series = series; return object; }
ArvCamera * arv_camera_new (const char *name) { ArvCamera *camera; ArvDevice *device; device = arv_open_device (name); if (!ARV_IS_DEVICE (device)) return NULL; camera = g_object_new (ARV_TYPE_CAMERA, "device", device, NULL); return camera; }
ArvCamera * arv_camera_new (const char *name) { ArvCamera *camera; ArvDevice *device; device = arv_open_device (name); if (!ARV_IS_DEVICE (device)) return NULL; camera = g_object_new (ARV_TYPE_CAMERA, "device", device, NULL); camera->priv->use_gain_raw = !ARV_IS_GC_FLOAT (arv_device_get_feature (device, "Gain")); camera->priv->use_exposure_time_abs = !ARV_IS_GC_FLOAT (arv_device_get_feature (device, "ExposureTime")); camera->priv->use_acquisition_frame_rate_abs = !ARV_IS_GC_FLOAT (arv_device_get_feature (device, "AcquisitionFrameRate")); return camera; }