libdc1394: dc1394/camera.h File Reference

libdc1394 2.2.7

Data Structures | Typedefs | Enumerations | Functions
camera.h File Reference

Basic system and camera functions. More...

`#include <dc1394/log.h>`
`#include <stdio.h>`

## Data Structures
struct | __dc1394_camera
struct | dc1394camera_id_t
struct | __dc1394camera_list_t

## Typedefs
typedef struct __dc1394_camera | dc1394camera_t
typedef struct __dc1394camera_list_t | dc1394camera_list_t

## Enumerations
enum | dc1394iidc_version_t
enum | dc1394power_class_t
enum | dc1394phy_delay_t

## Functions
dc1394_t * | dc1394_new (void)
void | dc1394_free (dc1394_t *dc1394)
dc1394error_t | dc1394_camera_set_broadcast (dc1394camera_t *camera, dc1394bool_t pwr)
dc1394error_t | dc1394_reset_bus (dc1394camera_t *camera)
dc1394error_t | dc1394_camera_get_node (dc1394camera_t *camera, uint32_t *node, uint32_t *generation)
dc1394error_t | dc1394_camera_enumerate (dc1394_t *dc1394, dc1394camera_list_t **list)
void | dc1394_camera_free_list (dc1394camera_list_t *list)
dc1394camera_t * | dc1394_camera_new (dc1394_t *dc1394, uint64_t guid)
dc1394camera_t * | dc1394_camera_new_unit (dc1394_t *dc1394, uint64_t guid, int unit)
void | dc1394_camera_free (dc1394camera_t *camera)
dc1394error_t | dc1394_camera_print_info (dc1394camera_t *camera, FILE *fd)
dc1394error_t | dc1394_camera_get_platform_string (dc1394camera_t *camera, const char **platform)

## Detailed Description

Basic system and camera functions.

Author
  Damien Douxchamps: coding
  Peter Antoniac: documentation maintainer

More details soon

## Typedef Documentation

## ◆ dc1394camera_list_t

typedef struct __dc1394camera_list_t dc1394camera_list_t

A list of cameras

Usually returned by dc1394_camera_eumerate().

## ◆ dc1394camera_t

typedef struct __dc1394_camera dc1394camera_t

Camera structure

This structure represents the camera in libdc1394. It contains a number of useful static information, such as model/vendor names, a few capabilities, some ROM offsets, a unique identifier, etc...

## Enumeration Type Documentation

## ◆ dc1394iidc_version_t

enum dc1394iidc_version_t

List of IIDC versions

Currently, the following versions exist: 1.04, 1.20, PTGREY, 1.30 and 1.31 (1.32 coming soon) Observing other versions means that there's a bug crawling somewhere.

## ◆ dc1394phy_delay_t

enum dc1394phy_delay_t

Enumeration of PHY delays

This is currently not used in libdc1394.

## ◆ dc1394power_class_t

enum dc1394power_class_t

Enumeration of power classes

This is currently not used in libdc1394.

## Function Documentation

## ◆ dc1394_camera_enumerate()

dc1394error_t dc1394_camera_enumerate | ( | dc1394_t * | dc1394,
|  | dc1394camera_list_t ** | list )

Returns the list of cameras available on the computer. If present, multiple cards will be probed

## ◆ dc1394_camera_free()

void dc1394_camera_free | ( | dc1394camera_t * | camera | ) |

Frees a camera structure

## ◆ dc1394_camera_free_list()

void dc1394_camera_free_list | ( | dc1394camera_list_t * | list | ) |

Frees the memory allocated in dc1394_enumerate_cameras for the camera list

## ◆ dc1394_camera_get_node()

dc1394error_t dc1394_camera_get_node | ( | dc1394camera_t * | camera,
|  | uint32_t * | node,
|  | uint32_t * | generation )

Gets the IEEE 1394 node ID of the camera.

## ◆ dc1394_camera_get_platform_string()

dc1394error_t dc1394_camera_get_platform_string | ( | dc1394camera_t * | camera,
|  | const char ** | platform )

Returns a pointer to a string identifying the platform for the cameras. Platforms strings are: juju, linux, macosx, windows, usb

## ◆ dc1394_camera_new()

dc1394camera_t * dc1394_camera_new | ( | dc1394_t * | dc1394,
|  | uint64_t | guid )

Create a new camera based on a GUID (Global Unique IDentifier)

## ◆ dc1394_camera_new_unit()

dc1394camera_t * dc1394_camera_new_unit | ( | dc1394_t * | dc1394,
|  | uint64_t | guid,
|  | int | unit )

Create a new camera based on a GUID and a unit number (for multi-unit cameras)

## ◆ dc1394_camera_print_info()

dc1394error_t dc1394_camera_print_info | ( | dc1394camera_t * | camera,
|  | FILE * | fd )

Print various camera information, such as GUID, vendor, model, supported IIDC specs, etc...

## ◆ dc1394_camera_set_broadcast()

dc1394error_t dc1394_camera_set_broadcast | ( | dc1394camera_t * | camera,
|  | dc1394bool_t | pwr )

Sets and gets the broadcast flag of a camera. If the broadcast flag is set, all devices on the bus will execute the command. Useful to sync ISO start commands or setting a bunch of cameras at the same time. Broadcast only works with identical devices (brand/model). If the devices are not identical your mileage may vary. Some cameras may not answer broadcast commands at all. Also, this only works with cameras on the SAME bus (IOW, the same port).

## ◆ dc1394_free()

void dc1394_free | ( | dc1394_t * | dc1394 | ) |

Liberates a context. Last function to use in your program. After this, no libdc1394 function can be used.

## ◆ dc1394_new()

dc1394_t * dc1394_new | ( | void |  | ) |

Creates a new context in which cameras can be searched and used. This should be called before using any other libdc1394 function.

## ◆ dc1394_reset_bus()

dc1394error_t dc1394_reset_bus | ( | dc1394camera_t * | camera | ) |

Resets the IEEE1394 bus which camera is attached to. Calling this function is "rude" to other devices because it causes them to re-enumerate on the bus and may cause a temporary disruption in their current activities. Thus, use it sparingly. Its primary use is if a program shuts down uncleanly and needs to free leftover ISO channels or bandwidth. A bus reset will free those things as a side effect.