Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
vivi.c File Reference
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/font.h>
#include <linux/mutex.h>
#include <linux/videodev2.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <media/videobuf2-vmalloc.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include <media/v4l2-common.h>

Go to the source code of this file.

Data Structures

struct  vivi_fmt
 
struct  vivi_buffer
 
struct  vivi_dmaqueue
 
struct  vivi_dev
 
struct  bar_std
 

Macros

#define VIVI_MODULE_NAME   "vivi"
 
#define WAKE_NUMERATOR   30
 
#define WAKE_DENOMINATOR   1001
 
#define BUFFER_TIMEOUT   msecs_to_jiffies(500) /* 0.5 seconds */
 
#define MAX_WIDTH   1920
 
#define MAX_HEIGHT   1200
 
#define VIVI_VERSION   "0.8.1"
 
#define dprintk(dev, level, fmt, arg...)   v4l2_dbg(level, debug, &dev->v4l2_dev, fmt, ## arg)
 
#define COLOR_WHITE   {204, 204, 204}
 
#define COLOR_AMBER   {208, 208, 0}
 
#define COLOR_CYAN   { 0, 206, 206}
 
#define COLOR_GREEN   { 0, 239, 0}
 
#define COLOR_MAGENTA   {239, 0, 239}
 
#define COLOR_RED   {205, 0, 0}
 
#define COLOR_BLUE   { 0, 0, 255}
 
#define COLOR_BLACK   { 0, 0, 0}
 
#define NUM_INPUTS   ARRAY_SIZE(bars)
 
#define TO_Y(r, g, b)   (((16829 * r + 33039 * g + 6416 * b + 32768) >> 16) + 16)
 
#define TO_V(r, g, b)   (((28784 * r - 24103 * g - 4681 * b + 32768) >> 16) + 128)
 
#define TO_U(r, g, b)   (((-9714 * r - 19070 * g + 28784 * b + 32768) >> 16) + 128)
 
#define TSTAMP_MIN_Y   24
 
#define TSTAMP_MAX_Y   (TSTAMP_MIN_Y + 15)
 
#define TSTAMP_INPUT_X   10
 
#define TSTAMP_MIN_X   (54 + TSTAMP_INPUT_X)
 
#define frames_to_ms(frames)   ((frames * WAKE_NUMERATOR * 1000) / WAKE_DENOMINATOR)
 
#define VIVI_CID_CUSTOM_BASE   (V4L2_CID_USER_BASE | 0xf000)
 

Enumerations

enum  colors {
  WHITE, AMBER, CYAN, GREEN,
  MAGENTA, RED, BLUE, BLACK,
  TEXT_BLACK
}
 

Functions

 MODULE_DESCRIPTION ("Video Technology Magazine Virtual Video Capture Board")
 
 MODULE_AUTHOR ("Mauro Carvalho Chehab, Ted Walther and John Sokol")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_VERSION (VIVI_VERSION)
 
 module_param (video_nr, uint, 0644)
 
 MODULE_PARM_DESC (video_nr,"videoX start number, -1 is autodetect")
 
 module_param (n_devs, uint, 0644)
 
 MODULE_PARM_DESC (n_devs,"number of video devices to create")
 
 module_param (debug, uint, 0644)
 
 MODULE_PARM_DESC (debug,"activates debug info")
 
 module_param (vid_limit, uint, 0644)
 
 MODULE_PARM_DESC (vid_limit,"capture memory limit in megabytes")
 
 module_init (vivi_init)
 
 module_exit (vivi_exit)
 

Macro Definition Documentation

#define BUFFER_TIMEOUT   msecs_to_jiffies(500) /* 0.5 seconds */

Definition at line 42 of file vivi.c.

#define COLOR_AMBER   {208, 208, 0}

Definition at line 266 of file vivi.c.

#define COLOR_BLACK   { 0, 0, 0}

Definition at line 272 of file vivi.c.

#define COLOR_BLUE   { 0, 0, 255}

