Camera driver 移植

本文详细介绍了如何将具备解码功能的gspcav1-20071224.tar.gz驱动移植到Linux内核2.6.27的过程,包括下载补丁文件、应用补丁、创建目录、编写Kconfig和Makefile,以支持SPCA5XX系列摄像头的JPEG数据流解码。

linux kernel 2.6.27中在/drivers/media/video/gspca下集成了一个通用的webCamera driver.但这个driver没有解码功能。

网上下载的gspcav1-20071224.tar.gz含有decode 功能,可以将Camera收集到的jpeg数据流解码为RGB565,YUV420等,还可以实现其他编解码的转换。

下面是将gspcav1-20071224.tar.gz移植到linux kernel 2.6.27中的步骤:

1. 下载gspcav1-20071224.tar.gz 和补丁文件gspca_kernel_2.6.27.diff

2.解压gspcav1-20071224.tar.gz,进入解压后的目录。拷贝gspca_kernel_2.6.27.diff到该目录。

3.在当前目录下打补丁:执行命令  patch -p1<gspca_kernel_2.6.27.diff

4.在kernel的drivers/usb下新建一个目录media , 将2中的目录拷贝到media 下,在media目录下为该driver 写Kconfig 和Makefile.

5.在usb 的Kconfig 和Makefile 下为该driver添加新命令。Kconfig 中添加:source "drivers/usb/meida/Kconfig";Makefile中添加:obj-$(CONFIG_USB_SPCA5XX)+=media/

 

步骤4中的Kconfig内容为:

#
# USB Multimedia device configuration
#
comment "USB Multimedia devices"
depends on USB

config USB_SPCA5XX
tristate "USB SPCA5XX Sunplus/Vimicro/Sonix jpeg Cameras"
depends on USB && VIDEO_DEV
---help---
Say Y or M here if you want to use one of these webcams:

The built-in microphone is enabled by selecting USB Audio support.

This driver uses the Video For Linux API. You must say Y or M to
"Video For Linux" (under Character Devices) to use this driver.
Information on this API and pointers to "v4l" programs may be found
at <file:Documentation/video4linux/API.html>.

To compile this driver as a module, choose M here: the
module will be called spca5xx.

步骤4中的Makefile内容为:

obj-$(CONFIG_USB_SPCA5XX) += gspcav1-20071224/

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值