libdc1394: API version 2: System

NOTE: the camera detection API will change to allow hotplug support.


dc1394_new_camera()

Arguments:
uint_t : port : The port on which the camera is attached
nodeid_t : node : The camera node
Returns:   dc1394camera_t*

Note: removed from the API.


dc1394_free_camera()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
Returns:   (nothing)

This function obviously frees a camera structure. It also deals with system ressources like handles which are killed too. As a result, if you copied a camera structure for another use be warned that freeing any instance of it will kill the raw1394 handle and make all other instances inoperative.


dc1394_find_cameras()

Arguments:
dc1394camera_t : ***cameras_ptr : A pointer to a pointer to a pointer to a camera structure. This seems a bit strange but it's not too difficult to understrand. First we have camera structures allocated dynamically withtin the function. These are dc1394camera_t*. Now we put these in a vector, the latter being accessed by a dc1394camera_t**. At last, we need another pointer level to be able to pass the data address through the function arguments.
uint_t* : numCameras : A pointer to an uint_t that will contain the number of cameras found.
Returns:   dc1394error_t (error code)

This function gets information about all caneras on all 1394 busses attached to the computer. It is currently the only way to get camera structs that are ready for use.


dc1394_get_camera_info()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
Returns:   dc1394error_t (error code)

dc1394_print_camera_info()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
Returns:   dc1394error_t (error code)

A simple function for printing basic camera information on the screen.


dc1394_camera_set_broadcast()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
dc1394bool_t : pwr : A boolean selecting whether or not the camera should behave as a broadcast device.
Returns:   dc1394error_t (error code)

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_reset_camera()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
Returns:   dc1394error_t (error code)

Resets the camera using the IIDC reset function. This is not a power cycle.


dc1394_set_camera_power()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
dc1394switch_t : pwr : the desired state of the camera: DC1394_ON or DC1394_OFF
Returns:   dc1394error_t (error code)

Sets the camera power. This is very close to (un)plugging the camera power but note that there is a difference as some circuits in the camera must be continuously powered in order to respond to a power-up command.


dc1394_memory_is_save_in_operation()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
dc1394bool_t : *value : a boolean reflecting whether the camera save operation is still ongoining or not.
Returns:   dc1394error_t (error code)

You need to allow the camera some time to finish the saving operation. This function can be used in a loop to check when the operation finished. This could be integrated in the save function in the future.


dc1394_memory_save()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
uint_t : channel : the channel in which you wish to save the camera settings
Returns:   dc1394error_t (error code)

This effectively saves the camera settings in the camera memory bank specified by the channel argument. The number of available channels is specified in the dc1394camera_t struct. You should wait until the save operation if finished before changing camera registers. You cannot write in channel zero as it is read-only and contains factory defaults.


dc1394_memory_load()

Arguments:
dc1394camera_t : *camera : A pointer to an initialized camera structure
uint_t : channel : the channel in which you wish to load the camera settings
Returns:   dc1394error_t (error code)

Loads the settings stored in the specified channel. Channel zero is the factory defaults.