fswebcam is a small and simple webcam app. It can capture images from

a number of different sources and perform simple manipulation on the
captured image.  The image can be saved as one or more PNG or JPEG
files.

Works with uvideo(4).

OK robert@
This commit is contained in:
mglocker 2008-06-13 16:39:44 +00:00
parent a9142df442
commit 202d4e059f
6 changed files with 791 additions and 0 deletions

View File

@ -0,0 +1,34 @@
# $OpenBSD: Makefile,v 1.1 2008/06/13 16:39:44 mglocker Exp $
COMMENT= fswebcam is a small and simple webcam app
DISTNAME= fswebcam-20070108
CATEGORIES= graphics
MASTER_SITES= http://www.firestorm.cx/fswebcam/files/
HOMEPAGE= http://www.firestorm.cx/fswebcam/
MAINTAINER= Marcus Glocker <marcus@nazgul.ch>
# BSD
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c
LIB_DEPENDS= gd::graphics/gd
CONFIGURE_STYLE= simple
CONFIGURE_ARGS+= --disable-v4l1
CONFIGURE_ENV= CFLAGS="-I/usr/local/include" \
LDFLAGS="-L/usr/local/lib -L/usr/X11R6/lib"
NO_REGRESS= Yes
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/fswebcam ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/fswebcam.1 ${PREFIX}/man/man1
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (fswebcam-20070108.tar.gz) = 92GVZnefRITTrNgGzcMPXw==
RMD160 (fswebcam-20070108.tar.gz) = VurAgePAhpVURlfg6UtQdUYsG0U=
SHA1 (fswebcam-20070108.tar.gz) = ad9pCpHdWQK1/j1rXGoUD+JC8AI=
SHA256 (fswebcam-20070108.tar.gz) = gt2XamSRk4OqvM92Ale871JiHkKLCvkip9SIa1RHeTc=
SIZE (fswebcam-20070108.tar.gz) = 93921

View File

