我在使用 dvsdk_dm368_4_02_00_06/psp/linux-driver-examples-psp03.01.01.38/v4l2/v4l2_mmap_loopback 来获得图像
我的调试记录如下:
root@dm368-evm:/# ./v4l2_mmap_loopback -i 2 -p 1 -m 3 &
root@dm368-evm:/# main : Enter
vpbe_UE_1 : Enter
initializing capture device
setting data fordm365evm_enable_pca9543a
mat
input.name dm365evm_enable_pca9543a, status = -121
= Composite
inpEVM: switch to HD imager video input
ut.name = S-Video
input.name = ######vpfe_dev->current_subdev->is_camera.
Camera
Calling S_INPUT with index = 2
InitDevice:ioctl:VIDIOC_S_INPUT, selected input index = 2
InitDevice:ioctl:VIDIOC_G_INPUT, selected input, Camera
Following standards availablvpfe-capture vpfe-capture: width = 1, height = 1, bpp = 1
e at the input
vpfe-capture vpfe-capture: adjusted width = 32, height = 1, bpp = 1, bytesperline = 32, sizeimage = 32
standard.index = 0
standard.id vpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 1
= b000
standardvpfe-capture vpfe-capture: adjusted width = 2048, height = 1536, bpp = 1, bytesperline = 2048, sizeimage = 3145728
.frameperiod.numerator = 1001
standard.frameperiod.denominator = 30000
standard.framelines = 525
standard.index = 1
standard.id = 1000
standard.frameperiod.numerator = 1001
standard.frameperiod.denominator = 30000
standard.framelines = 525
standard.index = 2
standard.id = 2000
standard.frameperiod.numerator = 1001
standard.frameperiod.denominator = 30000
standard.framelines = 525
standard.index = 3
standard.id = 8000
standard.frameperiod.numerator = 1001
standard.frameperiod.denominator = 30000
standard.framelines = 525
standard.index = 4
standard.id = 4000
standard.frameperiod.numerator = 1001
standard.frameperiod.denominator = 30000
standard.framelines = 525
standard.index = 5
standard.id = ff
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 6
standard.id = 7
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 7
standard.id = 8
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 8
standard.id = 10
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 9
standard.id = e0
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 10
standard.id = 100
standard.frameperiod.numerator = 1001
standard.frameperiod.denominator = 30000
standard.framelines = 525
standard.index = 11
standard.id = 200
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 12
standard.id = 400
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 13
standard.id = 800
standard.frameperiod.numerator = 1001
standard.frameperiod.denominator = 30000
standard.framelines = 525
standard.index = 14
standard.id = ff0000
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 15
standard.id = 10000
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 16
standard.id = 40000
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 17
standard.id = 80000
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 18
standard.id = 320000
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 19
standard.id = 400000
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
standard.index = 20
standard.id = 800000
standard.frameperiod.numerator = 1
standard.frameperiod.denominator = 25
standard.framelines = 625
Default crop capbility bounds - 0 0 2048 1536 ; default - 0 0 2048 1536
set_data_format:setting data format
Available image formats at the capture driver :-
fmt_desc.index = 0
fmt_desc.type = 1
fmt_desc.description = Bayer GrRBGb 8bit A-Law compr.
fmt_desc.pixelformat = 31384142
fmt_desc.index = 1
fmt_desc.type = 1
fmt_desc.description = Bayer GrRBGb - 16bit
fmt_desc.pixelformat = 32525942
*******TRY_FMT (Min resolution) values before calling ioctl*************
fmt.fmt.pix.width = 1
fmt.fmt.pix.height = 1
fmt.fmt.pix.field= 0
fmt.fmt.pix.bytesperline = 0
fmt.fmt.pix.sizeimage = 0
*******TRY_FMT values after calling ioctl*************
fmt.fmt.pix.width = 32
fmt.fmt.pix.height = 1
fmt.fmt.pix.field= 1
fmt.fmt.pix.bytesperline = 32
fmt.fmt.pix.sizeimage = 32
*******TRY_FMT (Max resolution) values before calling ioctl*************
vpfe-capture vpfe-capture: width = 1280, height = 720, bpp = 1
fmt.fmt.pix.heivpfe-capture vpfe-capture: adjusted width = 1280, height = 720, bpp = 1, bytesperline = 1280, sizeimage = 921600
ght = 32768
fmt.fmt.pix.field= 0
fmt.fmt.pix.bytesperline = 0
fmt.fmt.pix.sizeimage = 0
*******TRY_FMT values after calling ioctl*************
fmt.fmt.pix.width = 2048
fmt.fmt.pix.height = 1536
fmt.fmt.pix.field= 1
fmt.fmt.pix.bytesperline = 2048
fmt.fmt.pix.sizeimage = 3145728
the filed = 1
set_data_format:finally negotiated width:1280 height:720
set_data_format:driver reports bytes_per_line:1280(bug)
set_data_format:driver reports size:921600(bug)
set_data_format:Finally negotiated width:1280 height:720
initializing capture buffers
device buffers:3
buffer:0 phy:0 mmap:0x40164000 length:921600
buffer:1 phy:e1000 mmap:0x40245000 length:921600
buffer:2 phy:1c2000 mmap:0x40326000 length:921600
initializing display device
Queing buffer:0
Queing buffer:1
Queing buffer:2
/sys/class/davin###### output_show ######
ci_display/ch0/o###### davinci_enc_get_output ######
utput was opened###### davinci_get_cur_encoder ######
successfully
Current output v###### output_store ######
alue is COMPOSITE
###### davinci_get_cur_encoder ######
###### vpbe_encoder_initialize ######
###### output is COMPOSITE,outindex is 0 ######
###### vpbe_encoder_setoutput ######
###### dm365 = 1 ######
###### mode_info->std is 1 ######
###### mode is NTSC ######
###### 22VPBE Encoder initialized ######
###### vpbe_encoder_setoutput ######
###### dm365 = 1 ######
###### mode_info->std is 1 ######
###### mode is NTSC ######
###### davinci_enc_set_output : next davinci_enc_set_mode_platform ######
###### davinci_enc_set_mode_platform : next davinci_enc_priv_setmode ######
###### output_show ######
###### davinci_enc_get_output ######
###### davinci_get_cur_encoder ######
Changed output t###### mode_show ######
o COMPOSITE
/sys/class/davinci_display/ch0/mo###### davinci_enc_get_mode ######
de was opened su###### davinci_get_cur_encoder ######
ccessfully
###### mode_store ######
Current mode val###### davinci_enc_get_mode ######
ue is NTSC
###### davinci_get_cur_encoder ######
###### davinci_enc_set_mode ######
###### davinci_get_cur_encoder ######
###### dm365 = 1 ######
###### mode_info->std is 1 ######
###### mode is NTSC ######
###### davinci_enc_set_mode : next davinci_enc_set_mode ######
###### davinci_enc_set_mode_platform : next davinci_enc_priv_setmode ######
###### mode_show ######
###### davinci_enc_get_mode ######
###### davinci_get_cur_encoder ######
Changed mode to ###### davinci_enc_get_mode ######
NTSC
1. Opening VID1 device
###### davinci_get_cur_encoder ######
done
fd = 6
davinci_v4l2 davinci_v4l2.1: Invalid format index
Display capabili###### davinci_enc_get_mode ######
###### davinci_get_cur_encoder ######
Streaming is sudavinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:
layer.pix_fmt.bytesperline = 1440,
layer.pix_fmt.width = 720,
layer.pix_fmt.height = 480,
layer.pix_fmt.sizeimage =691200
pported
descripdavinci_v4l2 davinci_v4l2.1: pixfmt->width = 720,
layer->layer_info.config.line_length= 1440
tion = YUV 4:2:2 - UYVY
Video Display type
V4L2_PIX_FMT_UYVY
2. Test request for buffers
Numbers of buffers returned - 3
init_vid1_device:requesting width:720 height:480
VIDIOC_S_FMT: PASS
3. Test GetFormat
dispheight = 480
disppitch = 1440
dispwidth = 720
imagesize = 691200
4. Test querying of buffers and mapping them
buffer:0 phy:0 mmap:0x40407000 length:691200
Total length of the buffer allocated = 691200
buffer:1 phy:a9000 mmap:0x404b0000 length:691200
Total length of the buffer allocated = 691200
buffer:2 phy:152000 mmap:0x40559000 length:691200
Total length of the buffer allocated = 691200
5. Test initial queueing of buffers
6. Test enqueuing of buffers - done
7. Test STREAM_ON
root@dm368-evm:/#
我查看了半天的代码,还是没有搞明白。我知道是映射到用户空间了。
从上面的信息可看出是有图像的,
问题是,捕获到的图像存放在哪里呢?
因为我使用的不是网络摄像机,没有音视频接口,无法直接在LCD或PC上显示。只能将采集到的图像拷贝出来使用暴风影音播放器播放。
请有相关经验的朋友,一起讨论下,谢谢了!