在Linux的应用程序中app/video/opt_eis/vision_service.cpp ,有如下代码。打开了设备节点dsp和video5。并在此文件中操作这两个设备。
944 dsp_fd = open(PATH_DSP, O_RDWR);
512 /*--------------------- cam initial ---------------------*/
513 v4l2_pdev = new v4l2cap;
514 // buffer allocation
515 if(v4l2_pdev->v4l2cap_open(PATH_OPT) == false){
516 cout << "v4l2cap_open failed!" <v4l2cap_get_property();
520 //v4l2_pdev->v4l2cap_get_format();
521 if(v4l2_pdev->v4l2cap_init(PATH_OPT, V4L2_PIX_FMT_YUYV, WIDTH, HEIGHT) == false){
522 cout << "v4l2cap_init failed!" <v4l2cap_close();
524 return NULL;
525 }
Linux在dev目录下也可以查看设备dsp和video5的主设备号和次设备号分别为(81.6)(247.0),可以通过cat proc/devices查看主设备号为81和247的分别为video4linux,dsp:
[root@arm-linux]#
[root@arm-linux]#cat proc/devices
Character devices:
1 mem
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
10 misc
13 input
29 fb
81 video4linux
89 i2c
116 alsa
128 ptm
136 pts
180 usb
189 usb_device
245 ttyGS
246 rkvenc
247 dsp
248 rkvdec
249 vpu_service
250 iio
251 pps
252 media
253 rtc
254 ttyFIQ
Block devices:
259 blkext
7 loop
31 rkflash
179 mmc
254 zram
[root@arm-linux]#
[root@arm-linux]#
[root@arm-linux]#ls -al dev/ | grep video
crw------- 1 root 0 81, 0 Jan 1 1970 video0
crw------- 1 root 0 81, 1 Jan 1 1970 video1
crw------- 1 root 0 81, 2 Jan 1 1970 video2
crw------- 1 root 0 81, 3 Jan 1 1970 video3
crw------- 1 root 0 81, 4 Jan 1 1970 video4
crw------- 1 root 0 81, 6 Jan 21 08:50 video5
crw------- 1 root 0 10, 56 Jan 1 1970 video_state
[root@arm-linux]#
[root@arm-linux]#
[root@arm-linux]#
[root@arm-linux]#ls -al dev/ | grep dsp
crw------- 1 root 0 247, 0 Jan 1 1970 dsp
[root@arm-linux]#
[root@arm-linux]#