Commit d4c0db20 authored by Kai Germaschewski's avatar Kai Germaschewski

Properly export drivers/usb/media video interface

Mark the API functions accessed by other drivers with EXPORT_SYMBOL() and
make the remaining functions static.
parent 7fb7f2ac
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
O_TARGET := media.o O_TARGET := media.o
export-objs := ov511.o pwc-uncompress.o export-objs := ov511.o pwc-uncompress.o usbvideo.o
pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
#define __NO_VERSION__ /* Temporary: usbvideo is not a module yet */
#include <linux/module.h> #include <linux/module.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
...@@ -55,6 +54,24 @@ static int usbvideo_default_procfs_write_proc( ...@@ -55,6 +54,24 @@ static int usbvideo_default_procfs_write_proc(
unsigned long count, void *data); unsigned long count, void *data);
#endif #endif
static void usbvideo_Disconnect(struct usb_device *dev, void *ptr);
static void usbvideo_CameraRelease(uvd_t *uvd);
static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma);
static int usbvideo_v4l_open(struct inode *inode, struct file *file);
static int usbvideo_v4l_read(struct file *file, char *buf,
size_t count, loff_t *ppos);
static int usbvideo_v4l_close(struct inode *inode, struct file *file);
static int usbvideo_StartDataPump(uvd_t *uvd);
static void usbvideo_StopDataPump(uvd_t *uvd);
static int usbvideo_GetFrame(uvd_t *uvd, int frameNum);
static int usbvideo_NewFrame(uvd_t *uvd, int framenum);
static void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd,
usbvideo_frame_t *frame);
/*******************************/ /*******************************/
/* Memory management functions */ /* Memory management functions */
/*******************************/ /*******************************/
...@@ -73,7 +90,7 @@ unsigned long usbvideo_kvirt_to_pa(unsigned long adr) ...@@ -73,7 +90,7 @@ unsigned long usbvideo_kvirt_to_pa(unsigned long adr)
return ret; return ret;
} }
void *usbvideo_rvmalloc(unsigned long size) static void *usbvideo_rvmalloc(unsigned long size)
{ {
void *mem; void *mem;
unsigned long adr; unsigned long adr;
...@@ -94,7 +111,7 @@ void *usbvideo_rvmalloc(unsigned long size) ...@@ -94,7 +111,7 @@ void *usbvideo_rvmalloc(unsigned long size)
return mem; return mem;
} }
void usbvideo_rvfree(void *mem, unsigned long size) static void usbvideo_rvfree(void *mem, unsigned long size)
{ {
unsigned long adr; unsigned long adr;
...@@ -110,13 +127,13 @@ void usbvideo_rvfree(void *mem, unsigned long size) ...@@ -110,13 +127,13 @@ void usbvideo_rvfree(void *mem, unsigned long size)
vfree(mem); vfree(mem);
} }
void RingQueue_Initialize(RingQueue_t *rq) static void RingQueue_Initialize(RingQueue_t *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
init_waitqueue_head(&rq->wqh); init_waitqueue_head(&rq->wqh);
} }
void RingQueue_Allocate(RingQueue_t *rq, int rqLen) static void RingQueue_Allocate(RingQueue_t *rq, int rqLen)
{ {
assert(rq != NULL); assert(rq != NULL);
assert(rqLen > 0); assert(rqLen > 0);
...@@ -125,14 +142,14 @@ void RingQueue_Allocate(RingQueue_t *rq, int rqLen) ...@@ -125,14 +142,14 @@ void RingQueue_Allocate(RingQueue_t *rq, int rqLen)
assert(rq->queue != NULL); assert(rq->queue != NULL);
} }
int RingQueue_IsAllocated(const RingQueue_t *rq) static int RingQueue_IsAllocated(const RingQueue_t *rq)
{ {
if (rq == NULL) if (rq == NULL)
return 0; return 0;
return (rq->queue != NULL) && (rq->length > 0); return (rq->queue != NULL) && (rq->length > 0);
} }
void RingQueue_Free(RingQueue_t *rq) static void RingQueue_Free(RingQueue_t *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
if (RingQueue_IsAllocated(rq)) { if (RingQueue_IsAllocated(rq)) {
...@@ -154,6 +171,8 @@ int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len) ...@@ -154,6 +171,8 @@ int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len)
return len; return len;
} }
EXPORT_SYMBOL(RingQueue_Dequeue);
int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n) int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n)
{ {
int enqueued = 0; int enqueued = 0;
...@@ -184,6 +203,8 @@ int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n) ...@@ -184,6 +203,8 @@ int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n)
return enqueued; return enqueued;
} }
EXPORT_SYMBOL(RingQueue_Enqueue);
int RingQueue_GetLength(const RingQueue_t *rq) int RingQueue_GetLength(const RingQueue_t *rq)
{ {
int ri, wi; int ri, wi;
...@@ -200,7 +221,9 @@ int RingQueue_GetLength(const RingQueue_t *rq) ...@@ -200,7 +221,9 @@ int RingQueue_GetLength(const RingQueue_t *rq)
return wi + (rq->length - ri); return wi + (rq->length - ri);
} }
void RingQueue_InterruptibleSleepOn(RingQueue_t *rq) EXPORT_SYMBOL(RingQueue_GetLength);
static void RingQueue_InterruptibleSleepOn(RingQueue_t *rq)
{ {
assert(rq != NULL); assert(rq != NULL);
interruptible_sleep_on(&rq->wqh); interruptible_sleep_on(&rq->wqh);
...@@ -213,6 +236,8 @@ void RingQueue_WakeUpInterruptible(RingQueue_t *rq) ...@@ -213,6 +236,8 @@ void RingQueue_WakeUpInterruptible(RingQueue_t *rq)
wake_up_interruptible(&rq->wqh); wake_up_interruptible(&rq->wqh);
} }
EXPORT_SYMBOL(RingQueue_WakeUpInterruptible);
/* /*
* usbvideo_VideosizeToString() * usbvideo_VideosizeToString()
* *
...@@ -222,7 +247,7 @@ void RingQueue_WakeUpInterruptible(RingQueue_t *rq) ...@@ -222,7 +247,7 @@ void RingQueue_WakeUpInterruptible(RingQueue_t *rq)
* 07-Aug-2000 Created. * 07-Aug-2000 Created.
* 19-Oct-2000 Reworked for usbvideo module. * 19-Oct-2000 Reworked for usbvideo module.
*/ */
void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs) static void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs)
{ {
char tmp[40]; char tmp[40];
int n; int n;
...@@ -241,7 +266,7 @@ void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs) ...@@ -241,7 +266,7 @@ void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs)
* History: * History:
* 01-Feb-2000 Created. * 01-Feb-2000 Created.
*/ */
void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame, static void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame,
int x, int y, int ch) int x, int y, int ch)
{ {
static const unsigned short digits[16] = { static const unsigned short digits[16] = {
...@@ -296,7 +321,7 @@ void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame, ...@@ -296,7 +321,7 @@ void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame,
* History: * History:
* 01-Feb-2000 Created. * 01-Feb-2000 Created.
*/ */
void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame, static void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame,
int x, int y, const char *str) int x, int y, const char *str)
{ {
while (*str) { while (*str) {
...@@ -314,7 +339,7 @@ void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame, ...@@ -314,7 +339,7 @@ void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame,
* History: * History:
* 01-Feb-2000 Created. * 01-Feb-2000 Created.
*/ */
void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame) static void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame)
{ {
const int y_diff = 8; const int y_diff = 8;
char tmp[16]; char tmp[16];
...@@ -437,7 +462,7 @@ void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame) ...@@ -437,7 +462,7 @@ void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame)
* History: * History:
* 14-Jan-2000 Corrected default multiplier. * 14-Jan-2000 Corrected default multiplier.
*/ */
void usbvideo_ReportStatistics(const uvd_t *uvd) static void usbvideo_ReportStatistics(const uvd_t *uvd)
{ {
if ((uvd != NULL) && (uvd->stats.urb_count > 0)) { if ((uvd != NULL) && (uvd->stats.urb_count > 0)) {
unsigned long allPackets, badPackets, goodPackets, percent; unsigned long allPackets, badPackets, goodPackets, percent;
...@@ -549,6 +574,8 @@ void usbvideo_DrawLine( ...@@ -549,6 +574,8 @@ void usbvideo_DrawLine(
} }
} }
EXPORT_SYMBOL(usbvideo_DrawLine);
/* /*
* usbvideo_TestPattern() * usbvideo_TestPattern()
* *
...@@ -636,6 +663,8 @@ void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode) ...@@ -636,6 +663,8 @@ void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode)
usbvideo_OverlayStats(uvd, frame); usbvideo_OverlayStats(uvd, frame);
} }
EXPORT_SYMBOL(usbvideo_TestPattern);
/* /*
* usbvideo_HexDump() * usbvideo_HexDump()
* *
...@@ -663,6 +692,8 @@ void usbvideo_HexDump(const unsigned char *data, int len) ...@@ -663,6 +692,8 @@ void usbvideo_HexDump(const unsigned char *data, int len)
printk("%s\n", tmp); printk("%s\n", tmp);
} }
EXPORT_SYMBOL(usbvideo_HexDump);
/* Debugging aid */ /* Debugging aid */
void usbvideo_SayAndWait(const char *what) void usbvideo_SayAndWait(const char *what)
{ {
...@@ -672,6 +703,8 @@ void usbvideo_SayAndWait(const char *what) ...@@ -672,6 +703,8 @@ void usbvideo_SayAndWait(const char *what)
interruptible_sleep_on_timeout (&wq, HZ*3); /* Timeout */ interruptible_sleep_on_timeout (&wq, HZ*3); /* Timeout */
} }
EXPORT_SYMBOL(usbvideo_SayAndWait);
/* ******************************************************************** */ /* ******************************************************************** */
static void usbvideo_ClientIncModCount(uvd_t *uvd) static void usbvideo_ClientIncModCount(uvd_t *uvd)
...@@ -825,6 +858,8 @@ int usbvideo_register( ...@@ -825,6 +858,8 @@ int usbvideo_register(
return 0; return 0;
} }
EXPORT_SYMBOL(usbvideo_register);
/* /*
* usbvideo_Deregister() * usbvideo_Deregister()
* *
...@@ -886,6 +921,8 @@ void usbvideo_Deregister(usbvideo_t **pCams) ...@@ -886,6 +921,8 @@ void usbvideo_Deregister(usbvideo_t **pCams)
*pCams = NULL; *pCams = NULL;
} }
EXPORT_SYMBOL(usbvideo_Deregister);
/* /*
* usbvideo_Disconnect() * usbvideo_Disconnect()
* *
...@@ -908,7 +945,7 @@ void usbvideo_Deregister(usbvideo_t **pCams) ...@@ -908,7 +945,7 @@ void usbvideo_Deregister(usbvideo_t **pCams)
* 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT). * 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT).
* 19-Oct-2000 Moved to usbvideo module. * 19-Oct-2000 Moved to usbvideo module.
*/ */
void usbvideo_Disconnect(struct usb_device *dev, void *ptr) static void usbvideo_Disconnect(struct usb_device *dev, void *ptr)
{ {
static const char proc[] = "usbvideo_Disconnect"; static const char proc[] = "usbvideo_Disconnect";
uvd_t *uvd = (uvd_t *) ptr; uvd_t *uvd = (uvd_t *) ptr;
...@@ -958,7 +995,7 @@ void usbvideo_Disconnect(struct usb_device *dev, void *ptr) ...@@ -958,7 +995,7 @@ void usbvideo_Disconnect(struct usb_device *dev, void *ptr)
* History: * History:
* 27-Jan-2000 Created. * 27-Jan-2000 Created.
*/ */
void usbvideo_CameraRelease(uvd_t *uvd) static void usbvideo_CameraRelease(uvd_t *uvd)
{ {
static const char proc[] = "usbvideo_CameraRelease"; static const char proc[] = "usbvideo_CameraRelease";
if (uvd == NULL) { if (uvd == NULL) {
...@@ -1079,6 +1116,8 @@ uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams) ...@@ -1079,6 +1116,8 @@ uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams)
return uvd; return uvd;
} }
EXPORT_SYMBOL(usbvideo_AllocateDevice);
int usbvideo_RegisterVideoDevice(uvd_t *uvd) int usbvideo_RegisterVideoDevice(uvd_t *uvd)
{ {
static const char proc[] = "usbvideo_RegisterVideoDevice"; static const char proc[] = "usbvideo_RegisterVideoDevice";
...@@ -1139,9 +1178,11 @@ int usbvideo_RegisterVideoDevice(uvd_t *uvd) ...@@ -1139,9 +1178,11 @@ int usbvideo_RegisterVideoDevice(uvd_t *uvd)
return 0; return 0;
} }
EXPORT_SYMBOL(usbvideo_RegisterVideoDevice);
/* ******************************************************************** */ /* ******************************************************************** */
int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma) static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma)
{ {
uvd_t *uvd = file->private_data; uvd_t *uvd = file->private_data;
unsigned long start = vma->vm_start; unsigned long start = vma->vm_start;
...@@ -1185,7 +1226,7 @@ int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -1185,7 +1226,7 @@ int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma)
* 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers. * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers.
* 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT). * 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT).
*/ */
int usbvideo_v4l_open(struct inode *inode, struct file *file) static int usbvideo_v4l_open(struct inode *inode, struct file *file)
{ {
static const char proc[] = "usbvideo_v4l_open"; static const char proc[] = "usbvideo_v4l_open";
struct video_device *dev = video_devdata(file); struct video_device *dev = video_devdata(file);
...@@ -1300,7 +1341,7 @@ int usbvideo_v4l_open(struct inode *inode, struct file *file) ...@@ -1300,7 +1341,7 @@ int usbvideo_v4l_open(struct inode *inode, struct file *file)
* 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers. * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers.
* 24-May-2000 Moved MOD_DEC_USE_COUNT outside of code that can sleep. * 24-May-2000 Moved MOD_DEC_USE_COUNT outside of code that can sleep.
*/ */
int usbvideo_v4l_close(struct inode *inode, struct file *file) static int usbvideo_v4l_close(struct inode *inode, struct file *file)
{ {
static const char proc[] = "usbvideo_v4l_close"; static const char proc[] = "usbvideo_v4l_close";
struct video_device *dev = file->private_data; struct video_device *dev = file->private_data;
...@@ -1554,7 +1595,7 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file, ...@@ -1554,7 +1595,7 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
return 0; return 0;
} }
int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
return video_usercopy(inode, file, cmd, arg, usbvideo_v4l_do_ioctl); return video_usercopy(inode, file, cmd, arg, usbvideo_v4l_do_ioctl);
...@@ -1571,7 +1612,7 @@ int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, ...@@ -1571,7 +1612,7 @@ int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
* 20-Oct-2000 Created. * 20-Oct-2000 Created.
* 01-Nov-2000 Added mutex (uvd->lock). * 01-Nov-2000 Added mutex (uvd->lock).
*/ */
int usbvideo_v4l_read(struct file *file, char *buf, static int usbvideo_v4l_read(struct file *file, char *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
static const char proc[] = "usbvideo_v4l_read"; static const char proc[] = "usbvideo_v4l_read";
...@@ -1809,7 +1850,7 @@ static void usbvideo_IsocIrq(struct urb *urb) ...@@ -1809,7 +1850,7 @@ static void usbvideo_IsocIrq(struct urb *urb)
* of hardcoded values. Simplified by using for loop, * of hardcoded values. Simplified by using for loop,
* allowed any number of URBs. * allowed any number of URBs.
*/ */
int usbvideo_StartDataPump(uvd_t *uvd) static int usbvideo_StartDataPump(uvd_t *uvd)
{ {
static const char proc[] = "usbvideo_StartDataPump"; static const char proc[] = "usbvideo_StartDataPump";
struct usb_device *dev = uvd->dev; struct usb_device *dev = uvd->dev;
...@@ -1885,7 +1926,7 @@ int usbvideo_StartDataPump(uvd_t *uvd) ...@@ -1885,7 +1926,7 @@ int usbvideo_StartDataPump(uvd_t *uvd)
* 22-Jan-2000 Corrected order of actions to work after surprise removal. * 22-Jan-2000 Corrected order of actions to work after surprise removal.
* 27-Jan-2000 Used uvd->iface, uvd->ifaceAltInactive instead of hardcoded values. * 27-Jan-2000 Used uvd->iface, uvd->ifaceAltInactive instead of hardcoded values.
*/ */
void usbvideo_StopDataPump(uvd_t *uvd) static void usbvideo_StopDataPump(uvd_t *uvd)
{ {
static const char proc[] = "usbvideo_StopDataPump"; static const char proc[] = "usbvideo_StopDataPump";
int i, j; int i, j;
...@@ -1929,7 +1970,7 @@ void usbvideo_StopDataPump(uvd_t *uvd) ...@@ -1929,7 +1970,7 @@ void usbvideo_StopDataPump(uvd_t *uvd)
* 29-Mar-00 Added copying of previous frame into the current one. * 29-Mar-00 Added copying of previous frame into the current one.
* 6-Aug-00 Added model 3 video sizes, removed redundant width, height. * 6-Aug-00 Added model 3 video sizes, removed redundant width, height.
*/ */
int usbvideo_NewFrame(uvd_t *uvd, int framenum) static int usbvideo_NewFrame(uvd_t *uvd, int framenum)
{ {
usbvideo_frame_t *frame; usbvideo_frame_t *frame;
int n; int n;
...@@ -2004,7 +2045,7 @@ int usbvideo_NewFrame(uvd_t *uvd, int framenum) ...@@ -2004,7 +2045,7 @@ int usbvideo_NewFrame(uvd_t *uvd, int framenum)
* FLAGS_NO_DECODING set. Therefore, any regular build of any driver * FLAGS_NO_DECODING set. Therefore, any regular build of any driver
* based on usbvideo can use this feature at any time. * based on usbvideo can use this feature at any time.
*/ */
void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame) static void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame)
{ {
int n; int n;
...@@ -2034,7 +2075,7 @@ void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame) ...@@ -2034,7 +2075,7 @@ void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame)
} }
} }
int usbvideo_GetFrame(uvd_t *uvd, int frameNum) static int usbvideo_GetFrame(uvd_t *uvd, int frameNum)
{ {
static const char proc[] = "usbvideo_GetFrame"; static const char proc[] = "usbvideo_GetFrame";
usbvideo_frame_t *frame = &uvd->frame[frameNum]; usbvideo_frame_t *frame = &uvd->frame[frameNum];
...@@ -2225,6 +2266,8 @@ void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame) ...@@ -2225,6 +2266,8 @@ void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame)
usbvideo_OverlayStats(uvd, frame); usbvideo_OverlayStats(uvd, frame);
} }
EXPORT_SYMBOL(usbvideo_DeinterlaceFrame);
/* /*
* usbvideo_SoftwareContrastAdjustment() * usbvideo_SoftwareContrastAdjustment()
* *
...@@ -2235,7 +2278,8 @@ void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame) ...@@ -2235,7 +2278,8 @@ void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame)
* History: * History:
* 09-Feb-2001 Created. * 09-Feb-2001 Created.
*/ */
void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd, usbvideo_frame_t *frame) static void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd,
usbvideo_frame_t *frame)
{ {
static const char proc[] = "usbvideo_SoftwareContrastAdjustment"; static const char proc[] = "usbvideo_SoftwareContrastAdjustment";
int i, j, v4l_linesize; int i, j, v4l_linesize;
......
...@@ -304,35 +304,22 @@ typedef struct s_usbvideo_t usbvideo_t; ...@@ -304,35 +304,22 @@ typedef struct s_usbvideo_t usbvideo_t;
#define VALID_CALLBACK(uvd,cbName) ((((uvd) != NULL) && \ #define VALID_CALLBACK(uvd,cbName) ((((uvd) != NULL) && \
((uvd)->handle != NULL)) ? GET_CALLBACK(uvd,cbName) : NULL) ((uvd)->handle != NULL)) ? GET_CALLBACK(uvd,cbName) : NULL)
void RingQueue_Initialize(RingQueue_t *rq);
void RingQueue_Allocate(RingQueue_t *rq, int rqLen);
int RingQueue_IsAllocated(const RingQueue_t *rq);
void RingQueue_Free(RingQueue_t *rq);
int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len); int RingQueue_Dequeue(RingQueue_t *rq, unsigned char *dst, int len);
int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n); int RingQueue_Enqueue(RingQueue_t *rq, const unsigned char *cdata, int n);
int RingQueue_GetLength(const RingQueue_t *rq); int RingQueue_GetLength(const RingQueue_t *rq);
void RingQueue_InterruptibleSleepOn(RingQueue_t *rq);
void RingQueue_WakeUpInterruptible(RingQueue_t *rq); void RingQueue_WakeUpInterruptible(RingQueue_t *rq);
void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame);
void usbvideo_DrawLine( void usbvideo_DrawLine(
usbvideo_frame_t *frame, usbvideo_frame_t *frame,
int x1, int y1, int x1, int y1,
int x2, int y2, int x2, int y2,
unsigned char cr, unsigned char cg, unsigned char cb); unsigned char cr, unsigned char cg, unsigned char cb);
void usbvideo_HexDump(const unsigned char *data, int len); void usbvideo_HexDump(const unsigned char *data, int len);
void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame, int x, int y, int ch);
void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame, int x, int y, const char *str);
void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame);
void usbvideo_ReportStatistics(const uvd_t *uvd);
void usbvideo_SayAndWait(const char *what); void usbvideo_SayAndWait(const char *what);
void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode); void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode);
void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs);
/* Memory allocation routines */ /* Memory allocation routines */
unsigned long usbvideo_kvirt_to_pa(unsigned long adr); unsigned long usbvideo_kvirt_to_pa(unsigned long adr);
void *usbvideo_rvmalloc(unsigned long size);
void usbvideo_rvfree(void *mem, unsigned long size);
int usbvideo_register( int usbvideo_register(
usbvideo_t **pCams, usbvideo_t **pCams,
...@@ -344,24 +331,10 @@ int usbvideo_register( ...@@ -344,24 +331,10 @@ int usbvideo_register(
uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams); uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams);
int usbvideo_RegisterVideoDevice(uvd_t *uvd); int usbvideo_RegisterVideoDevice(uvd_t *uvd);
void usbvideo_Deregister(usbvideo_t **uvt); void usbvideo_Deregister(usbvideo_t **uvt);
void usbvideo_Disconnect(struct usb_device *dev, void *ptr);
void usbvideo_CameraRelease(uvd_t *uvd);
int usbvideo_v4l_close(struct inode *inode, struct file *file);
int usbvideo_v4l_initialize(struct video_device *dev); int usbvideo_v4l_initialize(struct video_device *dev);
int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma);
int usbvideo_v4l_open(struct inode *inode, struct file *file);
int usbvideo_v4l_read(struct file *file, char *buf,
size_t count, loff_t *ppos);
int usbvideo_GetFrame(uvd_t *uvd, int frameNum);
int usbvideo_NewFrame(uvd_t *uvd, int framenum);
int usbvideo_StartDataPump(uvd_t *uvd);
void usbvideo_StopDataPump(uvd_t *uvd);
void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame); void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame);
void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd, usbvideo_frame_t *frame);
/* /*
* This code performs bounds checking - use it when working with * This code performs bounds checking - use it when working with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment