EDT Digital Video Library


Detailed Description

The PCI DV digital video library provides a C language interface to the PCI DV device driver, including routines for image capture, save, and device control.

The PCI DV uses the lower-level EDT DMA Library. Library functions from both libraries operate on the same device handle, and both types of routines can be used in the same application. However PCI DV library subroutines are designed to handle the extra bookeeping, error-recovery, triggering and timing functionality that is present on EDT Digital Video boards. We therefore recommend using only Digital Video library and EDT Message Handler Library subroutines, and call DMA Library routines only when there is functionality needed that is not provided by the Digital Video library.

All routines access a specific device whose handle is created and returned by the pdv_open or pdv_open_channel routine. PCI DV applications typically include the following elements:

  1. The preprocessor statement:
      #include "edtinc.h"
    
  2. A call to pdv_open or pdv_open_channel, such as:
     PdvDev *pdv_p = pdv_open(EDT_INTERFACE, 0);
    
    (EDT_INTERFACE is defined as "pdv" in edtdef.h.)
  3. Device control or status calls, such as pdv_get_height, as in:
     int height = pdv_get_height(pdv_p);
    
  4. Ring buffer initialization code, such as:
     pdv_multibuf(pdv_p, 4) ;
    
  5. Data acquisition calls, such as pdv_image (which acquires an image and returns a pointer to it), as in:
     unsigned char *image = pdv_image(pdv_p) ;
    
  6. A call to pdv_close to close the device before ending the program, as in:
     pdv_close(pdv_p) ;
    
  7. Appropriate settings in your makefile or C workspace to compile and link the library files.
  8. On UNIX systems, the -lpdv and -ledt option to the compiler, to link the library file libpdv.so with your program.
  9. On UNIX systems, the -L and -R options to specify where to find the dynamic libraries at link- and runtime respectively. (See the makefile provided for examples.)
  10. On UNIX systems, the -mt option to the compiler (because the library uses multithreading), and the -lm option to the compiler (because it uses the math library).

See the Makefile (Unix) or generic.mk (Windows), and example programs provided in the install directory for examples of compiling code using the digital video library routines. On Windows you can also create a Visual Studio project to compile and link EDT libraries. Suggested starting points for acquisition are simplest_take.c and simple_take.c. For serial communication, see the serial_cmd.c, a command line serial utility. Other simple_*.c example programs are provided to show specialized functionality.

The PdvDev device status structure is defined in the file libpdv.h. It includes the PdvDependent substructure, and other structure elements that describe the state of the board and camera, as initialized by the current camera configuration file (see the Camera Configuration Guide, at ftp.edt.com/pub/manuals/PDV/camconfig.pdf ) or modified by any subsequent API setup calls. These structure elements include values for things such as the current pixel re-order or color interpolation method, size and depth of the image, number and size of currently allocated buffers. For portability, we strongly recommend using library calls to get/set these values rather than accessing the structure elements directly. In addition, anything that can be queried via the subroutine calls such as currently set image width, height and depth should be done via subroutine calls rather than hard-coding specific values into your program.

The PCI DV library source files are included in the installation. Most but not all routines are documented here. Undocumented routines include internals, custom, special purpose and obsoletes. Feel free, however, to look through the library source code and use (with caution) any routines that are appropriate. Email tech@edt.com if you have questions about specific routines.

Note:
When acquiring images in multithreaded applications, all routines that deal with starting, waiting for, or aborting images or buffers should be in the same thread.
Routines are divided into the following modules. You can use the Search button at the top of this page (in the HTML version of this doc) to search for specific library routines.


Modules

 Startup / Shutdown
 To open and close the EDT Digital Video device.
 Settings
 Get and set EDT interface board (register) values as well as device driver and camera settings.
 Initialization
 Read configuration files and initialize the board and camera.
 Acquisition
 Image acquisition subroutines.
 Communications/Control
 Serial communications and camera control subroutines.
 Utility
 Various utility subroutines.
 Debug
 Get and set flags that determine debug output from the library.


Generated on Mon May 12 16:39:09 2008 by  doxygen 1.5.1