libsc
2.8.7
The SC library provides support for parallel scientific applications.
|
Support for video for linux version 2. More...
#include <sc.h>
Go to the source code of this file.
Typedefs | |
typedef struct sc_v4l2_device | sc_v4l2_device_t |
Opaque structure for a video device. | |
Functions | |
sc_v4l2_device_t * | sc_v4l2_device_open (const char *devname) |
Open a video device by special file name. More... | |
int | sc_v4l2_device_close (sc_v4l2_device_t *vd) |
Close a video device. More... | |
const char * | sc_v4l2_device_devstring (const sc_v4l2_device_t *vd) |
Return string that details some driver and device properties. More... | |
const char * | sc_v4l2_device_capstring (const sc_v4l2_device_t *vd) |
Return string that details some device capabilities. More... | |
const char * | sc_v4l2_device_outstring (const sc_v4l2_device_t *vd) |
Return string that details some output properties. More... | |
int | sc_v4l2_device_is_readwrite (const sc_v4l2_device_t *vd) |
Query whether a device supports read/write I/O. More... | |
int | sc_v4l2_device_is_streaming (const sc_v4l2_device_t *vd) |
Query whether a device supports streaming I/O. More... | |
int | sc_v4l2_device_select (sc_v4l2_device_t *vd, unsigned usec) |
Call select (2) to wait for write availability of device. More... | |
int | sc_v4l2_device_write (sc_v4l2_device_t *vd, const char *wbuf) |
Call write (2) to copy an image buffer to device. More... | |
int | sc_v4l2_device_format (sc_v4l2_device_t *vd, unsigned int *width, unsigned int *height, unsigned int *bytesperline, unsigned int *sizeimage) |
Set output configuration of device. More... | |
Support for video for linux version 2.
const char* sc_v4l2_device_capstring | ( | const sc_v4l2_device_t * | vd | ) |
Return string that details some device capabilities.
[in] | vd | Opened sc_v4l2_device_t. Not modified. |
int sc_v4l2_device_close | ( | sc_v4l2_device_t * | vd | ) |
Close a video device.
[in,out] | vd | Close this device and deallocate associated resources. |
const char* sc_v4l2_device_devstring | ( | const sc_v4l2_device_t * | vd | ) |
Return string that details some driver and device properties.
[in] | vd | Opened sc_v4l2_device_t. Not modified. |
int sc_v4l2_device_format | ( | sc_v4l2_device_t * | vd, |
unsigned int * | width, | ||
unsigned int * | height, | ||
unsigned int * | bytesperline, | ||
unsigned int * | sizeimage | ||
) |
Set output configuration of device.
We demand sRGB color space with RGB 565 pixel format (2 bytes). The image size values on output define the buffer size to allocate.
[in,out] | vd | Device must support the desired output format. |
[in,out] | width | Desired width on input, actual width on output. |
[in,out] | height | Desired height on input, actual height on output. |
[out] | bytesperline | Bytes per line on output, including padding. |
[out] | sizeimage | Bytes per image, including padding. |
int sc_v4l2_device_is_readwrite | ( | const sc_v4l2_device_t * | vd | ) |
Query whether a device supports read/write I/O.
[in] | vd | Any pointer. |
int sc_v4l2_device_is_streaming | ( | const sc_v4l2_device_t * | vd | ) |
Query whether a device supports streaming I/O.
[in] | vd | Any pointer. |
sc_v4l2_device_t* sc_v4l2_device_open | ( | const char * | devname | ) |
Open a video device by special file name.
The device is queried but its state is not modified.
[in] | devname | Special file name such as /dev/video8 . |
const char* sc_v4l2_device_outstring | ( | const sc_v4l2_device_t * | vd | ) |
Return string that details some output properties.
[in] | vd | Opened sc_v4l2_device_t. Not modified. |
int sc_v4l2_device_select | ( | sc_v4l2_device_t * | vd, |
unsigned | usec | ||
) |
Call select (2) to wait for write availability of device.
[in] | vd | Opened sc_v4l2_device_t capable of output. |
[in] | usec | Number of microseconds to wait for device. We return sooner if interrupted by a signal. |
int sc_v4l2_device_write | ( | sc_v4l2_device_t * | vd, |
const char * | wbuf | ||
) |
Call write (2) to copy an image buffer to device.
[in] | vd | Opened sc_v4l2_device_t capable of output. |
[in] | wbuf | Buffer holding at least sizeimage many bytes. |