Commit graph

31 commits

Author SHA1 Message Date
Ari Hausman-Cohen
bb99e02dcc Add helper functions to update metadata.
Templated to fit various types of metadata.

BUG: 30140438
Change-Id: I9c22be63eacbaddf465cf3b98d6fb7ea95abeabf
TEST: unit tests pass
2016-08-04 18:27:05 -07:00
Ari Hausman-Cohen
99f3ea02d0 Change v4l2_wrapper set control to accept null.
User does not need to pass a result pointer if they
don't care about the result.

BUG: 30140438

Change-Id: Ia98870f24df82464a3f00aad63a599063b98f03a
2016-08-04 15:33:50 -07:00
Ari Hausman-Cohen
b1af4ff795 Have Metadata use android::CameraMetadata.
Ownership is much more clear than with the various double
raw metadata pointers.

BUG: 30140438
TEST: unit tests pass

Change-Id: Ib0de3bb4b9e6dc30594230e46f40ffaea06df51d
2016-08-04 15:33:33 -07:00
Ari Hausman-Cohen
10481a3ec9 Separated v4l2_metadata into two pieces.
v4l2_metadata and metadata/metadata. The previous design did not work
as intended for testing (it incorrectly assumed that a constructor
would call an overridden method of a child class), plus this way
makes more sense.

BUG: 30140438
Change-Id: I1293535932fed6daed766682421b1215739e17dd
TEST: Unit tests pass
2016-08-02 11:15:50 -07:00
Ari Hausman-Cohen
b41aade35e Move array_vector.
Once refactor is complete, it will only be used by metadata.

Change-Id: Ie1e203f558f2f9a12c3be949d98454341648ee9d
2016-08-02 11:15:39 -07:00
Ari Hausman-Cohen
d318ed9b30 Changes some partial metadata methods to const.
Methods that should have been marked const were not.

BUG: 30140438
Change-Id: If73e1249dcf328fdde2d3b64d0bc2c200da45e8f
TEST: Unit tests pass
2016-08-02 11:15:30 -07:00
Ari Hausman-Cohen
cd9fef66f9 Add metadata helper class.
Breaks metadata down into distinct pieces (to be added later).

BUG: 29330282
TEST: unit tests pass

Change-Id: I7156e420e7cdb14b5c3155006ecefd8ff2a49500
2016-07-28 18:33:11 -07:00
Ari Hausman-Cohen
3841a7f495 Style fix: renaming and include guards.
Fixes file name style and include guard style, before
even more and more files get added.

BUG: 30224839
Change-Id: Ie5ebcf14672c7e9d3faae86b88d4f62b516ae00d
TEST: test program that takes a picture still works.
2016-07-25 11:00:34 -07:00
Ari Hausman-Cohen
660f8b858d Replace V4L2 calls in V4L2Camera with wrapper.
Also updates naming of max streams to be in line with what they
technically are, not what they usually are (i.e. a non-stalling
processed stream is usually YUV, but not necessarily).

BUG: 30140438

Change-Id: Idb78c466a41c9c0e5957200fc7c8afc0cfdb88a6
2016-07-25 10:59:59 -07:00
Ari Hausman-Cohen
4ab4962420 Add buffer management to V4L2 wrapper.
Functions to enqueue and dequeue buffers.
Extended gralloc helper with a mass-unlock function.

Change-Id: I72c83138fd37463d314bf02b5df5befc68bc05af
2016-07-25 10:58:29 -07:00
Ari Hausman-Cohen
681eaa283f Refactor camera initialization support of gralloc.
Switch to a factory model so that initialization can
fail when the gralloc module can't be found or isn't supported.

BUG: 30140438
Change-Id: I6e0a62a207797aef96c532cff7632c1a4da8818f
2016-07-25 10:52:10 -07:00
Ari Hausman-Cohen
24e541c925 Revert "Revert "Paint buffers, basic result metadata.""
This reverts commit a147f83c8c58f078fad95f99a19ac4441bcb5914.
Was reverted originally due to an issue in a parent CL. Now
that has been fixed, and this CL can be reinstated.

Change-Id: Ie281b6cc80705d8843572f21edde2398c892e35b
2016-07-21 13:24:14 -07:00
Ari Hausman-Cohen
3eece6ffdc Add helper class for dealing with gralloc.
This reverts commit a485a7e60db95039df5de82119e47878372550ac
(which reverts the original version of this CL).

Fixed build errors - put reinterpret_cast around delete [] in
V4L2Gralloc destructor, and fixed missing parens around another
reinterpret cast.

