Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int camera_init ( Camera camera,
GPContext context 

Initialize a Camera object.

Sets up all the proper object function pointers, initialize camlib internal data structures, and probably establish a connection to the camera.

This is a camlib API function.

Definition at line 527 of file template.c.

References camera_about(), camera_capture(), camera_capture_preview(), camera_config_get(), camera_config_set(), camera_manual(), camera_summary(), fsfuncs, gp_filesystem_set_funcs(), and GP_OK.

        /* First, set up all the function pointers */
        camera->functions->exit                 = camera_exit;
        camera->functions->get_config           = camera_config_get;
        camera->functions->set_config           = camera_config_set;
        camera->functions->capture              = camera_capture;
        camera->functions->capture_preview      = camera_capture_preview;
        camera->functions->summary              = camera_summary;
        camera->functions->manual               = camera_manual;
        camera->functions->about                = camera_about;

      /* Now, tell the filesystem where to get lists, files and info */
      gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera);

       * The port is already provided with camera->port (and
       * already open). You just have to use functions like
       * gp_port_timeout_set, gp_port_settings_get, gp_port_settings_set.
       * Once you have configured the port, you should check if a 
       * connection to the camera can be established.

      return GP_OK;

Generated by  Doxygen 1.6.0   Back to index