一、 下载SDL源码包,交叉编译
#tar –xzvf SDL-1.2.14.tar.gz
#mv SDL-1.2.14 SDL-1.2.14-arm
#cd SDL-1.2.14-arm/
#cd /usr/local/
#sudo mkdirSDL-ARM-linux-gcc4.3.3
#./configure CC=arm-none-linux-gnueabi-gcc--target=arm-linux --host=arm-linux --prefix=/usr/local/SDL-ARM-linux-gcc4.3.3/--enable-static --disable-shared --disable-joystick --disable-cdrom--disable-esd --disable-nasm --enable-video-x11 --enable-video-fbcon --enable-video-opengl--enable-osmesa-shared --disable-arts --without-x --enable-debug -enable-loadso--disable-video-directfb
#make
#sudo make install
error:
./src/audio/dma/SDL_dmaaudio.c: Infunction 'DMA_WaitAudio':
./src/audio/dma/SDL_dmaaudio.c:166:error: impossible constraint in 'asm'
make: *** [build/SDL_dmaaudio.lo]Error 1
--disable-video-x11(去掉此项可以编译通过,按照上面编译不会出现此错误)
二、 下载luvcview标准源码包,编译luvcview
#tar xzvf luvcview-2007-0512.tar.gz
#mv luvcview-2007-0512luvcview-2007-0512-arm
#cd luvcview-2007-0512-arm
#vim Makefile
##############################
# spcaview Makefile
##############################
INSTALLROOT=$(PWD)
+CC=arm-none-linux-gnueabi-gcc
+CPP=arm-none-linux-gnueabi-g++
INSTALL=install
APP_BINARY=luvcview
BIN=/usr/local/bin
SDLLIBS = $(shell sdl-config--libs)
SDLFLAGS = $(shell sdl-config--cflags
+SDLLIBS =-L/usr/local/SDL-ARM-linux-gcc4.3.3/lib -lSDL
+SDLFLAGS =/usr/local/SDL-ARM-linux-gcc4.3.3/include
#LIBX11FLAGS +=-I/home/ema/dvsdk/ti-dvsdk_dm3730-evm_4_02_00_06/omap35x_graphics_sdk_4.00.00.01/gfx_dbg_es2.x/freedesktop/kdrive/usr/X11R6_SGX/include-L/home/ema/dvsdk/ti-dvsdk_dm3730-evm_4_02_00_06/omap35x_graphics_sdk_4.00.00.01/gfx_dbg_es2.x/freedesktop/kdrive/usr/X11R6_SGX/lib
#X11_LIB += /home/ema/dvsdk/ti-dvsdk_dm3730-evm_4_02_00_06/omap35x_graphics_sdk_4.00.00.01/gfx_dbg_es2.x/freedesktop/kdrive/usr/X11R6_SGX/lib
VERSION = 0.2.1
#WARNINGS = -Wall \
# -Wundef -Wpointer-arith-Wbad-function-cast \
# -Wcast-align -Wwrite-strings-Wstrict-prototypes \
# -Wmissing-prototypes-Wmissing-declarations \
# -Wnested-externs -Winline-Wcast-qual -W \
# -Wno-unused
# -Wunused
+CFLAGS +=-I/home/ema/dvsdk/ti-dvsdk_dm3730-evm_4_02_00_06/omap35x_graphics_sdk_4.00.00.01/gfx_dbg_es2.x/freedesktop/kdrive/usr/X11R6_SGX/include
CFLAGS += -DUSE_SDL -O2 -DLINUX-DVERSION=\"$(VERSION)\" -I$(SDLFLAGS) $(WARNINGS)
CPPFLAGS = $(CFLAGS)
OBJECTS= luvcview.o color.outils.o v4l2uvc.o gui.o avilib.o
all: luvcview
#carefully:"+" means that need to amend or need to add.
三、 设置模拟显示器参数
从虚拟机里断开 USB 连接,取出 SD 卡插到开发板,上电启动开发板;启动时按下空格键,进入BIOS,设置CRT显示参数:
#setenv dvimode 800x600MR-16@60
#setenvdefaultdisplay dvi
#saverenv
#boot
四、 移植SDL库,移植luvcview
#cp /usr/local/ SDL-ARM-linux-gcc4.3.3/(PC机) /usr/local/SDL-ARM-linux-gcc4.3.3/(开发板)
#cp ~/luvcview-20070512-arm/luvcview(PC机) /home/boot/(开发板)
备注:可通过U盘拷贝
五、 设置环境变量
1、 备注:包含Qt移植环境变量
export LD_LIBRARY_PATH=/usr/local/qt-emembeded-4.7.3-arm-linux/lib:/usr/local/qt-mobility-1.2.0-lib/lib:/usr/local/tslib/lib:$LD_LIBRARY_PATH
exportPATH=/usr/local/qt-emembeded-4.7.3-arm-linux/bin:$PATH
exportQT_QWS_FONTDIR=/usr/local/qt-emembeded-4.7.3-arm-linux/lib/fonts/$QT_QWS_FONTDIR
2、单独移植SDL库:
#vimetc/profile
export LD_LIBRARY_PATH=/usr/local/SDL-ARM-linux-gcc4.3.3/lib:$LD_LIBRARY_PATH
export SDL_NOMOUSE=1
六、 启动Cortex A8的系统,进入桌面系统
1、登陆:
#Username:root
#Password:****
2、打开终端:
桌面》Other》Terminal》
3、插上摄像头:
#./luvcview