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

被折叠的 条评论
为什么被折叠?



