Skip to content

Commit

Permalink
ENGR00230646 camera: mxc_v4l2_overlay should support /dev/video1 input.
Browse files Browse the repository at this point in the history
Problem:
In current kernel structure for smart device board, the parallel camera
attaches to /dev/video0 and mipi camera attaches to /dev/video1.
To make this test support mipi camera test, it should support /dev/video1 as
input.

Solution:
add cmdline argument of '-di' to select video device, default is /dev/video0
change the cmdline argument '-d' to '-do' to select output device.
update related docs

Signed-off-by: Sheng Nan <b38800@freescale.com>
  • Loading branch information
b38800 authored and ericnelsonaz committed May 9, 2013
1 parent 9a6ad0d commit 6baa2ab
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion test/mxc_v4l2_test/doc/FSL-UT-V4L2-003.txt
Expand Up @@ -32,7 +32,7 @@ Check again for /dev/video0. If it is not there, the camera driver has not loade

Type the following command.

mxc_v4l2_overlay.out -iw 640 -ih 480 -it 0 -il 0 -ow 160 -oh 160 -ot 20 -ol 20 -r 0 -t 50 -d 0 -fg -fr 30
mxc_v4l2_overlay.out -iw 640 -ih 480 -it 0 -il 0 -ow 160 -oh 160 -ot 20 -ol 20 -r 0 -t 50 -do 0 -fg -fr 30

Direct preview the camera to the foreground, and set the frame rate to 30 fps, the window of interest is 640 X 480 with a starting offset of (0,0), the preview size is 160 X 160 with a starting offset of (20,20). Use mxc_v4l2_overlay.out -help to see usage.

Expand Down
2 changes: 1 addition & 1 deletion test/mxc_v4l2_test/doc/FSL-UT-V4L2-004.txt
Expand Up @@ -31,7 +31,7 @@ Check again for /dev/video0. If it is not there, the camera driver has not loade

Type the following command.

mxc_v4l2_overlay.out -iw 640 -ih 480 -it 0 -il 0 -ow 160 -oh 160 -ot 20 -ol 20 -r 4 -t 50 -d 0 -fr 30
mxc_v4l2_overlay.out -iw 640 -ih 480 -it 0 -il 0 -ow 160 -oh 160 -ot 20 -ol 20 -r 4 -t 50 -do 0 -fr 30

Direct preview (90 degree rotation) the camera to the background, and set frame rate to 30 fps.

Expand Down
34 changes: 17 additions & 17 deletions test/mxc_v4l2_test/doc/FSL-UT-V4L2-008.txt
Expand Up @@ -21,47 +21,47 @@ N/A
ov5640 sensor and MIPI extention board are requried display screen also is needed

| Test Procedure |
Check that /dev/video0 exists. If it does not exist, load the camera driver with the command:
Check that /dev/video1 exists. If it does not exist, load the camera driver with the command:

modprobe mxc_v4l2_capture

modprobe CAMERA_MODULE (CAMERA_MODULE should be replaced by the camera module on the related platform, e.g. ov5640_camera_mipi should be used here on MX6Q?)
modprobe CAMERA_MODULE (CAMERA_MODULE should be replaced by the camera module on the related platform, e.g. ov5640_camera_mipi should be used here on MX6Q)

Check again for /dev/video0. If it is not there, the camera driver has not loaded successfully and the test has failed.
Check again for /dev/video1. If it is not there, the camera driver has not loaded successfully and the test has failed.

Type commands to direct preview the camera to the foreground/background, and set the frame rate to 30 fps, the preview size is 640 X 480 with a starting offset of (0,0). Use mxc_v4l2_overlay.out -help to see usage.

Test foreground display:

Test 1. mxc_v4l2_overlay.out -iw 640 -ih 480 -ow 640 -oh 480 -m 0 -fg
Test 1. mxc_v4l2_overlay.out -iw 640 -ih 480 -ow 640 -oh 480 -m 0 -di /dev/video1 -fg

Test 2. mxc_v4l2_overlay.out -iw 320 -ih 240 -ow 640 -oh 480 -m 1 -fg
Test 2. mxc_v4l2_overlay.out -iw 320 -ih 240 -ow 640 -oh 480 -m 1 -di /dev/video1 -fg

Test 3. mxc_v4l2_overlay.out -iw 720 -ih 480 -ow 640 -oh 480 -m 2 -fg
Test 3. mxc_v4l2_overlay.out -iw 720 -ih 480 -ow 640 -oh 480 -m 2 -di /dev/video1 -fg

