虽然韦东山老师项目是jz440的,但是只要LCD的/dev/fd0 以及uvc摄像头/dev/video0(我的是0)的设备存在,应用就不要修改
注意:这里是UVC摄像头,在内核里面已经有驱动(/drivers/media/video/uvc)所以usb摄像头一插上,就会系统自动找到对应uvc驱动,生成/dev/video0
启动nfs内核:setenv bootargs "noinitrd console=ttySAC2,115200 root=/dev/nfs nfsroot=192.168.1.6:/home/jimmy/news5pv210/nfs,proto=tcp,nfsvers=3,nolock ip=192.168.1.9:192.168.1.6:192.168.1.6:255.255.255.0::eth0:off mem=512M"
代码路径:https://github.com/jimingkang/news5pv210/tree/master/nfs/study/mydriver/weidongshan/video2lcd
具体细节参考:https://blog.csdn.net/ap105638/category_1378830.html
1)编译libjpeg-turbo-1.3.0.tar.gz
>./configure --host=arm-none-linux-gnueabi CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar STRIP=arm-linux-gnueabi-strip RANLIB=arm-none-linux-gnueabi-ranlib
>make
>make install (默认到/opt/libjpeg-turbo/lib)
>sudo cp libjpeg-turbo-1.3.0/*.h news5pv210/tree/master/study/weidongshan/video2lcd/include(为了编译video2lcd方便)
>sudo cp /opt/libjpeg-turbo/lib/* news5pv210/nfs/lib/ (为了运行video2lcd)
2)编译video2lcd
>sudo cp /opt/libjpeg-turbo/lib/* /arm/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/libc/lib (为了编译video2lcd)
》make
3)插入camera,显示:
usb 1-1.4: Product: USB 2.0 Camera
[ 1992.560907] usb 1-1.4: Manufacturer: HD Camera Manufacturer
[ 1992.571664] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9230)
[ 1992.623043] input: USB 2.0 Camera as /devices/platform/s5p-ehci/usb1/1-1/1-1.4/1-1.4:1.0/input/input5
4)运行:
./video2lcd /dev/video0 (注意我的video1 2 3被cmos摄像头占据)
/dev/video3 supports streaming i/o
Convert mjpeg2rgb, ret = 0