Definition at line 271 of file vivi.c.

#define COLOR_CYAN   { 0, 206, 206}

Definition at line 267 of file vivi.c.

#define COLOR_GREEN   { 0, 239, 0}

Definition at line 268 of file vivi.c.

#define COLOR_MAGENTA   {239, 0, 239}

Definition at line 269 of file vivi.c.

#define COLOR_RED   {205, 0, 0}

Definition at line 270 of file vivi.c.

#define COLOR_WHITE   {204, 204, 204}

Definition at line 265 of file vivi.c.

#define dprintk (   dev,
  level,
  fmt,
  arg... 
)    v4l2_dbg(level, debug, &dev->v4l2_dev, fmt, ## arg)

Definition at line 73 of file vivi.c.

#define frames_to_ms (   frames)    ((frames * WAKE_NUMERATOR * 1000) / WAKE_DENOMINATOR)

Definition at line 664 of file vivi.c.

#define MAX_HEIGHT   1200

Definition at line 45 of file vivi.c.

#define MAX_WIDTH   1920

Definition at line 44 of file vivi.c.

#define NUM_INPUTS   ARRAY_SIZE(bars)

Definition at line 296 of file vivi.c.

#define TO_U (   r,
  g,
  b 
)    (((-9714 * r - 19070 * g + 28784 * b + 32768) >> 16) + 128)

Definition at line 304 of file vivi.c.

#define TO_V (   r,
  g,
  b 
)    (((28784 * r - 24103 * g - 4681 * b + 32768) >> 16) + 128)

Definition at line 301 of file vivi.c.

#define TO_Y (   r,
  g,
  b 
)    (((16829 * r + 33039 * g + 6416 * b + 32768) >> 16) + 16)

Definition at line 298 of file vivi.c.

#define TSTAMP_INPUT_X   10

Definition at line 357 of file vivi.c.

#define TSTAMP_MAX_Y   (TSTAMP_MIN_Y + 15)

Definition at line 356 of file vivi.c.

#define TSTAMP_MIN_X   (54 + TSTAMP_INPUT_X)

Definition at line 358 of file vivi.c.

#define TSTAMP_MIN_Y   24

Definition at line 355 of file vivi.c.

#define VIVI_CID_CUSTOM_BASE   (V4L2_CID_USER_BASE | 0xf000)

Definition at line 1089 of file vivi.c.

#define VIVI_MODULE_NAME   "vivi"

Definition at line 37 of file vivi.c.

#define VIVI_VERSION   "0.8.1"

Definition at line 47 of file vivi.c.

#define WAKE_DENOMINATOR   1001

Definition at line 41 of file vivi.c.

#define WAKE_NUMERATOR   30

Definition at line 40 of file vivi.c.

Enumeration Type Documentation

enum colors
Enumerator:
WHITE 
AMBER 
CYAN 
GREEN 
MAGENTA 
RED 
BLUE 
BLACK 
TEXT_BLACK 

Definition at line 252 of file vivi.c.

Function Documentation

MODULE_AUTHOR ( "Mauro Carvalho  Chehab,
Ted Walther and John Sokol"   
)
MODULE_DESCRIPTION ( "Video Technology Magazine Virtual Video Capture Board"  )
module_exit ( vivi_exit  )
module_init ( vivi_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param ( video_nr  ,
uint  ,
0644   
)
module_param ( n_devs  ,
uint  ,
0644   
)
module_param ( debug  ,
uint  ,
0644   
)
module_param ( vid_limit  ,
uint  ,
0644   
)
MODULE_PARM_DESC ( video_nr  ,
"videoX start  number,
-1 is autodetect"   
)
MODULE_PARM_DESC ( n_devs  ,
"number of video devices to create  
)
MODULE_PARM_DESC ( debug  ,
"activates debug info  
)
MODULE_PARM_DESC ( vid_limit  ,
"capture memory limit in megabytes"   
)
MODULE_VERSION ( VIVI_VERSION  )