BUG: 29335262
Change-Id: Iaa5a71afef8850ba499cb1a7159a831da4f7014a
2016-07-21 11:17:52 -07:00
Ari Hausman-Cohen
c17fd09be8 Abstract V4L2 controls into wrapper class.
This abstraction will both clean up the code in V4L2Camera.cpp, and make it
easier to implement tests in the future (by mocking over the class).

This CL only adds the class and implementation, it does not yet replace
the logic in V4L2Camera.cpp.

Also gates building the module, to prevent checkbuilds without the
proper v4l2 kernel headers from trying to build it.

BUG: 30140438
Change-Id: I4e5feee30fdf896b1f71f0df492ca313f5581e78
2016-07-20 15:48:51 -07:00
Ari Hausman-Cohen
ec6879f9fe Revert "Add helper class for dealing with gralloc."
This reverts commit 782a526fdfa19a71d0712c57018a010f2ccd6b48.

Change-Id: I08fdb731c9c678d1ea53350e978cdccd9fa3014c
2016-07-20 10:45:39 -07:00
Ari Hausman-Cohen
edff6effb5 Merge "Revert "Paint buffers, basic result metadata."" into nyc-jaqen-dev 2016-07-20 17:37:41 +00:00
Ari Hausman-Cohen
2934eb9643 Revert "Paint buffers, basic result metadata."
This reverts commit fc7834455f41a523a7be806ec66ff659fb622d00.

Change-Id: Idac705944f7ea3f52053ebd0bbe4d0256be36e0c
2016-07-20 17:25:39 +00:00
Ari Hausman-Cohen
7951728f9e Revert "Abstract V4L2 controls into wrapper class."
This reverts commit 00debb6c12c7d7cb70307c4d48ea92a298e44852.

Shamu checkbuild fails because it doesn't have extended query control in the header.

Change-Id: I004ebb70f617cb5f440c7dc076ebbce81fec2136
2016-07-19 17:30:35 -07:00
Ari Hausman-Cohen
784c84927f Paint buffers, basic result metadata.
* Puts in the basics for enqueuing and dequeing buffers from
V4L2.
*Also adds very basic result metadata (spoofed timestamp)
so that the image is returned cleanly.

BUG: 29335262
TEST: A sample Java program is able to take a 640x480 picture, both
JPEG and and YUV (requires ag/1217869).

Change-Id: I853dcc2b5430ea2822006269f57bdf44c1eaa11a
2016-07-19 16:24:32 -07:00
Ari Hausman-Cohen
f6e178dca8 Add helper class for dealing with gralloc.
The helper class deals with choosing the correct locking/unlocking,
and conversion to correct yuv buffer format.

BUG: 29335262
TEST: With some follow up CLs to implement data capture, manually
tested by adjusting gralloc implementation:
  * Jpeg
  * YUV
    * Packed planar
    * Packed semiplanar
    * cstep 4 semiplanar
    * packed planar with extra y padding
    * packed planar with extra y & c padding
    * packed semiplanar with extra y & c padding
Did not test gralloc with less padding than camera, as the test
camera being used has 0 padding to begin with.

Change-Id: Icc5e9b8955cf6e983072b269fd60aefbfd79f883
2016-07-19 16:24:32 -07:00
Ari Hausman-Cohen
44d8432512 Correctly track current device format.
Cleans up issues with the format tracking variables
never being set or cleared.

BUG: 30065589

Change-Id: I98fc94863cc94fc5d4fb003035a8a7b7247d48ec
2016-07-19 16:24:03 -07:00
Ari Hausman-Cohen
38a28a1a6e Abstract V4L2 controls into wrapper class.
This abstraction will both clean up the code in V4L2Camera.cpp, and make it
easier to implement tests in the future (by mocking over the class).

This CL only adds the class and implementation, it does not yet replace
the logic in V4L2Camera.cpp.

BUG: 30140438
Change-Id: I2ebf2e615eedaed6294ddb52d3b3c4c1bd0a0460
2016-07-19 15:00:13 -07:00
Ari Hausman-Cohen
72fddb3db4 Configure streams.
Set up the camera HAL according to the request streams.
Upgrades this flow from the 3.0 to 3.4 version, where
streams are not registered with buffers, and have a few
additional fields.

BUG: http://b/29921457, http://b/29221641
Change-Id: I36f67da374e6919caad6f202f31b72b0de2bb3bf
2016-07-07 11:09:02 -07:00
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
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
Bill Rassieur
32adb7ae44 Initial empty repository 2015-06-10 07:31:14 -07:00