-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathREADME
More file actions
76 lines (39 loc) · 1.78 KB
/
Copy pathREADME
File metadata and controls
76 lines (39 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Minimal working V4L2-based Android Camera HAL driver.
HAL version: 3.0
Module version: 2.3
Camera API version: 2
LIMITATIONS
-----------
* Supports only one camera
* Tested only on Tegra K1, using one specific camera and a webcam.
* No parameter control, most of the reported specs are hardcoded.
* Resolution detection is limited up to 1920x1080. See availableResolutions()
in V4l2Device.cpp.
WORKAROUNDS/BUILD TIME CONFIGURATION
------------------------------------
In Android.mk there are some flags which control how the driver works. Some
of them might not always work.
LOCAL_CFLAGS += -DV4L2DEVICE_FPS_LIMIT=<NNN>
<NNN> is positive integer. Limits framerate at the driver level. Helps when
the kernel's V4L2 driver allows to read the buffers faster than it fills them
with a new frames. Comment out to disable the limit.
LOCAL_CFLAGS += -DV4L2DEVICE_BUF_COUNT=<NNN>
<NNN> is a positive integer (4 by default) - V4L2 buffers count.
LOCAL_CFLAGS += -DV4L2DEVICE_PIXEL_FORMAT=V4L2_PIX_FMT_UYVY
#LOCAL_CFLAGS += -DV4L2DEVICE_PIXEL_FORMAT=V4L2_PIX_FMT_YUYV
V4L2 source color format.
LOCAL_CFLAGS += -DV4L2DEVICE_OPEN_ONCE
Opens and initializes /dev/video0 during boot time. Comment out to open/close
the device when a camera app is opened/closed.
LOCAL_CFLAGS += -DV4L2DEVICE_USE_POLL
Use poll() before dequeueing a buffer.
BOOT TIME CONFIGURATION
-----------------------
The "ro.camera.v4l2device.resolution" system property allows to force one single
resolution (must be supported by V4L2). The value is in the "WIDTHxHEIGHT" format.
HOW TO BUILD
------------
In your target's makefile (e.g. device/mycompany/mydevice/mydevice.mk) add:
PRODUCT_PACKAGES += camera.$(TARGET_BOARD_PLATFORM)
PRODUCT_PACKAGES += media_profiles.xml
and just build Android.