stk11xx-buf.c File Reference

Driver for Syntek USB video camera. More...

#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/kref.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/usb.h>
#include <media/v4l2-common.h>
#include "stk11xx.h"

Go to the source code of this file.

Functions

void * stk11xx_rvmalloc (unsigned long size)
 Allocate a buffer.
void stk11xx_rvfree (void *mem, unsigned long size)
 Free a buffer.
int stk11xx_allocate_buffers (struct usb_stk11xx *dev)
 Allocate all ISOC buffers.
int stk11xx_reset_buffers (struct usb_stk11xx *dev)
 Reset all ISOC buffers.
int stk11xx_clear_buffers (struct usb_stk11xx *dev)
 Clear current buffers.
int stk11xx_free_buffers (struct usb_stk11xx *dev)
 Release all buffers.
void stk11xx_next_image (struct usb_stk11xx *dev)
 Prepare the next image.
int stk11xx_next_frame (struct usb_stk11xx *dev)
 Prepare the next frame.
int stk11xx_handle_frame (struct usb_stk11xx *dev)
 Handler frame.

Variables

static int default_nbrframebuf = 3


Detailed Description

Driver for Syntek USB video camera.

Author:
Nicolas VIVIEN
Date:
2006-10-23
Version:
v1.3.x
Note:
Copyright (C) Nicolas VIVIEN
Licences
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

SubVersion
Date
2007-12-08 11:34:45 +0100 (sam, 08 déc 2007)
Revision
68
Author
nicklas79
HeadURL
https://syntekdriver.svn.sourceforge.net/svnroot/syntekdriver/tags/1.3.1/stk11xx-buf.c

Definition in file stk11xx-buf.c.


Function Documentation

int stk11xx_allocate_buffers ( struct usb_stk11xx *  dev  ) 

Allocate all ISOC buffers.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to reserved the memory for each ISOC buffer.

Definition at line 129 of file stk11xx-buf.c.

References default_nbrframebuf, ISO_BUFFER_SIZE, MAX_ISO_BUFS, STK11XX_FRAME_SIZE, STK11XX_MAX_IMAGES, stk11xx_rvmalloc(), STK_DEBUG, and STK_ERROR.

Referenced by v4l_stk11xx_open().

int stk11xx_clear_buffers ( struct usb_stk11xx *  dev  ) 

Clear current buffers.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to clear the memory.

Definition at line 271 of file stk11xx-buf.c.

Referenced by v4l_stk11xx_do_ioctl().

int stk11xx_free_buffers ( struct usb_stk11xx *  dev  ) 

Release all buffers.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to release and free the memory for each ISOC buffer.

Definition at line 288 of file stk11xx-buf.c.

References default_nbrframebuf, MAX_ISO_BUFS, stk11xx_rvfree(), and STK_DEBUG.

Referenced by v4l_stk11xx_open(), and v4l_stk11xx_release().

int stk11xx_handle_frame ( struct usb_stk11xx *  dev  ) 

Handler frame.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function gets called for the isochronous pipe. This function is only called when a frame is ready. So we have to be fast to decompress the data.

Definition at line 408 of file stk11xx-buf.c.

References dev_stk11xx_watchdog_camera(), stk11xx_decompress(), and STK_STREAM.

Referenced by v4l_stk11xx_do_ioctl(), and v4l_stk11xx_read().

int stk11xx_next_frame ( struct usb_stk11xx *  dev  ) 

Prepare the next frame.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function is called when a frame is ready, so as to prepare the next frame.

Definition at line 353 of file stk11xx-buf.c.

References STK_ERROR, and STK_STREAM.

Referenced by usb_stk11xx_isoc_handler().

void stk11xx_next_image ( struct usb_stk11xx *  dev  ) 

Prepare the next image.

Parameters:
dev Device structure
This function is called when an image is ready, so as to prepare the next image.

Definition at line 335 of file stk11xx-buf.c.

References STK_STREAM.

Referenced by v4l_stk11xx_do_ioctl(), and v4l_stk11xx_read().

int stk11xx_reset_buffers ( struct usb_stk11xx *  dev  ) 

Reset all ISOC buffers.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to reset all ISOC buffers.

Definition at line 222 of file stk11xx-buf.c.

References STK_DEBUG.

Referenced by v4l_stk11xx_open().

void stk11xx_rvfree ( void *  mem,
unsigned long  size 
)

Free a buffer.

Parameters:
mem Memory address
size Size of allocated memory
This function permits to free a buffer.

Definition at line 101 of file stk11xx-buf.c.

Referenced by stk11xx_free_buffers().

void* stk11xx_rvmalloc ( unsigned long  size  ) 

Allocate a buffer.

Parameters:
size Size of memory
Returns:
Address on the allocated memory
This function permits to allocate a buffer in memory.

Definition at line 68 of file stk11xx-buf.c.

Referenced by stk11xx_allocate_buffers().


Variable Documentation

default_nbrframebuf = 3 [static]

Number of frame buffer by default

Definition at line 56 of file stk11xx-buf.c.

Referenced by stk11xx_allocate_buffers(), and stk11xx_free_buffers().


Generated on Thu Nov 20 13:23:18 2008 for SyntekUSBVideoCamera by  doxygen 1.5.6