@ -0,0 +1,552 @@
--- videodev2.h.orig Sat May 24 19:46:24 2008
+++ videodev2.h Sat May 24 19:51:33 2008
@@ -14,7 +14,7 @@
* et al.
*/
-#include <asm/types.h>
+#include <sys/types.h>
#include <sys/time.h>
/*
@@ -23,7 +23,7 @@
/* Four-character-code (FOURCC) */
#define v4l2_fourcc(a,b,c,d)\
- (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+ (((uint32_t)(a)<<0)|((uint32_t)(b)<<8)|((uint32_t)(c)<<16)|((uint32_t)(d)<<24))
/*
* E N U M S
@@ -123,15 +123,15 @@ enum v4l2_priority {
};
struct v4l2_rect {
- __s32 left;
- __s32 top;
- __s32 width;
- __s32 height;
+ int32_t left;
+ int32_t top;
+ int32_t width;
+ int32_t height;
};
struct v4l2_fract {
- __u32 numerator;
- __u32 denominator;
+ uint32_t numerator;
+ uint32_t denominator;
};
/*
@@ -139,12 +139,12 @@ struct v4l2_fract {
*/
struct v4l2_capability
{
- __u8 driver[16]; /* i.e. "bttv" */
- __u8 card[32]; /* i.e. "Hauppauge WinTV" */
- __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */
- __u32 version; /* should use KERNEL_VERSION() */
- __u32 capabilities; /* Device capabilities */
- __u32 reserved[4];
+ uint8_t driver[16]; /* i.e. "bttv" */
+ uint8_t card[32]; /* i.e. "Hauppauge WinTV" */
+ uint8_t bus_info[32]; /* "PCI:" + pci_name(pci_dev) */
+ uint32_t version; /* should use KERNEL_VERSION() */
+ uint32_t capabilities; /* Device capabilities */
+ uint32_t reserved[4];
};
/* Values for 'capabilities' field */
@@ -169,14 +169,14 @@ struct v4l2_capability
struct v4l2_pix_format
{
- __u32 width;
- __u32 height;
- __u32 pixelformat;
+ uint32_t width;
+ uint32_t height;
+ uint32_t pixelformat;
enum v4l2_field field;
- __u32 bytesperline; /* for padding, zero if unused */
- __u32 sizeimage;
+ uint32_t bytesperline; /* for padding, zero if unused */
+ uint32_t sizeimage;
enum v4l2_colorspace colorspace;
- __u32 priv; /* private data, depends on pixelformat */
+ uint32_t priv; /* private data, depends on pixelformat */
};
/* Pixel format FOURCC depth Description */
@@ -226,12 +226,12 @@ struct v4l2_pix_format
*/
struct v4l2_fmtdesc
{
- __u32 index; /* Format number */
+ uint32_t index; /* Format number */
enum v4l2_buf_type type; /* buffer type */
- __u32 flags;
- __u8 description[32]; /* Description string */
- __u32 pixelformat; /* Format fourcc */
- __u32 reserved[4];
+ uint32_t flags;
+ uint8_t description[32]; /* Description string */
+ uint32_t pixelformat; /* Format fourcc */
+ uint32_t reserved[4];
};
#define V4L2_FMT_FLAG_COMPRESSED 0x0001
@@ -242,13 +242,13 @@ struct v4l2_fmtdesc
*/
struct v4l2_timecode
{
- __u32 type;
- __u32 flags;
- __u8 frames;
- __u8 seconds;
- __u8 minutes;
- __u8 hours;
- __u8 userbits[4];
+ uint32_t type;
+ uint32_t flags;
+ uint8_t frames;
+ uint8_t seconds;
+ uint8_t minutes;
+ uint8_t hours;
+ uint8_t userbits[4];
};
/* Type */
@@ -285,9 +285,9 @@ enum v4l2_bitrate_mode {
struct v4l2_bitrate {
/* rates are specified in kbit/sec */
enum v4l2_bitrate_mode mode;
- __u32 min;
- __u32 target; /* use this one for CBR */
- __u32 max;
+ uint32_t min;
+ uint32_t target; /* use this one for CBR */
+ uint32_t max;
};
enum v4l2_mpeg_streamtype {
@@ -320,39 +320,39 @@ struct v4l2_mpeg_compression {
struct v4l2_bitrate st_bitrate;
/* transport streams */
- __u16 ts_pid_pmt;
- __u16 ts_pid_audio;
- __u16 ts_pid_video;
- __u16 ts_pid_pcr;
+ uint16_t ts_pid_pmt;
+ uint16_t ts_pid_audio;
+ uint16_t ts_pid_video;
+ uint16_t ts_pid_pcr;
/* program stream */
- __u16 ps_size;
- __u16 reserved_1; /* align */
+ uint16_t ps_size;
+ uint16_t reserved_1; /* align */
/* audio */
enum v4l2_mpeg_audiotype au_type;
struct v4l2_bitrate au_bitrate;
- __u32 au_sample_rate;
- __u8 au_pesid;
- __u8 reserved_2[3]; /* align */
+ uint32_t au_sample_rate;
+ uint8_t au_pesid;
+ uint8_t reserved_2[3]; /* align */
/* video */
enum v4l2_mpeg_videotype vi_type;
enum v4l2_mpeg_aspectratio vi_aspect_ratio;
struct v4l2_bitrate vi_bitrate;
- __u32 vi_frame_rate;
- __u16 vi_frames_per_gop;
- __u16 vi_bframes_count;
- __u8 vi_pesid;
- __u8 reserved_3[3]; /* align */
+ uint32_t vi_frame_rate;
+ uint16_t vi_frames_per_gop;
+ uint16_t vi_bframes_count;
+ uint8_t vi_pesid;
+ uint8_t reserved_3[3]; /* align */
/* misc flags */
- __u32 closed_gops:1;
- __u32 pulldown:1;
- __u32 reserved_4:30; /* align */
+ uint32_t closed_gops:1;
+ uint32_t pulldown:1;
+ uint32_t reserved_4:30; /* align */
/* I don't expect the above being perfect yet ;) */
- __u32 reserved_5[8];
+ uint32_t reserved_5[8];
};
#endif
@@ -368,7 +368,7 @@ struct v4l2_jpegcompression
int COM_len; /* Length of data in JPEG COM segment */
char COM_data[60]; /* Data in JPEG COM segment */
- __u32 jpeg_markers; /* Which markers should go into the JPEG
+ uint32_t jpeg_markers; /* Which markers should go into the JPEG
* output. Unless you exactly know what
* you do, leave them untouched.
* Inluding less markers will make the
@@ -392,32 +392,32 @@ struct v4l2_jpegcompression
*/
struct v4l2_requestbuffers
{
- __u32 count;
+ uint32_t count;
enum v4l2_buf_type type;
enum v4l2_memory memory;
- __u32 reserved[2];
+ uint32_t reserved[2];
};
struct v4l2_buffer
{
- __u32 index;
+ uint32_t index;
enum v4l2_buf_type type;
- __u32 bytesused;
- __u32 flags;
+ uint32_t bytesused;
+ uint32_t flags;
enum v4l2_field field;
struct timeval timestamp;
struct v4l2_timecode timecode;
- __u32 sequence;
+ uint32_t sequence;
/* memory location */
enum v4l2_memory memory;
union {
- __u32 offset;
+ uint32_t offset;
unsigned long userptr;
} m;
- __u32 length;
- __u32 input;
- __u32 reserved;
+ uint32_t length;
+ uint32_t input;
+ uint32_t reserved;
};
/* Flags for 'flags' field */
@@ -435,8 +435,8 @@ struct v4l2_buffer
*/
struct v4l2_framebuffer
{
- __u32 capability;
- __u32 flags;
+ uint32_t capability;
+ uint32_t flags;
/* FIXME: in theory we should pass something like PCI device + memory
* region + offset instead of some physical address */
void* base;
@@ -462,9 +462,9 @@ struct v4l2_window
{
struct v4l2_rect w;
enum v4l2_field field;
- __u32 chromakey;
+ uint32_t chromakey;
struct v4l2_clip *clips;
- __u32 clipcount;
+ uint32_t clipcount;
void *bitmap;
};
@@ -474,12 +474,12 @@ struct v4l2_window
*/
struct v4l2_captureparm
{
- __u32 capability; /* Supported modes */
- __u32 capturemode; /* Current mode */
+ uint32_t capability; /* Supported modes */
+ uint32_t capturemode; /* Current mode */
struct v4l2_fract timeperframe; /* Time per frame in .1us units */
- __u32 extendedmode; /* Driver-specific extensions */
- __u32 readbuffers; /* # of buffers for read */
- __u32 reserved[4];
+ uint32_t extendedmode; /* Driver-specific extensions */
+ uint32_t readbuffers; /* # of buffers for read */
+ uint32_t reserved[4];
};
/* Flags for 'capability' and 'capturemode' fields */
#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
@@ -487,12 +487,12 @@ struct v4l2_captureparm
struct v4l2_outputparm
{
- __u32 capability; /* Supported modes */
- __u32 outputmode; /* Current mode */
+ uint32_t capability; /* Supported modes */
+ uint32_t outputmode; /* Current mode */
struct v4l2_fract timeperframe; /* Time per frame in seconds */
- __u32 extendedmode; /* Driver-specific extensions */
- __u32 writebuffers; /* # of buffers for write */
- __u32 reserved[4];
+ uint32_t extendedmode; /* Driver-specific extensions */
+ uint32_t writebuffers; /* # of buffers for write */
+ uint32_t reserved[4];
};
/*
@@ -515,7 +515,7 @@ struct v4l2_crop {
* A N A L O G V I D E O S T A N D A R D
*/
-typedef __u64 v4l2_std_id;
+typedef uint64_t v4l2_std_id;
/* one bit for each */
#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
@@ -585,12 +585,12 @@ typedef __u64 v4l2_std_id;
struct v4l2_standard
{
- __u32 index;
+ uint32_t index;
v4l2_std_id id;
- __u8 name[24];
+ uint8_t name[24];
struct v4l2_fract frameperiod; /* Frames, not fields */
- __u32 framelines;
- __u32 reserved[4];
+ uint32_t framelines;
+ uint32_t reserved[4];
};
@@ -599,14 +599,14 @@ struct v4l2_standard
*/
struct v4l2_input
{
- __u32 index; /* Which input */
- __u8 name[32]; /* Label */
- __u32 type; /* Type of input */
- __u32 audioset; /* Associated audios (bitfield) */
- __u32 tuner; /* Associated tuner */
+ uint32_t index; /* Which input */
+ uint8_t name[32]; /* Label */
+ uint32_t type; /* Type of input */
+ uint32_t audioset; /* Associated audios (bitfield) */
+ uint32_t tuner; /* Associated tuner */
v4l2_std_id std;
- __u32 status;
- __u32 reserved[4];
+ uint32_t status;
+ uint32_t reserved[4];
};
/* Values for the 'type' field */
#define V4L2_INPUT_TYPE_TUNER 1
@@ -636,13 +636,13 @@ struct v4l2_input
*/
struct v4l2_output
{
- __u32 index; /* Which output */
- __u8 name[32]; /* Label */
- __u32 type; /* Type of output */
- __u32 audioset; /* Associated audios (bitfield) */
- __u32 modulator; /* Associated modulator */
+ uint32_t index; /* Which output */
+ uint8_t name[32]; /* Label */
+ uint32_t type; /* Type of output */
+ uint32_t audioset; /* Associated audios (bitfield) */
+ uint32_t modulator; /* Associated modulator */
v4l2_std_id std;
- __u32 reserved[4];
+ uint32_t reserved[4];
};
/* Values for the 'type' field */
#define V4L2_OUTPUT_TYPE_MODULATOR 1
@@ -654,31 +654,31 @@ struct v4l2_output
*/
struct v4l2_control
{
- __u32 id;
- __s32 value;
+ uint32_t id;
+ int32_t value;
};
/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
struct v4l2_queryctrl
{
- __u32 id;
+ uint32_t id;
enum v4l2_ctrl_type type;
- __u8 name[32]; /* Whatever */
- __s32 minimum; /* Note signedness */
- __s32 maximum;
- __s32 step;
- __s32 default_value;
- __u32 flags;
- __u32 reserved[2];
+ uint8_t name[32]; /* Whatever */
+ int32_t minimum; /* Note signedness */
+ int32_t maximum;
+ int32_t step;
+ int32_t default_value;
+ uint32_t flags;
+ uint32_t reserved[2];
};
/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
struct v4l2_querymenu
{
- __u32 id;
- __u32 index;
- __u8 name[32]; /* Whatever */
- __u32 reserved;
+ uint32_t id;
+ uint32_t index;
+ uint8_t name[32]; /* Whatever */
+ uint32_t reserved;
};
/* Control flags */
@@ -721,28 +721,28 @@ struct v4l2_querymenu
*/
struct v4l2_tuner
{
- __u32 index;
- __u8 name[32];
+ uint32_t index;
+ uint8_t name[32];
enum v4l2_tuner_type type;
- __u32 capability;
- __u32 rangelow;
- __u32 rangehigh;
- __u32 rxsubchans;
- __u32 audmode;
- __s32 signal;
- __s32 afc;
- __u32 reserved[4];
+ uint32_t capability;
+ uint32_t rangelow;
+ uint32_t rangehigh;
+ uint32_t rxsubchans;
+ uint32_t audmode;
+ int32_t signal;
+ int32_t afc;
+ uint32_t reserved[4];
};
struct v4l2_modulator
{
- __u32 index;
- __u8 name[32];
- __u32 capability;
- __u32 rangelow;
- __u32 rangehigh;
- __u32 txsubchans;
- __u32 reserved[4];
+ uint32_t index;
+ uint8_t name[32];
+ uint32_t capability;
+ uint32_t rangelow;
+ uint32_t rangehigh;
+ uint32_t txsubchans;
+ uint32_t reserved[4];
};
/* Flags for the 'capability' field */
@@ -769,10 +769,10 @@ struct v4l2_modulator
struct v4l2_frequency
{
- __u32 tuner;
+ uint32_t tuner;
enum v4l2_tuner_type type;
- __u32 frequency;
- __u32 reserved[8];
+ uint32_t frequency;
+ uint32_t reserved[8];
};
/*
@@ -780,11 +780,11 @@ struct v4l2_frequency
*/
struct v4l2_audio
{
- __u32 index;
- __u8 name[32];
- __u32 capability;
- __u32 mode;
- __u32 reserved[2];
+ uint32_t index;
+ uint8_t name[32];
+ uint32_t capability;
+ uint32_t mode;
+ uint32_t reserved[2];
};
/* Flags for the 'capability' field */
#define V4L2_AUDCAP_STEREO 0x00001
@@ -795,11 +795,11 @@ struct v4l2_audio
struct v4l2_audioout
{
- __u32 index;
- __u8 name[32];
- __u32 capability;
- __u32 mode;
- __u32 reserved[2];
+ uint32_t index;
+ uint8_t name[32];
+ uint32_t capability;
+ uint32_t mode;
+ uint32_t reserved[2];
};
/*
@@ -810,14 +810,14 @@ struct v4l2_audioout
struct v4l2_vbi_format
{
- __u32 sampling_rate; /* in 1 Hz */
- __u32 offset;
- __u32 samples_per_line;
- __u32 sample_format; /* V4L2_PIX_FMT_* */
- __s32 start[2];
- __u32 count[2];
- __u32 flags; /* V4L2_VBI_* */
- __u32 reserved[2]; /* must be zero */
+ uint32_t sampling_rate; /* in 1 Hz */
+ uint32_t offset;
+ uint32_t samples_per_line;
+ uint32_t sample_format; /* V4L2_PIX_FMT_* */
+ int32_t start[2];
+ uint32_t count[2];
+ uint32_t flags; /* V4L2_VBI_* */
+ uint32_t reserved[2]; /* must be zero */
};
/* VBI flags */
@@ -839,7 +839,7 @@ struct v4l2_format
struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
- __u8 raw_data[200]; // user-defined
+ uint8_t raw_data[200]; // user-defined
} fmt;
};
@@ -853,7 +853,7 @@ struct v4l2_streamparm
{
struct v4l2_captureparm capture;
struct v4l2_outputparm output;
- __u8 raw_data[200]; /* user-defined */
+ uint8_t raw_data[200]; /* user-defined */
} parm;
};

