#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/videodev.h>
#include "frame.h"
Go to the source code of this file.
Data Structures | |
struct | FRAMEGRABBER |
An opaque framegrabber handle. More... | |
Defines | |
#define | FG_DEFAULT_DEVICE "/dev/video" /** Default video input */ |
#define | FG_DEFAULT_WIDTH 640 |
#define | FG_DEFAULT_HEIGHT 480 |
#define | FG_PERCENT(n) ((n)*65535/100) |
#define | FG_50PC FG_PERCENT(50) |
#define | FG_SOURCE_TV 0 |
#define | FG_SOURCE_COMPOSITE 1 |
#define | FG_SOURCE_SVIDEO 2 |
Functions | |
FRAMEGRABBER * | fg_open (const char *dev) |
void | fg_close (FRAMEGRABBER *fg) |
FRAME * | fg_grab (FRAMEGRABBER *fg) |
FRAME * | fg_grab_frame (FRAMEGRABBER *fg, FRAME *fr) |
int | fg_set_source (FRAMEGRABBER *fg, int src) |
int | fg_set_source_norm (FRAMEGRABBER *fg, int norm) |
int | fg_get_source_count (FRAMEGRABBER *fg) |
char * | fg_get_source_name (FRAMEGRABBER *fg, int src) |
int | fg_set_channel (FRAMEGRABBER *fg, float freq) |
float | fg_get_channel (FRAMEGRABBER *fg) |
int | fg_set_format (FRAMEGRABBER *fg, int fmt) |
int | fg_set_capture_window (FRAMEGRABBER *fg, int x, int y, int width, int height) |
int | fg_set_brightness (FRAMEGRABBER *fg, int br) |
int | fg_set_hue (FRAMEGRABBER *fg, int hu) |
int | fg_set_colour (FRAMEGRABBER *fg, int co) |
int | fg_set_color (FRAMEGRABBER *fg, int co) |
int | fg_set_contrast (FRAMEGRABBER *fg, int ct) |
int | fg_set_whiteness (FRAMEGRABBER *fg, int wh) |
FRAME * | fg_new_compatible_frame (FRAMEGRABBER *fg) |
void | fg_dump_info (FRAMEGRABBER *fg) |
libfg - Frame Grabber interface for Linux
Provides a high-level C interface for controlling frame grabber and TV tuner cards. Uses the Video 4 Linux API (currently v1) and thus supports any V4L supported device.
|
Closes an open framegrabber device, and releases all memory allocated with it.
|
|
Dumps to the console on stdout all the status information available for the framegrabber.
|
|
Queries the current frequency of the TV tuner.
|
|
Returns the number of input sources available.
|
|
Returns a user-friendly name corresponding to the supplied channel number.
|
|
Reads a frame from the capture device, allocating a new FRAME instance and returning it. The frame will be allocated the maximum size window /// in the default picture format. Note that this is a blocking read, /// and thus will wait until the next frame is ready. The caller is /// responsible for doing a frame_release() when done with the frame (to /// free memory).
|
|
Reads a frame from the capture device, using the existing frame storage as passed in. Returns the same instance, with the contents of /// the last frame. Note that this is a *blocking* read, and thus will /// wait until the next frame is ready.
|
|
Returns a newly allocated frame that is compatible with the current frame grabber settings; that is, the window width and height, and the capture format. This frame must be deleted by the caller with frame_release().
|
|
Opens and initialises the frame grabber device with some reasonable default values, and queries for all capabilities.
|
|
Sets the picture brightness to the specified value.
|
|
Specifies a sub-window of the input source to capture. The parameters specify the capture window that is smaller than or equal to the maximum supported window size.
|
|
Sets the TV tuner to the specified frequency.
|
|
Sets the picture color balance for Americans to the specified value.
|
|
Sets the picture colour balance for Queen's English speakers to the specified value.
|
|
Sets the picture contrast to the specified value.
|
|
Specifies the capture format to use. Must be one of the VIDEO_PALETTE_* flags.
|
|
Sets the picture hue control to the specified value.
|
|
Specifies the number of the video source to be used for the input signal. For example, tuner, composite or S/Video signal.
|
|
Specifies the video signal norm (eg. PAL, NTSC, SECAM) for the current input source.
|
|
Sets the picture white balance to the specified value.
|