SyntekUSBVideoCamera
Functions | Variables

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 <media/v4l2-ioctl.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:
v2.0.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:
2009-03-25 15:13:05 +0100 (mer 25 mar 2009)
Revision:
84
Author:
nicklas79
HeadURL:
https://syntekdriver.svn.sourceforge.net/svnroot/syntekdriver/tags/2.1.0/stk11xx-buf.c

Definition in file stk11xx-buf.c.


Function Documentation

int stk11xx_allocate_buffers ( struct usb_stk11xx dev)

Allocate all ISOC buffers.

Parameters:
devDevice structure
Returns:
0 if all is OK

This function permits to reserved the memory for each ISOC buffer.

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

References default_nbrframebuf, ISO_BUFFER_SIZE, MAX_ISO_BUFS, stk11xx_image_buf::offset, STK11XX_FRAME_SIZE, STK11XX_MAX_IMAGES, stk11xx_rvmalloc(), STK_DEBUG, STK_ERROR, and stk11xx_image_buf::vma_use_count.

Referenced by v4l_stk11xx_open().

int stk11xx_clear_buffers ( struct usb_stk11xx dev)

Clear current buffers.

Parameters:
devDevice structure
Returns:
0 if all is OK

This function permits to clear the memory.

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

Referenced by v4l_stk11xx_do_ioctl().

int stk11xx_free_buffers ( struct usb_stk11xx dev)

Release all buffers.

Parameters:
devDevice structure
Returns:
0 if all is OK

This function permits to release and free the memory for each ISOC buffer.

Definition at line 287 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:
devDevice 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 407 of file stk11xx-buf.c.

References dev_stk11xx_watchdog_camera(), usb_stk11xx::spinlock, 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:
devDevice 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 352 of file stk11xx-buf.c.

References usb_stk11xx::spinlock, STK_ERROR, and STK_STREAM.

Referenced by usb_stk11xx_isoc_handler().

void stk11xx_next_image ( struct usb_stk11xx dev)

Prepare the next image.

Parameters:
devDevice structure

This function is called when an image is ready, so as to prepare the next image.

Definition at line 334 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:
devDevice structure
Returns:
0 if all is OK

This function permits to reset all ISOC buffers.

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

References usb_stk11xx::spinlock, and STK_DEBUG.

Referenced by v4l_stk11xx_open().

void stk11xx_rvfree ( void *  mem,
unsigned long  size 
)

Free a buffer.

Parameters:
memMemory address
sizeSize of allocated memory

This function permits to free a buffer.

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

Referenced by stk11xx_free_buffers().

void* stk11xx_rvmalloc ( unsigned long  size)

Allocate a buffer.

Parameters:
sizeSize of memory
Returns:
Address on the allocated memory

This function permits to allocate a buffer in memory.

Definition at line 67 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 55 of file stk11xx-buf.c.

Referenced by stk11xx_allocate_buffers(), and stk11xx_free_buffers().