Test 4. mxc_v4l2_overlay.out -iw 720 -ih 576 -ow 640 -oh 480 -m 3 -fg
Test 4. mxc_v4l2_overlay.out -iw 720 -ih 576 -ow 640 -oh 480 -m 3 -di /dev/video1 -fg

Test 5. mxc_v4l2_overlay.out -iw 1280 -ih 720 -ow 640 -oh 480 -m 4 -fg
Test 5. mxc_v4l2_overlay.out -iw 1280 -ih 720 -ow 640 -oh 480 -m 4 -di /dev/video1 -fg

Test 6. mxc_v4l2_overlay.out -iw 1920 -ih 1080 -ow 640 -oh 480 -m 5 -fg
Test 6. mxc_v4l2_overlay.out -iw 1920 -ih 1080 -ow 640 -oh 480 -m 5 -di /dev/video1 -fg

Test 7. mxc_v4l2_overlay.out -iw 2592 -ih 1944 -ow 640 -oh 480 -m 6 -fg
Test 7. mxc_v4l2_overlay.out -iw 2592 -ih 1944 -ow 640 -oh 480 -m 6 -di /dev/video1 -fg

Test background display:

Test 8. mxc_v4l2_overlay.out -iw 640 -ih 480 -ow 640 -oh 480 -m 0 -bg
Test 8. mxc_v4l2_overlay.out -iw 640 -ih 480 -ow 640 -oh 480 -m 0 -di /dev/video1 -bg

Test 9. mxc_v4l2_overlay.out -iw 320 -ih 240 -ow 640 -oh 480 -m 1 -bg
Test 9. mxc_v4l2_overlay.out -iw 320 -ih 240 -ow 640 -oh 480 -m 1 -di /dev/video1 -bg

Test 10. mxc_v4l2_overlay.out -iw 720 -ih 480 -ow 640 -oh 480 -m 2 -bg
Test 10. mxc_v4l2_overlay.out -iw 720 -ih 480 -ow 640 -oh 480 -m 2 -di /dev/video1 -bg

Test 11. mxc_v4l2_overlay.out -iw 720 -ih 576 -ow 640 -oh 480 -m 3 -bg
Test 11. mxc_v4l2_overlay.out -iw 720 -ih 576 -ow 640 -oh 480 -m 3 -di /dev/video1 -bg

Test 12. mxc_v4l2_overlay.out -iw 1280 -ih 720 -ow 640 -oh 480 -m 4 -bg
Test 12. mxc_v4l2_overlay.out -iw 1280 -ih 720 -ow 640 -oh 480 -m 4 -di /dev/video1 -bg

Test 13. mxc_v4l2_overlay.out -iw 1920 -ih 1080 -ow 640 -oh 480 -m 5 -bg
Test 13. mxc_v4l2_overlay.out -iw 1920 -ih 1080 -ow 640 -oh 480 -m 5 -di /dev/video1 -bg

Test 14. mxc_v4l2_overlay.out -iw 2592 -ih 1944 -ow 640 -oh 480 -m 6 -bg
Test 14. mxc_v4l2_overlay.out -iw 2592 -ih 1944 -ow 640 -oh 480 -m 6 -di /dev/video1 -bg

| Expected Result |
The image from the camera is displayed on the screen. Colors and image should be correct.
Expand Down
8 changes: 6 additions & 2 deletions test/mxc_v4l2_test/mxc_v4l2_overlay.c
Expand Up @@ -523,9 +523,12 @@ int process_cmdline(int argc, char **argv)
else if (strcmp(argv[i], "-t") == 0) {
g_timeout = atoi(argv[++i]);
}
else if (strcmp(argv[i], "-d") == 0) {
else if (strcmp(argv[i], "-do") == 0) {
g_display_lcd = atoi(argv[++i]);
}
else if (strcmp(argv[i], "-di") == 0) {
strcpy(v4l_device, argv[++i]);
}
else if (strcmp(argv[i], "-fg") == 0) {
g_overlay = 1;
}
Expand All @@ -548,7 +551,8 @@ int process_cmdline(int argc, char **argv)
" -ow <display width>\n -oh <display height>\n" \
" -ot <display top>\n -ol <display left>\n" \
" -r <rotate mode>\n -t <timeout>\n" \
" -d <output display> \n" \
" -do <output display> \n" \
" -di <camera select, /dev/video0, /dev/video1> \n" \
" -v <camera color> 1-brightness 2-saturation"
" 3-red 4-blue 5-black balance\n"\
" -m <capture mode> 0-low resolution 1-high resolution\n" \
Expand Down

0 comments on commit 6baa2ab

Please sign in to comment.