Commit graph

207 commits

Author SHA1 Message Date
Ari Hausman-Cohen
dde8017a33 Removes metadata update macros.
Repaces them with just doing the error check,
and a loop for available characteristic keys.

BUG: 29872714
Change-Id: Idc48c5c51ef081dc4a2d380e2d23ee17347e3115
2016-07-06 12:04:17 -07:00
Ari Hausman-Cohen
4992584376 Initialize capture templates.
As part of this, refactored characteristic initialization into its own
function so it can be used by both templates and static info.

BUG: 29221795

Change-Id: I88bb2e6a96256e3641c7c5d387769880b260535f
2016-07-01 12:36:03 -07:00
Chih-Hung Hsieh
928e679cf3 Fix google-explicit-constructor warnings in libhardware
Bug: 28341362
Change-Id: I29a56734e54740e4b15fe2f6cacbbd867163ae79
Test: build with clang-tidy
2016-06-30 14:21:20 -07:00
Ari Hausman-Cohen
900c1e3a0c Initial static info.
Fills in initial values for all required static info
fields for LIMITED devices. Currently fakes entries
that will eventually be queried from the device (open
bug https://b/29394024).

BUG: https://b/29214526, https://b/29221641
Change-Id: I6b4bfa172c882df22159da63378902cea7cc76fd
2016-06-22 15:58:07 -07:00
Ari Hausman-Cohen
345bd3a19b Open and close v4l2 devices.
BUG: 29191881
Change-Id: Id740ab30fd8f79b4a2cb99d1e5bef2be7472c992
2016-06-14 13:35:45 -07:00
Ari Hausman-Cohen
63f69824e4 Find V4L2 devices from /dev/video*.
Since V4L2CameraHAL now populates its list of cameras,
also added a necessary piece of metadata that was
causing cameraservice to crash.

BUG: 29160300
TEST: Ran on rpi3. HAL finds dev/video* nodes. When a
sym link (/dev/video5 -> /dev/video0) was added, the HAL
correctly did not add a 3rd device.

Change-Id: I95656ac9c062b193c12712b1c73e888bf1f1a961
2016-06-14 11:24:41 -07:00
Ari Hausman-Cohen
77db7d0259 Add default visibility to HAL_MODULE_INFO_SYM
HAL could not be found by the CameraService.

BUG: 29336732
Change-Id: Ic4e509269f7f4171a9a79ce7a319fdc355e06514
2016-06-14 10:53:53 -07:00
Ari Hausman-Cohen
734421538c V4L2 HALv3 initial check in
Decent outline of an initial HALv3. Still a lot to be filled in.
Adapted from the reference implementation in libhardware.

BUG: 29006356
TEST: Ran simple test program. Connects to the HAL and then
  fails because there are no cameras (expected behavior right now).

Change-Id: I11c7e00dca1bbb6ade6b5a0f55fedac3d2d01695
2016-06-13 14:41:24 -07:00
Chih-Hung Hsieh
4d52b43cb6 Fix misc-macro-parentheses warnings.
Bug: 28705665
Change-Id: Ie514abfe12bea065658da3706aad8b4c9c0a93c7
2016-05-12 10:07:30 -07:00
Jacopo Mondi
2ecebbf8ff Camera: Fix Metadata static info intialization
The Metadata module segfaults when asked to initialize camera_info, upon
camera description request coming from framework.
This was caused by missing intialization of mData instance field.
Additionally, when intializing it with a template metadata, the
validation function return value was wrongly tested

Patchset 2: Do not init mData but let function flow take care of
replacing it after adding new data to it fails.

Change-Id: Iae228f0d66171ed3eac430186ced4d9b023f8de8
Signed-off-by: Jacopo Mondi <jacopo.mondi@linaro.org>
2015-11-17 09:46:40 +01:00
Eino-Ville Talvala
aee4782839 Camera: Add HAL module init method.
For use by Camera HAL libraries to perform one-time initialization
steps after the library is loaded.

Bug: 20016050
Change-Id: Ia01ae0eafcadece9124ac2cfcc3b1c3939352843
2015-04-15 17:26:13 -07:00
Eino-Ville Talvala
e69efbbabf Replace/rename old HAL graphics formats
- Replace RAW_SENSOR with RAW16
 - Remove sRGB formats

Change-Id: Ic5c44878c638c3d3559495ea5685e10fcc2c39e1
2015-03-06 13:19:36 -08:00
Chien-Yu Chen
301591776f camera_common: add torch mode APIs for flashlight
Add torch mode APIs to support flashlight without opening any
camera devices.

Bug: 2682206
Change-Id: Ida46bb878962caf305f3e97051b15e0465fe8c02
2015-01-15 10:35:07 -08:00
Dan Albert
9a8c57a346 Fix C++11 build.
Not sure how this slipped past my checkbuild...

Change-Id: Id238887a2a47ced387a6128a772fad3e468096be
2014-11-27 21:39:46 -08:00
Zhijun He
5f36d1af13 Merge "hardware: camera_common: add module open legacy device API" 2014-06-10 21:32:31 +00:00
Zhijun He
bcdebf37fb hardware: camera_common: add module open legacy device API
This adds the module API to open a camera device as lower HAL version legacy
device.

Change-Id: I6616aebc5ec0cef28f675e5dddb334dc6b5dfea9
2014-06-13 11:44:19 -07:00
Elliott Hughes
0d1c2a49d6 Switch libhardware to POSIX dprintf.
Bug: 15022164
Change-Id: Ie4c93318c2e7a947a57e16b220a6abceec59e6aa
2014-05-22 11:12:12 -07:00
Sasha Levitskiy
a82f456c38 Camera: HAL: 64-bit warning fixit.
Change-Id: Iecc3e1846fbf63c51952d115e1f167cf32135b18
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2014-04-23 11:54:24 -07:00
Ruben Brunk
80df5b529f camera3: Update maxRegions tag.
Change-Id: I22501cbf7f941d9626b88182e2dda8a13a620d01
2014-02-03 17:40:43 -08:00
Colin Cross
0ab48411fe am 8ded7780: am 3da0d0f4: am 662e97ee: am aea8c156: Merge "hardware/libhardware: convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH"
* commit '8ded7780c6658d6db011f642206726234098388f':
  hardware/libhardware: convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH
2014-01-28 01:08:45 +00:00
Colin Cross
3557abaae2 hardware/libhardware: convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH
LOCAL_MODULE_PATH doesn't work for multiarch builds, replace it
with LOCAL_MODULE_RELATIVE_PATH.

Change-Id: I4e4ceec61d026bbe74ba604554c06104bde42e5e
2014-01-24 21:00:32 -08:00
Ruben Brunk
b35bee2a90 Fix build. Missing vendor tags header. 2014-01-17 14:48:19 -08:00
Ruben Brunk
61cf9eb920 camera3: Update vendor tag spec for HAL 3.2.
- Deprecates vendor tag specification in camera3 device.
- Moves vendor tag ops declaration to camera metadata library and
  cleans up definitions.
- Updates the example HAL.

Change-Id: Ifb16bb0d4bbc896bc32d33dd150e7e174af57dad
2014-01-16 18:27:08 -08:00
Alex Ray
555676430e modules: camera: replace pthread mutex with utils'
Change-Id: Id974e4cc743d27d59634023cfdbba545fbb64e5f
2013-11-12 18:32:51 -08:00
Alex Ray
62735086ed modules: camera: Metadata refactor
Add* functions const to protect data being added.
Initiailze metadata object from a camera_metadata_t.
Remove template-specific constructor.
Add convenience "add1" method to abvoid stack-allocated data.
Construct templates manually (in ExampleCamera) from base.

Change-Id: I3201f61e9d32841ea7a769d69242b40d8727c02e
2013-10-28 14:40:28 -07:00
Alex Ray
69f1f9166a modules: camera: dump device and stream state
Change-Id: Iae3badba71f13784dfdd65d6e77b20283437935a
2013-10-21 12:21:08 -07:00
Alex Ray
7915e97d63 modules: camera: add vendor tag functionality
Vendor Tag operations were added in module api v2.2

Change-Id: I352a50759d8bb9389d904bb774659e4be883794b
2013-10-21 12:20:41 -07:00
Alex Ray
61f7a0c1c1 modules: camera: Abstract device-specific camera
ExampleCamera represents a specific (e.g. front or back) camera device,
and contains all the device and logic for that device/sensor.

Change-Id: Iecc1a1d905501a66edb6e3994ff93d8761b82f8b
2013-10-17 16:50:48 -07:00
Alex Ray
3e8a9fe5e0 modules: camera: Add android.jpeg.maxSize metadata
Change-Id: I0984b55df0adf8c60b07844003e97b5aac8ece3f
2013-10-14 15:58:02 -07:00
Alex Ray
ea80382be1 modules: camera: Update trace headers to libutils
Now that libutils is outside of frameworks, use that for c++-style
scoped tracing and remove the temporary shim header.

Change-Id: I913767aed8ff70abb9299e7a7b318b24a25e23c1
2013-10-14 15:56:43 -07:00
Alex Ray
0f82f5a73a modules: camera: Separate locking for static characteristics
Static camera characteristics can be queried on any device at any time.
Separate the locking for it from the rest of the device to eliminate any
contention between operations on the device and static characteristic
initialization.

Change-Id: I8076378699f274e70c6318e537df4758972de9db
2013-07-26 16:36:43 -07:00
Zhijun He
bd1468921e modules: camera: Fix build break due to metadata change
Change-Id: I085796569ea77336d32907ee2287ff7533b0c122
2013-07-18 17:59:30 -07:00
Alex Ray
9cd49c9c4e modules: camera: simplify metadata list traversal
keep traveling pointer local to the walking loop

Change-Id: I0038007d6e7a45e519b9b2162c674132477879cc
2013-07-09 12:59:42 -07:00
Alex Ray
764e442baf modules: camera: Shutter notify message support
The shutter callback timestamp should originate from the sensor itself,
since it knows exactly when the first line of the frame started
exposing.  However, as a fallback (or in the CPU-painting case) query
CLOCK_BOOTTIME instead.

Change-Id: Id57c05525e9c575d009b9deb96a69557fccac16b
2013-07-09 12:19:04 -07:00
Alex Ray
90c0af71f6 modules: camera: make Metadata a delete-able object
Metadata is currently only used for immutable persistent settings
(static camera characteristics, and the capture templates), but will be
used for dynamic metadata as well.  Make it deleteable so we can
create/destroy these at will.

Change-Id: I7372b07b904d5a6b55453093712e0bb2675918b5
2013-07-03 14:32:59 -07:00
Alex Ray
77ecfd76d7 modules: camera: only wait on valid acquire fence
Change-Id: I4f51e509d86722c18308f4f1312ca3379cffd795
2013-07-03 14:32:59 -07:00
Alex Ray
2b286dab84 modules: camera: Write back stream parameters
max_buffers and usage are read by the framework inside the struct used
to pass the stream configuration parameters;  scribble our new
calculated values whever they are updated internally.

Adds logging to stream creation method (reuse/new).

Change-Id: I04e12880820571900f2ae80c27100f8aedcf9d02
2013-07-03 18:01:54 +00:00
Alex Ray
768216ee2c modules: camera: Fix stream type characterization
Type is now enum, not mask.

Change-Id: I264da26a457957a7659154e507970e0303c76e25
2013-07-03 18:00:21 +00:00
Alex Ray
0d2a5220ba modules: camera: Dirty metadata objects on update
Change-Id: I4fbd4ad919b855168e3ff5424613271b1fa907af
2013-07-03 10:55:04 -07:00
Alex Ray
89a82661e0 modules: camera: default request templates
Change-Id: I0a4b389e1850c10e12a65b3c8a5670c78c6746f7
2013-07-02 15:47:50 -07:00
Alex Ray
c6bf2f291d modules: camera: fix compiler warnings
Change-Id: Id1aa624d377776a7e37b52978664d30c927595be
2013-06-28 21:07:42 +00:00
Alex Ray
b0be1039c1 modules: camera: add get_camera_info support
Basic static metadata statically constructed from preprocessor passes
over an array of camera metadata tags.

Change-Id: I16ea9f4d68120d5a0bc010a4a67b0cbcd761329e
2013-06-28 13:52:50 -07:00
Alex Ray
083315c85b modules: camera: No-op result submission with request
Change-Id: If4e377ba0ac327cc02ac2b9765ce5d406b8960a8
2013-05-29 03:39:00 +00:00
Alex Ray
11bbeefaf9 modules: camera: Input buffer reprocessing scaffolding
Change-Id: I158ba833549aee47ca3be5673f6f5d33e455ef59
2013-05-29 03:38:20 +00:00
Alex Ray
bfcbd95a1f modules: camera: memoize request settings metadata
Change-Id: I19c3a6a55a42e60f627702cd4a995664a0dfc4d2
2013-05-29 03:36:19 +00:00
Alex Ray
8a8f86bbe6 modules: camera: Add buffer registration scaffold
Change-Id: Ic1d20dd7f93a0ca3cd2c3af3b33a7a9df47b5e89
2013-05-13 19:47:47 +00:00
Alex Ray
bcaf788434 modules: camera: Add Streams
Adds a Stream object, and configureStreams support in parsing the
provided stream_array. Streams are naively setup for sync-less software
painting.

Change-Id: Ibbd90e3e2c7fa984dd5d2dcbd4da7bf4dad43aa1
2013-05-03 12:16:18 -07:00
Alex Ray
c16e56dd43 modules: camera: Add scoped trace helper
This c++ helper class is normally provided by frameworks/native's
libutils, but cannot be used from the context of a hardware module.  For
now just add the required functionality locally in the hardware module.

Change-Id: I5b399cbeb1c017a95baf19456dbf20569e677fbe
2013-04-29 14:16:57 -07:00
Alex Ray
005c9da544 modules: camera: remove unused variable
Change-Id: Ic21cd58a750411167ef4b060e8d3abc295edc83d
2013-04-29 14:16:57 -07:00
Alex Ray
af3a4617b4 modules: camera: fix dump log message
Change-Id: I2511653b3d2d21d03785ea220c760e2b65f0b035
2013-04-29 14:16:27 -07:00
Alex Ray
1f8af678c9 modules: camera: make Camera object id const
Change-Id: Ic36fa7c6193086aa6415647ff8fe59cc358dd99f
2013-02-28 15:41:55 -08:00
Alex Ray
a0ed4bead4 modules: camera: Camera v3 Devices
Default camera HAL statically allocates camera devices. Update camera
device to API v3.

Change-Id: Ic53ffcf3b746b9b4011b932e26dbb0f533cba554
2013-02-27 00:02:37 -08:00
Alex Ray
819cfd87ba modules: camera: Update to v2.1 camera module API
Refactor the camera module into a single CameraHAL object.  Adds
set_callbacks, new in the v2.1 module API.

Change-Id: I4da677c28d7425f545f68998844fcfa4caf0feb9
2013-02-26 15:26:26 -08:00
Alex Ray
bb13a3231d modules: camera: Hide HAL symbols DO NOT MERGE
Explicitly hide all symbols from being exported from the camera HAL
except the symbol required to load the module.

Change-Id: I940b24b8d3895f46e63df3c28e43b8cb012bd637
2013-02-26 15:08:45 -08:00
Alex Ray
ed6b8a7710 modules: camera: Add tracing
Change-Id: I00ee447e6b57bc57fd09b6e7d8c62cb07cb37cf0
2013-01-03 21:06:27 -08:00
Alex Ray
a48dd3fb34 modules: camera: Defer documenting API
Avoid duplicating the api docs in the example HAL, instead point to
canonical source for them.

Change-Id: If3f5acb7a73260248bd00ce01cb1c80f230f7188
2013-01-03 21:06:17 -08:00
Alex Ray
7ee0b7aac2 Reference Camera v2 HAL Implementation
This is meant to be an example and a reference for device manufacturers
on how to build a new Camera v2 HAL.  This first patch has basic
configuration and entry/exit.

Change-Id: Ib4166e2eadb813228af38ec31a1215940c070bbf
2012-11-28 12:35:29 -08:00