View File

@ -0,0 +1,193 @@
--- videodev.h.orig Sat May 24 19:21:21 2008
+++ videodev.h Sat May 24 19:15:57 2008
@@ -1,8 +1,7 @@
#ifndef __LINUX_VIDEODEV_H
#define __LINUX_VIDEODEV_H
-#include <linux/types.h>
-#include <linux/version.h>
+#include <sys/types.h>
#define VID_TYPE_CAPTURE 1 /* Can capture */
#define VID_TYPE_TUNER 2 /* Can tune */
@@ -37,13 +36,13 @@ struct video_channel
int channel;
char name[32];
int tuners;
- __u32 flags;
+ uint32_t flags;
#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
#define VIDEO_VC_AUDIO 2 /* Channel has audio */
- __u16 type;
+ uint16_t type;
#define VIDEO_TYPE_TV 1
#define VIDEO_TYPE_CAMERA 2
- __u16 norm; /* Norm set by channel */
+ uint16_t norm; /* Norm set by channel */
};
struct video_tuner
@@ -51,7 +50,7 @@ struct video_tuner
int tuner;
char name[32];
ulong rangelow, rangehigh; /* Tuner range */
- __u32 flags;
+ uint32_t flags;
#define VIDEO_TUNER_PAL 1
#define VIDEO_TUNER_NTSC 2
#define VIDEO_TUNER_SECAM 4
@@ -60,23 +59,23 @@ struct video_tuner
#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
- __u16 mode; /* PAL/NTSC/SECAM/OTHER */
+ uint16_t mode; /* PAL/NTSC/SECAM/OTHER */
#define VIDEO_MODE_PAL 0
#define VIDEO_MODE_NTSC 1
#define VIDEO_MODE_SECAM 2
#define VIDEO_MODE_AUTO 3
- __u16 signal; /* Signal strength 16bit scale */
+ uint16_t signal; /* Signal strength 16bit scale */
};
struct video_picture
{
- __u16 brightness;
- __u16 hue;
- __u16 colour;
- __u16 contrast;
- __u16 whiteness; /* Black and white only */
- __u16 depth; /* Capture depth */
- __u16 palette; /* Palette in use */
+ uint16_t brightness;
+ uint16_t hue;
+ uint16_t colour;
+ uint16_t contrast;
+ uint16_t whiteness; /* Black and white only */
+ uint16_t depth; /* Capture depth */
+ uint16_t palette; /* Palette in use */
#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
@@ -100,9 +99,9 @@ struct video_picture
struct video_audio
{
int audio; /* Audio channel */
- __u16 volume; /* If settable */
- __u16 bass, treble;
- __u32 flags;
+ uint16_t volume; /* If settable */
+ uint16_t bass, treble;
+ uint32_t flags;
#define VIDEO_AUDIO_MUTE 1
#define VIDEO_AUDIO_MUTABLE 2
#define VIDEO_AUDIO_VOLUME 4
@@ -113,24 +112,24 @@ struct video_audio
#define VIDEO_SOUND_STEREO 2
#define VIDEO_SOUND_LANG1 4
#define VIDEO_SOUND_LANG2 8
- __u16 mode;
- __u16 balance; /* Stereo balance */
- __u16 step; /* Step actual volume uses */
+ uint16_t mode;
+ uint16_t balance; /* Stereo balance */
+ uint16_t step; /* Step actual volume uses */
};
struct video_clip
{
- __s32 x,y;
- __s32 width, height;
+ int32_t x,y;
+ int32_t width, height;
struct video_clip *next; /* For user use/driver use only */
};
struct video_window
{
- __u32 x,y; /* Position of window */
- __u32 width,height; /* Its size */
- __u32 chromakey;
- __u32 flags;
+ uint32_t x,y; /* Position of window */
+ uint32_t width,height; /* Its size */
+ uint32_t chromakey;
+ uint32_t flags;
struct video_clip *clips; /* Set only */
int clipcount;
#define VIDEO_WINDOW_INTERLACE 1
@@ -142,10 +141,10 @@ struct video_window
struct video_capture
{
- __u32 x,y; /* Offsets into image */
- __u32 width, height; /* Area to capture */
- __u16 decimation; /* Decimation divder */
- __u16 flags; /* Flags for capture */
+ uint32_t x,y; /* Offsets into image */
+ uint32_t width, height; /* Area to capture */
+ uint16_t decimation; /* Decimation divder */
+ uint16_t flags; /* Flags for capture */
#define VIDEO_CAPTURE_ODD 0 /* Temporal */
#define VIDEO_CAPTURE_EVEN 1
};
@@ -167,8 +166,8 @@ struct video_mmap
struct video_key
{
- __u8 key[8];
- __u32 flags;
+ uint8_t key[8];
+ uint32_t flags;
};
@@ -195,12 +194,12 @@ struct video_unit
};
struct vbi_format {
- __u32 sampling_rate; /* in Hz */
- __u32 samples_per_line;
- __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
- __s32 start[2]; /* starting line for each frame */
- __u32 count[2]; /* count of lines for each frame */
- __u32 flags;
+ uint32_t sampling_rate; /* in Hz */
+ uint32_t samples_per_line;
+ uint32_t sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
+ int32_t start[2]; /* starting line for each frame */
+ uint32_t count[2]; /* count of lines for each frame */
+ uint32_t flags;
#define VBI_UNSYNC 1 /* can distingues between top/bottom field */
#define VBI_INTERLACED 2 /* lines are interlaced */
};
@@ -209,13 +208,13 @@ struct vbi_format {
/* but it could apply generically to any hardware compressor/decompressor */
struct video_info
{
- __u32 frame_count; /* frames output since decode/encode began */
- __u32 h_size; /* current unscaled horizontal size */
- __u32 v_size; /* current unscaled veritcal size */
- __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */
- __u32 picture_type; /* current picture type */
- __u32 temporal_reference; /* current temporal reference */
- __u8 user_data[256]; /* user data last found in compressed stream */
+ uint32_t frame_count; /* frames output since decode/encode began */
+ uint32_t h_size; /* current unscaled horizontal size */
+ uint32_t v_size; /* current unscaled veritcal size */
+ uint32_t smpte_timecode; /* current SMPTE timecode (for current GOP) */
+ uint32_t picture_type; /* current picture type */
+ uint32_t temporal_reference; /* current temporal reference */
+ uint8_t user_data[256]; /* user data last found in compressed stream */
/* user_data[0] contains user data flags, user_data[1] has count */
};
@@ -232,7 +231,7 @@ struct video_code
{
char loadwhat[16]; /* name or tag of file being passed */
int datasize;
- __u8 *data;
+ uint8_t *data;
};
#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */

View File

@ -0,0 +1,4 @@
fswebcam is a small and simple webcam app. It can capture images from
a number of different sources and perform simple manipulation on the
captured image. The image can be saved as one or more PNG or JPEG
files.

View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1 2008/06/13 16:39:44 mglocker Exp $
bin/fswebcam
@man man/man1/fswebcam.1