beautypg.com

Demo applications, Functions reference – Sensoray 616 Linux User Manual

Page 7

background image

7

'cp test1.mpg /dev/video1' (use ctrl-c to interrupt)
'cat test1.mpg > /dev/video1'
etc...

If you have two cards, this should work too:

'cat /dev/video0 > /dev/video1'

2.1.4. Using the Driver from Applications



After the driver is loaded, application programs can manipulate the 516/616 hardware by means of standard
module API methods: open(), close(), read(), write(), poll() and ioctl().

Before calling any other methods, open() must be called for each board to enable access to it. Similarly,
close() must be called when you are done interacting with the board. Two or more applications may open
one board simultaneously; for example, one application opens a board to read MPEGs and other
application opens the same board to show result on the screen. The read() and write() functions can be
used to pass mpeg data between the application and board. The poll() may be used to transfer mpeg data
in either blocking or non-blocking mode. Hardware-specific functionality such as video bit rate, multiplexing
format, etc. is accessed through the x16-specific IOCTL methods described in 'sx16.h' and 'sx16mod.c'.
Video for Linux supported with v4l-specific IOCTL commands. Usually programmer does not call v4l
commands directly, the hi-level functions such as XvPutVideo initiate transparent communication between
the video system and a device driver via v4l.
Be sure that the device you want to use is a 516/616 board; other v4l device may support v4l commands,
but may not support x16-specific commands.

3. Demo Applications

A demo application, sx16demo, is provided to show how to use the driver in a typical application. This is a
command line program without v4l features.
Type "make sx16demo" to compile this demo.

To demonstrate the video overlay you may try any common purpose v4l demo application or video player.
The “xawtv” player has a simple xvideo.c demo, located in xawtv/debug directory. Please refer to this file
and documentation provided with xawtv player to create your own applications.

4. Functions Reference

The x16 Driver is designed to provide the application developer with full control over the frame grabber. All
special data types used by the Driver are defined in sx16core.h and sx16ioctl.h files.


4.1. Standard Functions

The standard open(), close(), read(), write(), and ioctl() methods are available.
Description of the 'ioctl' parameters can be found in sx16ioctl.h and sx16core.h.

This manual is related to the following products: