• Home
  • History
  • Annotate
  • only in /frameworks/av/services/camera/libcameraservice/device3/
History log of /frameworks/av/services/camera/libcameraservice/device3/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ff51b47dae1c236291a0508b29e8f4e7d0780761 29-Jun-2016 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Correctly shut down abandoned streams

If a stream was abandoned (consumer died), the stream teardown would
terminate early. Update teardown conditions to complete even for the
abandoned state.

One consequence of this is that the buffer manager never received an
unregister call for the stream, leading it to error out when trying to
remove buffers from it.

Also switch to STATE_ABANDONED in case of an error detaching a buffer,
instead of the error state.

Bug: 29778464
Change-Id: I44de69773e8bbf9ebe83207498d6ee0674ed91bf
amera3IOStreamBase.cpp
amera3OutputStream.cpp
77c1a3554275a51ac8eb9fbe86f476afc8983192 13-Jun-2016 Eino-Ville Talvala <etalvala@google.com> Camera: BufferManager: Don't attach/detach on every frame

- Maintain separate count of attached buffers
- Only attach when new buffers need to be allocated
- Only detach when a buffer needs to be freed
- Fix missing notification initializations
- Remove warning that's always logged

Bug: 28695173
Change-Id: I38e997fa1e69c2b8743e43eed31a6a08a6f9cd7a
amera3BufferManager.cpp
amera3BufferManager.h
amera3Device.cpp
amera3DummyStream.cpp
amera3DummyStream.h
amera3OutputStream.cpp
amera3OutputStream.h
amera3OutputStreamInterface.h
9b5860bd84adb5c7d497f188b5e6ade7f066ba3c 10-Jun-2016 Chien-Yu Chen <cychen@google.com> CameraDevice3: Fail stream configuration more gracefully

If stream configuration fails, do not set the device status to
STATUS_ERROR except when HAL returns a fatal error. This allows
the application to try another configuration after one fails.

Bug: 29248970
Change-Id: Iffa4b734c13b79a7da95be994a6317002627d771
amera3Device.cpp
amera3Device.h
c66969beb346b878701c4adccf83a1475c3a0687 20-May-2016 Chien-Yu Chen <cychen@google.com> Camera3Device: Prepare video stream for high speed

Prepare video stream for high speed recording on the first video
request to avoid buffer allocation after video recording starts.

Bug: 28246165
Change-Id: Iaf41c6b779e5b689f568453d99a9058c8aec3881
amera3Device.cpp
amera3Device.h
473fad9a5767e86ee9dbbffe0dfee10c7ad45a45 24-May-2016 Yin-Chia Yeh <yinchiayeh@google.com> Camera: fix deadlock

Do not hold request lock while executing client callback.

Bug: 28821274
Change-Id: Ibbdae7f892a54abd0b6d87d2295e9863983e1cf7
amera3Device.cpp
0f6778e333a0ee3750135e02c259f49382a6896a 26-Apr-2016 Eino-Ville Talvala <etalvala@google.com> Camera3: For HFR, make priority elevation request synchronous

Since we only do this once per session, it has trivial overhead,
and it's important that any permission denials are actually properly
detected.

Bug: 28246165
Change-Id: Id4c23db6e3b7ab5f7755b3f55ddd589cbdbde8af
amera3Device.cpp
e8c535e833ed135895e99ca81aa3b85d80d7cf3c 14-Apr-2016 Chien-Yu Chen <cychen@google.com> Camera: Stop repeating request if its output is abandoned

Stop repeating request if any of its output stream is abandoned.
Add a callback to notify the repeating request has been stopped
with frame number of the last frame.

Update NDK with the new callback and behavior.

Bug: 21270879

Change-Id: I3553775c7807a77104aa1650609480ca3321310c
amera3Device.cpp
amera3Device.h
amera3OutputStream.cpp
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
03aa02bda9bf1f38d8c6d9e6bfd8222ed18d3ff5 13-Apr-2016 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera: derive post RAW sensitivity keys for BC" into nyc-dev
4c060997514cb37aec9a9a7cec02a3f257d3a74d 12-Apr-2016 Yin-Chia Yeh <yinchiayeh@google.com> Camera: derive post RAW sensitivity keys for BC

Derive post RAW sensitivity keys for devices
earlier than HAL3.4.

Bug: 27950762
Change-Id: Icc2232cb722c61a5878a81706885303b15ddee3e
amera3Device.cpp
amera3Device.h
e02e932d2210bd513bb8283840bbe24b58d28620 12-Apr-2016 Chien-Yu Chen <cychen@google.com> Camera: Keep a list of outstanding buffers

Keep a list of outstanding buffers in Camera3Stream so that
it won't return invalid buffers or the same buffers twice back
to the buffer queue.

Bug: 27894484
Change-Id: I9f96629b4f531778433c2e1ec32a142f2040832b
amera3Stream.cpp
amera3Stream.h
05a8cf58ce8095752999e0efc7b2713cfeb5309e 28-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Camera: Camera3InputStream: Stop after finding buffer to return

Erasing iterator invalidates it, so it's not safe to continue using it.
Besides, there should only be one buffer to erase anyway.

Bug: 27878949
Change-Id: I00e9845fa953c26e117e40112b9f35fc781c5dcf
amera3InputStream.cpp
b0fdc1ed2182fe851ef7ca98a1b4a552b53b3033 21-Mar-2016 Shuzhen Wang <shuzhenwang@google.com> Camera: Retry JPEG capture if buffer is dropped.

Camera api1 doesn't have error notification if JPEG buffer is dropped.
Add retry logic to try again if such error happens.

Bug: 27074407
Change-Id: I646566c6ee5a064896b5a433d8e1797140f0d257
amera3Device.cpp
amera3Device.h
amera3Stream.cpp
amera3StreamBufferListener.h
2cbf6cea23539bfe99e36d1d221de62255452e86 14-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Camera: Update dataspace to new spec, convert for older HALs

- Switch clients of camera devices to use new dataspace values
- For older HALs, map to legacy dataspace values

Bug: 27344373
Change-Id: Icabc345025383f987ef4472cd26182a580dc8b3c
amera3Device.cpp
amera3Device.h
97a330964b0548238d75602c74b290bea77a6b55 11-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Merge "Camera3: Add error stream ID for buffer drop errors" into nyc-dev
37964cbbcf994350d989b482c201ee9571ea1b38 11-Mar-2016 Chien-Yu Chen <cychen@google.com> Merge "Camera3Device: Send partial results seperately" into nyc-dev
5cd8d64b36e0bc87115a5221b06e2fe3c5f9879b 08-Mar-2016 Chien-Yu Chen <cychen@google.com> Camera3Device: Send partial results seperately

Change Camera3Device to send partial results as soon as a
partial result is received from HAL so that 3A partial results
are not bundled.

Change FrameProcess to wait until all 3A states are received before
notify the client about 3A changes.

Bug: 17320166
Change-Id: I31a3e42081430ff4f7a482c4b2f1db272b8b2e4a
amera3Device.cpp
amera3Device.h
3c8aa2fded9e5c5daf8a3e6ac8acbe3d329d8e65 09-Mar-2016 Chien-Yu Chen <cychen@google.com> Merge "Camera3Device: Validate template ID" into nyc-dev
9cd140240c84789d00349c33e9c0b7a74d1543ed 09-Mar-2016 Chien-Yu Chen <cychen@google.com> Camera3Device: Validate template ID

Validate template ID before creating a default request.

Bug: 26866110
Change-Id: Ifda457024f1d5c2b1382f189c1a8d5fda852d30d
amera3Device.cpp
431503c11ca9e069584f70b0eef8b858a4a43546 08-Mar-2016 Zhijun He <zhijunhe@google.com> Camera3Device: fix dereferencing null pointer crash

It's possible that the dump is called during the device shutdown
process, where the buffer manager could be already torn down. Add
null check before calling the dump function.

Bug: 27500853
Change-Id: I179eb7ac1e81be2c196833b2c88488cd59fe2cc5
amera3Device.cpp
e95bb6312b972117a0ee70eabf78fcd118018f61 07-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Camera3: Add error stream ID for buffer drop errors

To enable passing buffer drop errors to API users

Bug: 24168122
Change-Id: I2769d0ba1fbd9a09494d5904eac511cecea3e6a8
amera3Device.cpp
02bf03287652923b5bb5316667b065423565d6b4 18-Feb-2016 Eino-Ville Talvala <etalvala@google.com> Camera: Clean up warnings and set -Werror

- Also fix error logging template inconsistency
- Also add a few error handling cases into camera2 NDK
to deal with previously-ignored error codes

Bug: 27149500
Change-Id: I8f1f4c72252dd48d652f24b595b642199f20c327
amera3Device.cpp
amera3DummyStream.cpp
amera3Stream.cpp
amera3Stream.h
d56db1d2bee182d1851097a9c712712fc094d117 18-Dec-2015 Eino-Ville Talvala <etalvala@google.com> Camera: Switch camera2 to auto-gen C++ binder interfaces

- Move camera service AIDL files to frameworks/av
- Build C++ interface stubs with AIDL tools
- Add necessary native-side parcelables and update existing ones
- Remove manually-written stubs, rearrange remaining manual stubs
- Adjust implementations to work with auto-generated stubs
- Adjust method signatures for auto-gen differences
- Add rich error messages using binder::Status

Bug: 25091611
Change-Id: I6f69f34b9d1a3f8d1fb7db87357363f8fa8483ff
amera3Device.cpp
amera3Device.h
bc57b12030cbd4885d9231e721bbfed1b6522212 16-Feb-2016 Aurimas Liutikas <aurimas@google.com> Fix compiler warnings in Camera3 service code.

- Removes unsed mDepth variable
- Fixes the type of count in getRawOpaqueBufferSize

Bug: 27149500
Change-Id: I7d5010cb513f9163c8bb6bf4ab427e54ee9d4963
amera3Device.cpp
amera3ZslStream.cpp
amera3ZslStream.h
c28dcccb9bc0a94950a7475f9bd8a6a38be34419 12-Feb-2016 Shuzhen Wang <shuzhenwang@google.com> Camera3: Use proper timestamp clock domain for different streams

If buffer consumers assume different clock domain compared to the camera
output, camera3 device uses the offset between the clock domains to convert
the timestamp.

Bug: 27153476
Change-Id: Iaae33281411cb27b639e87b0dad957d640182898
amera3Device.cpp
amera3Device.h
amera3OutputStream.cpp
amera3OutputStream.h
80fa61994c8bcc21e5150c1a6bf447f6423239c4 08-Feb-2016 Zhijun He <zhijunhe@google.com> Camera3: increase the buffer manager water mark by one

This reduces the chance of allocation during stream steady state.
It helps the cases where one stream is active, and other streams may
randomly request some buffers.

Change-Id: I3f29001a45e223dd2e7929452c4a2ac81a1213f2
amera3BufferManager.cpp
edd41ae47b99b98249e819ac72fb94264326a4eb 03-Feb-2016 Zhijun He <zhijunhe@google.com> Camera3: buffer manager doesn't support HAL3.2 devices

Not all HAL3.2 devices implemented dynamic buffer registeration.
This CL excludes the HAL3.2 devices from the buffer manager
supported devices.

Bug: 26955436
Change-Id: I5bc2eec0a4db2f5ab85f7677ed7b367c13ce67aa
amera3Device.cpp
amera3OutputStream.cpp
8d1a154cc6239096edda698ea638e6ab6fe53c4e 30-Jan-2016 Zhijun He <zhijunhe@google.com> Camera3: add dynamic buffer count water mark support

The dynamic buffer count water mark starts from zero, and grows when the max of
hand-out buffer counts grow, until reach to the max allowed total buffer count.
For the case where the clients almost always uses less number of buffers than
the max allowed total buffer count, the dynamic buffer count water mark will
remain low, and the memory footprint will be smaller.

Change-Id: I305f40232f4740d3e9bedf14ee9b76a81e29e244
amera3BufferManager.cpp
amera3BufferManager.h
1ff811b024c690e53510113d19042b7cd2d2637a 26-Jan-2016 Zhijun He <zhijunhe@google.com> Camera3: return cancelled buffers to buffer manager

When a buffer is cancelled, it is considered as a free buffer and need to be
returned to buffer manamager for buffer reuse. This will also make the prepare
work.

Also fix the buffer removal bug.

Bug: 25088440
Change-Id: I0e3da44c76008406ee19541366da7a962c355949
amera3BufferManager.cpp
amera3OutputStream.cpp
13a69633108f40f56aa47f1bcbb406cd5173c245 26-Jan-2016 Shuzhen Wang <shuzhenwang@google.com> Camera3: Selectively set buffer timestamp depends on consumer

Certain consumers such as Hardware Composer and AudioSource
use MONOTONIC timestamp, which causes time misalignment if
camera timestamp is in BOOTTIME.

Do not set buffer time stamp for such streams and let
BufferQueue handle it.

Bug: 22214409
Bug: 26762232
Change-Id: Id1c4b85a181e39827e8f27949a199165bbd445f9
amera3OutputStream.cpp
amera3OutputStream.h
125684aba1a11b7adbf5f9d607ee2bcc9449081c 27-Dec-2015 Zhijun He <zhijunhe@google.com> Camera3: add camera3 buffer manager support

* Add camera buffer manager for buffer allocation and sharing management across
multiple streams. Only gralloc v0 implementation is done, v1 implementation is
pending. With this, the max mem footprint for multiple streams in the same
stream set will be the max buffer count x max buffer size.
* API1 client will still use the old bufferQueue code path, buffer manager
is only targeting at API2 clients.
* Prepare and teardown should work with buffer manager.
* Some existing code typo fix and cleanup (to fix the compiling warnings).

Bug: 25088440
Change-Id: I68b246faa43080302acd02a8e976384bd3e26a23
amera3BufferManager.cpp
amera3BufferManager.h
amera3Device.cpp
amera3Device.h
amera3DummyStream.cpp
amera3IOStreamBase.cpp
amera3IOStreamBase.h
amera3InputStream.cpp
amera3OutputStream.cpp
amera3OutputStream.h
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
e9154ced1216ceb06a82140ed65051c0397e8abc 07-Dec-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: plumbing for RAW OPAQUE

Bug: 25596619
Change-Id: I0867a36962084bc508aebc89cb910473402a5e09
amera3Device.cpp
amera3Device.h
amera3IOStreamBase.cpp
amera3OutputStream.cpp
amera3Stream.cpp
d309fb9c8a2c4564d88fffba19c4e3688e4b862b 25-Nov-2015 Eino-Ville Talvala <etalvala@google.com> CameraService: Remove device HALv2 support, other cleanup

HALv2 only ever shipped with Nexus 10, and has been fully superceded by
HALv3. Remove it to allow for various code simplifications and cleanup.

- Remove Camera2Device
- Remove various special-case codepaths for supporting Camera2Device
- Remove CameraDeviceFactory, since it only creates Camera3Devices now
- Remove BurstCapture and associated CaptureSequence/Parameters code
- Remove old ZslProcessor and simplify ZslProcessor hierarchy to be
just ZslProcessor3, which is renamed to just ZslProcessor
- Add service-init-time check for unsupported device versions
- Fix assorted compiler warnings, some old, some new
- Remove references to HALv2 when possible

Bug: 25866588
Change-Id: Ia1063264d315f9b742ec5cdd0483539310894f5e
amera3Device.cpp
7e7a62dc6c20b5ff761b87d99379797aa3fd7d9d 04-Nov-2015 Eino-Ville Talvala <etalvala@google.com> CameraService: Add option to dump templates to HALv3 devices

Add -t to dumpsys media.camera to dump the request templates of any open
HALv3 camera devices.

Change-Id: Ib2746d5ca4a25e7f8eab842e6a99daa03f15acb8
amera3Device.cpp
4a8f4a3f567d8b3134b1c7ab21ca774f279ab9c2 02-Oct-2015 Chien-Yu Chen <cychen@google.com> Camera3Device: Change HFR request thread priority to 1

Based on periods of the request thread and audio threads with
SCHED_FIFO policy, 1 is a more reasonable priority for HFR
request thread.

Bug: 24427480
Change-Id: I91f0066a0e114fc83abcc6a604ecbaa72c6a34e8
amera3Device.h
3df11ce7240d0ce5d957c626be467832c1c7fde9 30-Sep-2015 Chien-Yu Chen <cychen@google.com> Camera3Device: Bookkeeping reprocess shutters separately

Bookkeeping reprocess shutters separately so regular and reprocess
shutters together don't need to come in order.

Bug: 24497512
Change-Id: I4aaf22045131e9e2e26bf163f7df9ff4c5cd6259
amera3Device.cpp
amera3Device.h
f99498ee4de7123e2fd71778c6877be44fbd1506 26-Sep-2015 Eino-Ville Talvala <etalvala@google.com> CameraService: Use SCHED_FIFO for request queue thread in HFR

- Move SchedulingPolicyService from audioservice to mediautils

- When starting up a high speed stream config, set request queue thread
to SCHED_FIFO using SchedulingPolicyService

Bug: 24227252
Change-Id: I224b59142bd111caf563779f55cddd62385b9bac
amera3Device.cpp
amera3Device.h
b83c1fe4e793da269b9340c64f7032a9cc27809c 11-Sep-2015 Chien-Yu Chen <cychen@google.com> Camera3Device: Signal buffer returned after it failed

Signal buffer returned even after it failed so the thread waiting
for it can wake up sooner.

Bug: 23981045
Change-Id: Iccbcc7ece2e0f6204da9c54f2bdd96ff6843a8f5
amera3Stream.cpp
57ea29251d93c9423030de387573142064366a30 04-Sep-2015 Chien-Yu Chen <cychen@google.com> Camera3Device: Clean up next request batch variable

Make the Vector of next requests a RequestThread member variable
to avoid memory allocation in every threadloop.

Bug: 23360060
Change-Id: I4f33e5c49f0f4deb1f9f45bada0909da748849e4
amera3Device.cpp
amera3Device.h
85a6455f269d79adf9bf48d757a4b1b3c81cf760 29-Aug-2015 Chien-Yu Chen <cychen@google.com> Camera3Device: Support batch requests

Refactor request threadLoop to three parts: waiting for next
batch of requests, preparing HAL requests and output buffers for
next batch of requests, and submitting the batch of requests to
HAL.

Set the batch size to the size of the request list if it's a video
recording request in a high speed video configuration.

Add a flush lock so that HAL's flush() won't be called while
submitting a batch of requests.

Bug: 23360060
Change-Id: Icd395b1f955a9b336eec6fa5aff6b17741ce08c7
amera3Device.cpp
amera3Device.h
amera3DummyStream.cpp
amera3DummyStream.h
amera3OutputStream.cpp
amera3OutputStream.h
amera3OutputStreamInterface.h
amera3Stream.cpp
efff1c4ba2bf195d97de2fd5718b708e4b942901 29-Aug-2015 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Don't hold mutex during HAL device close.

The HAL device shutdown will likely need to wait on various events and
queues to drain, and holding the mutex will prevent, for example, error
notifications from being processed. This can lead to deadlocks.

Bug: 23501571
Change-Id: I873ac23ef30545adf533e7839445448573ab5048
amera3Device.cpp
5d1103e5a229401a4c4e0cb7dd91b2742881ff92 17-Aug-2015 Ruben Brunk <rubenbrunk@google.com> Merge "Add experimental camera session prepare API." into mnc-dr-dev
c78ac26e3a65328fc0118f16ee76a800d0687eb7 14-Aug-2015 Ruben Brunk <rubenbrunk@google.com> Add experimental camera session prepare API.

Bug: 18949148
Change-Id: I8f73e68ea2e3acc60d98954106f364d13f439a82
amera3Device.cpp
amera3Device.h
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
3ba0c6ec009aa675d3433cd6c12af173874787bd 14-Aug-2015 Ruben Brunk <rubenbrunk@google.com> Merge "Fix deadlock conditions in Camera3Device." into mnc-dev
5732386666aa2265d658e9fc861a1dfe22033861 13-Aug-2015 Chien-Yu Chen <cychen@google.com> Merge "Camera3Device: Relax InFlightMap size check" into mnc-dev
c96ac8dfcae66a45b7ae67b82dabdf19f60f859d 13-Aug-2015 Chien-Yu Chen <cychen@google.com> Camera3Device: Relax InFlightMap size check

Relax InFlightMap size check for high speed configurations to
allow more pending capture requests.

Bug: 23162274
Change-Id: I955fe9a0754f0daed001f4a2b34ccb50f2465a11
amera3Device.cpp
amera3Device.h
183f056393423b344e73f388f21d30379a38e519 12-Aug-2015 Ruben Brunk <rubenbrunk@google.com> Fix deadlock conditions in Camera3Device.

Potential deadlock conditions this addresses, include:
- Not waking up waiting threads for several situations where
the status had been updated.
- Not waking up all waiting thread when status had been updated
(only one thread was awoken due to use of signal).
- Threads clear status transitions before other waiting threads
have a chance to examine them.

Bug: 22448586
Change-Id: I53ba669d333a83d2bfa1ca3170d34acc6d8fe6e3
amera3Device.cpp
amera3Device.h
95a1d0f2fb1ea85c549ef8b869ab9ab52601d1db 12-Aug-2015 Eino-Ville Talvala <etalvala@google.com> Camera: Allocate correctly-sized buffers for DEPTH_POINT_CLOUD

Bug: 20537722
Change-Id: I9fa2fcdcfd41cd3370732c70414914993d3dc94e
amera3Device.cpp
amera3Device.h
b25e3c87724b6147ed1da7c1d6617c39bfce2fbf 16-Jul-2015 Eino-Ville Talvala <etalvala@google.com> Camera: Add hidden experimental tearDown method.

Bug: 18949148
Change-Id: Ie86ec7d1ec3db54e1154563b2339a208a935f849
amera3Device.cpp
amera3Device.h
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
ab5135b254c6f9aaac8edb816596f8823dbdb3d5 30-Jun-2015 Chien-Yu Chen <cychen@google.com> Camera3-Device: Fix AE lock available

Pass whether AE lock is available when creating the request thread
because when the request thread was created, its parent's info
was not set yet.

Bug: 20494782
Change-Id: I11ed3f99c473955c437e81f3e1d704c15a9ca1a4
amera3Device.cpp
amera3Device.h
ed8505836c0b2fba0ab4be0c1eff31d4f241bc1d 25-Jun-2015 Chien-Yu Chen <cychen@google.com> Merge "Camera3: Support AE precapture trigger CANCEL" into mnc-dev
d196d6165aa1ac0dd7c0ad6cc5ada3a2f8e4b49d 23-Jun-2015 Chien-Yu Chen <cychen@google.com> Camera3: Support AE precapture trigger CANCEL

Support AE precapture trigger CANCEL for devices <= API
version 3.2.

Bug: 20494782
Change-Id: I6003ba8057ca4ec9e8dfda47b8411ae6be913d22
amera3Device.cpp
amera3Device.h
17338fca4a51dfb32c1291f94b65d4b4f30b682d 19-Jun-2015 Chien-Yu Chen <cychen@google.com> Camera3Device: Fix high speed configuration

If high speed mode changed, HAL needs to reconfigure the streams
even when the stream configurations don't change.

Bug: 21900311
Change-Id: I76aee456b3b6d8c8f599a1638dcd38d75553a235
amera3Device.cpp
727d172137b4f32681c098de8e2623c0b65a6406 09-Jun-2015 Eino-Ville Talvala <etalvala@google.com> CameraService: Add consumer name to output stream dumpsys

Also switch use of ANativeWindow to Surface, to get to the
getConsumerName() method where necessary.

Surface can always be cast to ANativeWindow, but not the other way
around, so it's a better option anyway.

Change-Id: Ie5c2d30821c1a754f9e382699ff50b4b328288b3
amera3Device.cpp
amera3Device.h
amera3OutputStream.cpp
amera3OutputStream.h
amera3ZslStream.cpp
9a17941fa70e43119d2c3464bc00a3cd30b2bd14 09-Jun-2015 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Default-initialize operating mode.

Since configureStreams is only called by CameraDeviceClient,
the operation mode could default-initialize to CONSTRAINED_HIGH_SPEED
for API1 operation.

Change-Id: Ide71af07ca3925db8e450d00def1daeb44d8046a
amera3Device.cpp
d46a6b9fd8b2a4f9098757384711e2cd03a91651 15-May-2015 Eino-Ville Talvala <etalvala@google.com> Camera1 API: Support SW encoders for new camera HALs

- Support new set video format/dataspace command in camera service
- HALv3: Select gralloc usage flags based on format
- HALv1: Pass format command directly to HAL layer
- Use format/dataspace command in CameraSource
- Switch all API1 recording to use metadata mode
- Switch all >= HALv2 API1 recording to use kMetadataBufferTypeANWBuffer

Bug: 13222807
Change-Id: I2e609b92c65792611bb1dab09e0c41c363ebbc42
amera3Device.cpp
amera3Device.h
amera3StreamInterface.h
1fa8999c91d5df81949aa723000058380cd3faa2 02-Jun-2015 Zhijun He <zhijunhe@google.com> Camera2: implement high speed video APIs

Bug: 21442271
Change-Id: Ia0ae5bbd3e8c81bad293c29987301a2457817d12
amera3Device.cpp
amera3Device.h
c2adf48e2dfae0b2b5ddd9de9e7d79ca471bfd37 27-May-2015 Chien-Yu Chen <cychen@google.com> Camera3: fix aborting reprocess requests

Get an input buffer right after camera service takes one
reprocess capture request from the request queue to prevent
the input buffers getting out of order.

When aborting pending reprocess requests in the request queue, also
abort the same amount of input buffers.

Bug: 21028914
Change-Id: I7cfacecb4c24509f59c983abd587db5a403237bd
amera3Device.cpp
amera3Device.h
0ec23d3f89d804cc1d9dea8f0585dc6d57bfd5c2 29-May-2015 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Do not call cleanUpFailedRequest with mutex held

Double-acquiring a non-recursive mutex tends to work poorly.

Bug: 21498811
Change-Id: I1d59959fca69c97684522195808019797f7a6a7d
amera3Device.cpp
e74c228e83906e0e317c4eb6eac20815ff839c04 27-May-2015 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Close hole in prepare in-use stream check

There's a narrow window in which a capture request is neither in the
request queue or handed off to the HAL, which can be expanded to some
size if buffers have to be allocated. During this window, the
prepare() method will not correctly notice that a stream should be
considered in use.

Add a member to contain the current request being processed, and check
against it in prepare as well.

Change-Id: I3a198d617f5feee0a3332af4b4439f24eda28ea3
amera3Device.cpp
amera3Device.h
261394e3edbe10f4f145f543187dcfbabf702c11 13-May-2015 Eino-Ville Talvala <etalvala@google.com> Camera: Cleanup to prepare() implementation

- Mutexes _might_ be a good idea
- Don't be surprised by behavior that's expected
- Use the existing logging macros

Bug: 20537148
Change-Id: Ie62985a786d7e6645b4e4fe019dd98b02891a1f7
amera3Device.cpp
ed0412ed78321bf9d35537626e33115862f7c805 28-Apr-2015 Chien-Yu Chen <cychen@google.com> Camera2: allow mixing regular/reprocess requests

Allow mixing regular and reprocess requests in a capture burst. Also
call abandon() when deleting an input stream.

Bug: 20537735
Change-Id: If8c7781038173ab21c73f5ddc32f53793cf86fd9
amera3InputStream.cpp
09f02e55ec4227a29662e7f6ab07fe7d09d9eba0 16-Apr-2015 Chien-Yu Chen <cychen@google.com> Merge "Camera3: allow reconfiguring the input stream"
90746f4203989fceb0f2131163435644040218d3 15-Apr-2015 Chien-Yu Chen <cychen@google.com> Camera3: allow reconfiguring the input stream

Change-Id: Ia9d0db1f3378264fc9173bfc8706c8f955b79182
amera3Stream.cpp
5e1c007038df74b389018e762d5059cacecff59e 15-Apr-2015 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera: allow non-supported template"
4d44cad22ea925a651463f2d51d6586c14d4b787 11-Apr-2015 Eino-Ville Talvala <etalvala@google.com> Camera2: Add prepare for output streams

The prepare call asynchronously pre-allocates buffers for a given
output stream, and then fires the onPrepared callback.

Not implemented for Camera2Device or used in Camera2Client.

Change-Id: I1cccdfff846dd6985133c591dbdceed823929ade
amera3Device.cpp
amera3Device.h
amera3DummyStream.cpp
amera3DummyStream.h
amera3IOStreamBase.cpp
amera3IOStreamBase.h
amera3InputStream.cpp
amera3InputStream.h
amera3OutputStream.cpp
amera3OutputStream.h
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
0336d3649f13506a7daf425690d225beac9d214f 14-Apr-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: allow non-supported template

Bug: 19395059
Change-Id: I42bbd99fef6055173062266c1a490311105c6814
amera3Device.cpp
618ff8a48a0c895a78f91f5692510c2a809425c3 13-Mar-2015 Chien-Yu Chen <cychen@google.com> camera2: add reprocess support

Add support to create input stream, submit reprocess capture requests,
and receive reprocess capture results.

Change-Id: Iee2d4313f3d52616a484eaea7a28f5ef9d8a674b
amera3Device.cpp
amera3Device.h
amera3InputStream.cpp
amera3InputStream.h
amera3OutputStream.cpp
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
4c9736fbc82b8b76c996c966583d71ca1df17ca6 06-Mar-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: fix release fence logic

According to spec, HAL will set release_fence to acquire_fence
when error happened (usually during flush call). Camera service
should not refer to the acquireFence anyhow since per spec HAL
needs to set it to -1 if acquireFence has been waited on.

Change-Id: I809355d0c8c71f78f657e37d19221fd1f5bdc90b
amera3OutputStream.cpp
ae21e335e392125168601dba4731c85b5c25f33f 19-Mar-2015 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera: plumbing rotation field through"
b97babb8c08969b55af3b6456d15f764c8873d3f 12-Mar-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: plumbing rotation field through

Change-Id: I0f4343a0bfa7bf09ba887c78a1da1c08daa35333
amera3Device.cpp
amera3Device.h
amera3DummyStream.cpp
amera3DummyStream.h
amera3IOStreamBase.cpp
amera3IOStreamBase.h
amera3InputStream.cpp
amera3OutputStream.cpp
amera3OutputStream.h
amera3Stream.cpp
amera3Stream.h
amera3ZslStream.cpp
549e735c2ca22d16eea32fda418ba80da32a8558 12-Mar-2015 Dan Stoza <stoza@google.com> libcameraservice: Stop using IGBC::BufferItem

Switches all uses of IGraphicBufferConsumer::BufferItem (and
BufferQueue::BufferItem) to the BufferItem in libgui. Depends on
frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9.

Change-Id: I187b3a7d05196b6289596afac8fb9a9d4aebff76
amera3InputStream.cpp
amera3InputStream.h
3d82c0d9ed2b3e956ad699a9ca2c8a70c9d24678 24-Feb-2015 Eino-Ville Talvala <etalvala@google.com> Camera: Wire up dataSpace, clean up ICameraDeviceUser

- Remove unused arguments from ICameraDeviceUser::createStream
- Add dataSpace as a stream parameter, plumb it through everything

Change-Id: I608cafe694785d1c512276e71b2016f8ac3b0ccb
amera3Device.cpp
amera3Device.h
amera3DummyStream.cpp
amera3DummyStream.h
amera3IOStreamBase.cpp
amera3IOStreamBase.h
amera3InputStream.cpp
amera3OutputStream.cpp
amera3OutputStream.h
amera3Stream.cpp
amera3Stream.h
amera3ZslStream.cpp
d231fd61ca94441183abda9766ce6906a5b4c3cf 26-Feb-2015 Chien-Yu Chen <cychen@google.com> camera: implement flashlight for HAL v1 devices

Implement flashlight for HAL v1 devices and remove
CameraHardwareInterface's dependency on CameraService to avoid
circular dependency.

Bug: 2682206
Change-Id: Id5bbccef085b607a6189763fd7fbe2e3f26868c8
amera3Device.cpp
e074a93046ebe5cea0b55c3a479e082a426e1e07 30-Jan-2015 Yin-Chia Yeh <yinchiayeh@google.com> CameraService: intercept Camera module

Wrap camera module returned from HAL so get_camera_info returns
static_camera_characteristics processed by framework, which
generates keys added after HAL3.2 is released.

Change-Id: Ief423a1571cf06c7ef80b98b403a33969baf95f6
amera3Device.cpp
amera3Device.h
0c4e56d0baaa19fcf17234b38d634b7281e2ae37 10-Jan-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: make sure jpeg buffer size isn't too small

Assuming the jpeg header can take up to 256KB, make sure we always
allocate enough size for the image data.

Bug: 18962703
Change-Id: I08eb3d198d12f71f3ab7266324e80fe7410bdc89
amera3Device.cpp
43e69a6792f01b86b4aaf2314534f637e11c5843 26-Nov-2014 Chien-Yu Chen <cychen@google.com> Camera3Device: support shutter after result

Move the code to remove in-flight requests from processCaptureResult
to a separate function so it can be called when the framework
receives a result or a shutter event. An in-flight request will only
be removed when both results and the shutter event arrive in the
case of a successful request.

Also send out results only after the shutter event receives.

Bug: 18135776
Change-Id: I340db1a495c711b0913784d43fd0f144871e4420
amera3Device.cpp
amera3Device.h
31867b30d3144decd42de0214d8b71c45a2c8cc1 14-Nov-2014 Ruchit Sharma <ruchits@nvidia.com> camera: fix frame deletion logic in mInFlightMap

For per-frame error notifications, camera3.h requirements state that all the
buffer handles for a failed frame capture must be returned via
process_capture_result() call(s). Hence, Camera3Device needs to ensure that
the frame entry is not deleted from mInFlightMap until all buffers for that
frame have been returned by HAL.

Bug: 17757940

Change-Id: I2579ca7980d2fd67d53abc530e2706538f7d3d3a
amera3Device.cpp
e0711f2651121754a10c784e3b149024d17fa4d5 18-Aug-2014 Ruchit Sharma <ruchits@nvidia.com> camera: add traces for KPI measurement

Bug: 17658101
Change-Id: I1d8035c4a8fba7b88a87f205ce57c13d812e9df5
amera3OutputStream.cpp
amera3OutputStream.h
dd5f7dc1a870877c2f0cbe0b595c42b77035f9ec 15-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "Camera3Device: Treat failure to idle as an error" into lmp-dev
9c8a091436052fb0f3290356abe1ac55b7bae8a2 14-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Treat failure to idle as an error

Bug: 16899526
Change-Id: Ia995aac6360c9c41ed654af5a7052480f23903d8
amera3Device.cpp
a1530f1b16f093a91edbbbaf7dac9f9809867817 14-Sep-2014 Zhijun He <zhijunhe@google.com> Camera3: Update ZSL post-processing tags

Update ZSL processing tags according the still capture template
Also cache the request template to avoid extra cost of querying
into HAL every time.

Bug: 17463102
Change-Id: I2eeffefb0a4131c99a85dd3e4484cc6f0f025efa
amera3Device.cpp
amera3Device.h
6b7a2294b9e4da784cfe4b562ee1720ad606c852 09-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> camera2: skip capture result after clearZslQueue

After ZSL queue is cleared, don't add capture result to ZSL queue
if its corresponding buffer has been cleared.

Bug: 17185356
Change-Id: Iddac39ab09b2560e2ce9390895927217c1736d5a
amera3ZslStream.cpp
amera3ZslStream.h
3ea3fcd0822b2f43d87f1d8f67d7bf145864b201 05-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: reconfigure video snapshot size if needed

When recording fails to start due to stream configuration failed,
try configure stream again by setting jpeg stream to video size.

Bug: 16162133
Change-Id: Ib20271e787ae07719ce419f0b15c7f86434f7ebb
amera3Device.cpp
amera3Stream.cpp
16a2ada049447c156648812b94d25be07869f284 27-Aug-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Create a dummy stream when 0 streams are requested.

A workaround for a camera device HAL v3.2 or older specification hole - it's
not acceptable to configure_streams with 0 output streams. However, we allow for
this at the public API level, to allow an application to release all output streams.

So in this case, create a dummy stream that doesn't actually do anything as a placeholder.

Bug: 17220694
Change-Id: Ib25242ffc2c9f2b2f619fd5fe6d652266579da85
amera3Device.cpp
amera3Device.h
amera3DummyStream.cpp
amera3DummyStream.h
1754351d9199721e7e7943461689e399ef015260 06-Aug-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Correct API2 error handling

- Add more error codes to the binder camera2 callbacks
- Translate HAL errors to callback errors
- When flushing, report failures for queued requests
- Treat stream config failure as nonfatal
- Send request errors when buffers aren't available for captures

Bug: 15524101
Bug: 14448494
Bug: 11272459
Bug: 17160301
Change-Id: I81aa54e805a9cce1cb8a6a9374549daa7666deb2
amera3Device.cpp
amera3Device.h
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
61deb78a8a608955e120469ea7a5d39e652b2ae8 22-Aug-2014 Zhijun He <zhijunhe@google.com> Camera API1: remove unnecessary buffer count check

This check doesn't work with ZSL use case. Since the ZSL is both an input and
output stream, When an input buffer is acquired, checking the handout buffer
count for that stream could trigger false alarm when all the output buffers
are sent to hal, instead, we should wait for an output buffer to return.

Bug: 17188380
Change-Id: I7eb166eb49d2f063189d993195ef389d2cf4f2b4
amera3IOStreamBase.cpp
fa1fc7086313f2f1868cae4c1a5698e592a437cb 22-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera: fix triggerId logic" into lmp-dev
c00a25ccce0734bf5627cf02d0c4fb3cf051ce15 21-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera: fix triggerId logic

Fix missing triggerId introduced by previous cleanup change.

bug 17108154
bug 17053130

Change-Id: Ifda55d5fbe992d98f335a8427aa256d78a856586
amera3Device.cpp
amera3Device.h
e2d167eb689d7a536805f950c31f11b9e9c578ae 20-Aug-2014 Igor Murashkin <iam@google.com> camera: Configure streams immediately when API2 does configuration

This makes the configuration more eager (no more waiting until the first
request) and also allows any errors to immediately be sent back to the
client.

Bug: 16629195
Change-Id: I0c365bc8f760466916dcc089217a43c43f9f4c9d
amera3Device.cpp
amera3Device.h
c758f2276f9f9fca9ea24a6647361726acb03646 20-Aug-2014 Igor Murashkin <iam@google.com> camera: hal3: Remove register_stream setprop check

camera3_device_t::register_stream must always be NULL in HAL3.2+ cameras

Bug: 13914251
Change-Id: I116ee71135a827c8b4db61cd91f56ba56da3f0ef
amera3Stream.cpp
28c9b6f298134624cb52b1af4ed8716dddb983d3 08-Aug-2014 Zhijun He <zhijunhe@google.com> Camera2/3: Cleanup the jpeg buffer size calcaulation logic

- Only one place calculating the jpeg size-the device layer, Camera2Device and
Camera3Device.
- Remove size argument for CameraDeviceBase and cleanup related code.

Bug: 14327010
Change-Id: I45d2ab4859ee0cc9273e579254f0569108c748f1
amera3Device.cpp
amera3Device.h
7d70c5e5fe787ae5d7af8830864d208749d6337f 25-Jul-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Replace deprecated native_window methods

Change-Id: I3be5a720ac8b488d1e507c606a9146480faeef63
amera3OutputStream.cpp
f67e23ef637d0b53a0d4bebb68c654234df3da94 24-Jul-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Clean up availability listeners and HAL error codes

- Refactor where availability listeners are called to centralize behavior,
ensuring that all client creation/destruction invokes the listeners
- Clean up some of the client hierarchy
- Filter error codes from key HAL calls to ensure proper reporting

Bug: 16514157
Bug: 16483222
Change-Id: I59875a865b6a508b47423946c78862da8df34cd1
amera3Device.cpp
0a21051b91c2e07e49eb6fa568c505aee967ab9d 24-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: tear down Camera3 streams when they are deleted.

Also override the disconnectLocked method in Camera3ZslStream to make sure the
Camera3ZslStream specific buffer queue is cleaned up properly.

Also revert 0be123df1897fd3fe1b7ba30f24d8ae4c91b4dc7, as it was not the right
fix.
Change-Id: I89bdcb2e206379ae1f2602421e7fdbcde9a31399
amera3Device.cpp
amera3OutputStream.h
amera3ZslStream.cpp
amera3ZslStream.h
5d76e1a639c1bae9ea7d9af1124abf1c94353344 23-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: only append partial result to partial result collection

Otherwise, the metadata entries will be duplicated.

Change-Id: If0cd96e09960fdf746a70913d380e9036745a944
amera3Device.cpp
204e3295e2814052aef7e45ee9edd60128efbbd0 15-Jul-2014 Zhijun He <zhijunhe@google.com> Camera HAL3: migrate from partial quirks to partial result

- Enable the normal partial result path for HAL3.2, the quirk is only used
for the HAL version lower than HAL3.2. The partial quirks is no longer supported
for HAL3.2 or higher versions.
- Add CameraDeviceBase getDeviceVersion API.
- Fix some build warnings

Change-Id: I7a1b03d4d5fd5258d2addfba4368bee2ba691337
amera3Device.cpp
amera3Device.h
0ea8fa4ccbf9b2b179370b983f3887d3daf2381f 08-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: Add capture intent for ZSL capture

Also fix the warning condition in input buffer return path.

Change-Id: I90e9edc1db9f1de87bc8936000b00c3306160c71
amera3Device.cpp
c98bd8d9bf81663b5cd9c79e79d6e7869c1146e6 07-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: only return input buffer when it is sent in request

This is to WAR the case where HAL sends non-NULL input_buffer in capture
result even capture framework doesn't send input buffer in the request.
It's very likely the input_buffer is uninitialized, and we shouldn't
use it. Log a warning for such case as well.

Bug: 16115675
Bug: 16117312
Change-Id: Ib299b45fbfe084059a9f546ded239c8094b039e2
amera3Device.cpp
amera3Device.h
f0d962a6737eb8eec002d6804d9ffbe7bee672a0 30-Jun-2014 Zhijun He <zhijunhe@google.com> Camera3: fix ZSL processor3 issues

- Return input buffer in capture result. Per hal3.2 spec, we should return the
input buffer in process capture result rather than immediately after process
capture request.
- Make the depths of mZslQueue and mFrameList the same. It doesn't make sense
mFrameList depth is larger than mZslQueue depth.
- Set the depths of mZslQueue and mFrameList based on pipelineMaxDepth.
- Clear result queue while clearing zsl buffer queue.
- Hook up camera3 buffer listener with ZslProcessor3, make sure that adding the
same listener multiple times has no effect.
- Remove flush call in pushToReprocess, it is a guaranteed deadlock once
camera3 buffer listener is hooked up.

Change-Id: I285155ab4241e827145855d628f8e98b881c01d5
amera3Device.cpp
amera3Device.h
amera3Stream.cpp
amera3Stream.h
amera3ZslStream.cpp
741ace8776f052245e33a47a0b99400f75996f45 23-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> cameraservice: Deprecate triggerId tags

The following two tags are deprecated from HAL 3.2:
ANDROID_CONTROL_AF_TRIGGER_ID
ANDROID_CONTROL_AE_PRECAPTURE_ID

Trigger IDs are now internal to camera service.

Change-Id: Iaebd62ecb0905a811fa37fe7850e0221c38a0006
amera3Device.cpp
cd8fce8fbe0f515e53a0ea0f50b739cf42ee57a4 18-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: get stream configs by device verison

Starting from device version 3.2, the following tags:
ANDROID_SCALER_AVAILABLE_FORMATS
ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS
ANDROID_SCALER_AVAILABLE_JPEG_SIZES
ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS
ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES
ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS
ANDROID_SCALER_AVAILABLE_RAW_SIZES

are deprecated and replaced by:
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS

Change-Id: Iadc34af0ea985a16a25759d7a9a3eb4845c486fd
amera3Device.cpp
amera3Device.h
8684b7f7977f535260367040931c1fd994cca3b4 13-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: Fix lastFrameNumber counter in flush case

Decrement the counter for those repeating requests never
sent to device.

Change-Id: I2064e51cb5d509d86dbde4a89e8157de33f574b0
amera3Device.cpp
amera3Device.h
13c878f07fb36a49aade20cec684ed8e12724751 06-May-2014 Zhijun He <zhijunhe@google.com> Camera3: fix missing string in logging code

Change-Id: I15da6bb8b586b4641837f42d2145530fb45dd0bd
amera3Stream.cpp
e11ae4b2f7d38c8092e7c67ff06610165d866d98 01-May-2014 Zhijun He <zhijunhe@google.com> Camera3: Don't notifyError for non-fatal errors

Bug: 14448494
Change-Id: Ie2e2dc6a8475189707c556845adb77f20f270df5
amera3Device.cpp
f7da096db8655531c2f2b7bddccd1064b1021155 24-Apr-2014 Zhijun He <zhijunhe@google.com> Camera3: scale the max jpeg buffer size based on resolutions

The max jpeg buffer size was always the android.jpeg.maxSize, regardless of
the actual jpeg capture size. This creates a huge memory waste especially
for smaller size jpeg capture. Now the max jpeg buffer is linearly scaled based
on the resolution.

Bug: 14288983
Change-Id: I8a971b8e2f4fc7fec0154547bdb688579af71a47
amera3Device.cpp
amera3Device.h
7ef20390ba4375c4b08edd14923846086987a8c8 22-Apr-2014 Zhijun He <zhijunhe@google.com> camera3: Don't hold mLock during flush call

HAL calls into Camera3Device functions like processCaptureResult during flush
call. When Camera3Device runs into error state during flush call,
processCaptureResult calls setErrorState(), which leads to deadlock.

Change-Id: I35a03f6eb4b77f914097917cb37de98663de365f
amera3Device.cpp
e7ec24c9934c98a451e986a07651992df7fe6558 21-Apr-2014 Jianing Wei <jianingwei@google.com> Merge "CameraService: fix waitUntilIdle bug revealed by TestingCamera2."
106b83d2447d3209d12fdc05215b965e05c5efea 21-Apr-2014 Eino-Ville Talvala <etalvala@google.com> am dae621c2: am 95006625: Merge "camera: set mNeedConfig after creating ZSL stream"

* commit 'dae621c2c7f40f1587b97636975908e1374ade9a':
camera: set mNeedConfig after creating ZSL stream
3c76fa3e73374dfe7bb93e1b03fed30749e1e4b9 21-Apr-2014 Jianing Wei <jianingwei@google.com> CameraService: fix waitUntilIdle bug revealed by TestingCamera2.

* clear mStreamingRequestList in flush
* fix frame number checker in notify and processCaptureResult

Bug: 14166437
Change-Id: I022421080d05138f9068c1b9b85d83bd613b04fb
amera3Device.cpp
6adc9ccb2948d9421a0ed4b74f52b909bcec2037 15-Apr-2014 Zhijun He <zhijunhe@google.com> Camera3: block until get an available buffer

Camera3Stream shouldn't error out when the max number of buffers are already
dequeued. It should block until next buffer returned from camera device.

Bug: 11595505
Change-Id: If65a70c29cb04219e14ded0744059c0ab783444b
amera3IOStreamBase.cpp
amera3IOStreamBase.h
amera3InputStream.cpp
amera3OutputStream.cpp
amera3Stream.cpp
amera3Stream.h
amera3ZslStream.cpp
2d6bb3f9e3e7cc1c7debbbe3d74bf9c70b6f39d4 11-Apr-2014 Jianing Wei <jianingwei@google.com> CameraService: fix race condition and wrong last frame number.

Change-Id: Ie2be9a77a0b074497615de38cbb8e8f13b4858ec
amera3Device.cpp
amera3Device.h
e5e3d0823165dea9211a47232dbbbe361153fb49 15-Apr-2014 Yuvraj Pasi <ypasi@nvidia.com> camera: set mNeedConfig after creating ZSL stream

Set mNeedConfig after creating ZSL stream, camera device
will reconfigure for the case when only ZSL stream
is changed.

Change-Id: Ib592817f81125969824a1280349f77973116f375
amera3Device.cpp
43827aea591c2fffdb87006462a5aa7a131a25c0 10-Apr-2014 Vineeta Srivastava <vsrivastava@google.com> Merge "camera3: Remove register_stream_buffers for HAL 3.2+"
cb0652e5a850b2fcd919e977247e87239efaf70e 13-Mar-2014 Jianing Wei <jianingwei@google.com> CameraService: trigger appropriate callbacks for burst capture.

* Instead of tracking CameraMetadata only, now we track both
CameraMetadata and CaptureResultExtras, which is not part of
the HAL metadata. This will enable the correct callback of
onCaptureStarted and onResultReceived given burst requests.

* Get last frame number in reply when submitting requests,
canceling requests, and flushing device. For repeating requests,
this frame number is the last frame number of the previous
request. For non-repeating requests, this frame number is the
expected last frame number of the current request. The goal
is provide frame number to Java side in order to trigger
onCaptureSequenceCompleted correctly.

* Fix notifyError so that onDeviceError can be called correctly.

Bug: 10749500
Change-Id: I2f3dda6c530090055d4a2ff9f0f087bbbe8d9257
amera3Device.cpp
amera3Device.h
13d315eb8c0848ea0584b9fb1d27bab55bc8158b 04-Apr-2014 Igor Murashkin <iam@google.com> camera3: Remove register_stream_buffers for HAL 3.2+

Use 'setprop camera.dev.register_stream 1' to skip the fatal NULL check
- This property will be removed before shipping L

Bug: 13301331
Bug: 13435680
Change-Id: I16aacd7b22e0a10b34f6fb8501be0256170a8cd5
amera3IOStreamBase.cpp
amera3Stream.cpp
amera3Stream.h
95dd5ba5bf83716f2eed5fe72366c4212464d710 27-Mar-2014 Zhijun He <zhijunhe@google.com> Camera3: fix HAL3.x version check issue

Camera service should support HAL3.x instead of only HAL3.0.

Bug: 13609405
Change-Id: If7e86f9abe019547fc0be2e11337551cd7c57870
amera3Device.cpp
amera3Device.h
d6d1883f607d40be5d9a87909ae563cf94256c24 25-Mar-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: Fix flush call deadlock"
32ce52b01dab863f2b4749e1c69f619cf820486f 24-Mar-2014 Colin Cross <ccross@android.com> am 5c679d41: resolved conflicts for merge of 3d7c5002 to klp-modular-dev-plus-aosp

* commit '5c679d41714e42f153f6aeb492df54510a195bc1':
libcameraservice: build 64-bit
libcameraservice: fix 64-bit print format warnings
69a374897392c8bd70f441b7284f6f578c651ec9 24-Mar-2014 Zhijun He <zhijunhe@google.com> Camera3: Fix flush call deadlock

Flush shouldn't call waitUntilDrained directly, as they are all API calls
with mLock and mInterfaceLock held. Move the waitUntilDrained implementation
into waitUntilDrainedLocked to solve this issue.

Change-Id: Id7d931091d5c11e12204790841097433515446db
amera3Device.cpp
amera3Device.h
cfe09079608d78a0a358f01bb49f279859e38664 22-Mar-2014 Jianing Wei <jianingwei@google.com> Merge "CameraService: Add support for burst capture and repeating burst."
90e59c98c343e941b1a75307ffa4b4b5f1eb50d6 13-Mar-2014 Jianing Wei <jianingwei@google.com> CameraService: Add support for burst capture and repeating burst.

Bug: 10749500
Change-Id: I292a485b222e5cf97388d76bf0d956a6ac54bb2f
amera3Device.cpp
amera3Device.h
e5729fac81c8a984e984fefc90afc64135817d4f 21-Mar-2014 Colin Cross <ccross@android.com> libcameraservice: fix 64-bit print format warnings

Use PRId64 from inttypes.h to print nsecs_t (int64_t)
Use %zu to print size_t

Change-Id: I135620e0388db33587a8a7da393b48a45cb7275a
amera3Device.cpp
amera3IOStreamBase.cpp
amera3Stream.cpp
amera3ZslStream.cpp
tatusTracker.cpp
b5ea3014b8be9eaa16da0144bd81af6fa514d8e2 18-Mar-2014 Dan Stoza <stoza@google.com> Merge "Remove deprecated BufferQueue constructor"
d1176ef16677b6c94fb893edb6a864cdccc0b190 21-Feb-2014 Ruben Brunk <rubenbrunk@google.com> camera3: Pass vendor tags through binder.

Bug: 12134423

- Adds a class for parceling vendor tag definitions.
- Passes vendor tag definitions to clients of the camera service.
- Switches over to new vendor tag mechanism when reading from HAL.

Change-Id: Icef3fe9e67160767bdb8244ac49c85b68b497123
amera3Device.cpp
amera3Device.h
8aa0f0619ea867e8fb240cf27913d4f8ae767385 12-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: Ifc8f778b70102a38a9f7a086632e6884714e6b58
amera3InputStream.cpp
amera3ZslStream.cpp
1d6fa7af1288b550faabe4ec2cf98684236723db 11-Feb-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 566be7c3 to master

Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
377b2ec9a2885f9b6405b07ba900a9e3f4349c38 03-Feb-2014 Kévin PETIT <kevin.petit@arm.com> Make frameworks/av 64-bit compatible

Contains the necessary changes to make frameworks/av build and work
on a 64-bit machine.

Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
amera3IOStreamBase.cpp
amera3ZslStream.cpp
5f44635dc35814b98b4dc2b255355a93122fec59 22-Jan-2014 Zhijun He <zhijunhe@google.com> camera3: Delete output stream of bi-directional stream

Bi-directional stream (like Zsl stream) is both input and output streams. When
deleted, both streams need to be deleted.

Change-Id: I8b6bb9054fec264cc03754003797de0bae10cb20
amera3Device.cpp
491e341211b4772c75f719158f6b397e1c40497d 27-Dec-2013 Zhijun He <zhijunhe@google.com> Camera3: Flush device before ZSL reprocess

Call flush before sending ZSL reprocess request. This not only ensures no
in-flight requests pending in the HAL before ZSL reprocess request, but also
makes reprocess request to be processed by the HAL sooner.

Bug: 12230973
Change-Id: I4c9e5a0fb75ccdc1e8861262c08d599d04170b7f
amera3Device.cpp
5b19084a5089e3f6527a82440a1c8227c3a366fa 21-Nov-2013 Zhijun He <zhijunhe@google.com> Merge "Camera3: Remove request from InFlightMap for error case"
1b05dfc8df5e741086747d076fc39c79fb4acb33 21-Nov-2013 Zhijun He <zhijunhe@google.com> Camera3: Remove request from InFlightMap for error case

We don't expect HAL send back valid result metadata if error occurs for a
request, such as during flush call. The request needs to be removed from in
flight request map accordingly.

Bug: 9758581
Change-Id: I51fe327337325ce72f11ce592778a2af02e98479
amera3Device.cpp
b50df220ae76c7bb6e78b096ece06b2609cf4ffe 19-Nov-2013 Zhijun He <zhijunhe@google.com> Merge "Camera3: add systraces for hal open/close"
213ce79e943a3b51d7859a184d8211c859c960a0 19-Nov-2013 Zhijun He <zhijunhe@google.com> Camera3: add systraces for hal open/close

Bug: 10901465
Change-Id: I32fb96aa0f9efd423bdb9a3d92c142a096a7a47f
amera3Device.cpp
054aab3479a094b0a04d48db9cb8f325ea5be162 18-Nov-2013 Igor Murashkin <iam@google.com> camera3: Remove BufferQueue::MIN_UNDEQUEUED_BUFFERS references

Change-Id: I4730ac7849e915e88d3b8fc8aa869f53a8242501
amera3InputStream.cpp
amera3InputStream.h
amera3ZslStream.cpp
amera3ZslStream.h
184dfe4ea5e2ba33951bed2b1366007aee0ce3da 08-Nov-2013 Eino-Ville Talvala <etalvala@google.com> Camera API2: Add support for partial result quirk

- Camera3Device: Include requestId in partial 3A results
- FrameProcessorBase: Add support for partial result listeners
- CameraDeviceClient: Listen and forward partial results to client

Bug: 11115603
Change-Id: If1cc6bbc32932742ac142c058688761ebf6a8024
amera3Device.cpp
amera3Device.h
fd6ecdd39bd83ea020f78b425e96310380d66c35 11-Oct-2013 Eino-Ville Talvala <etalvala@google.com> Camera HAL3/API1: Add support for the partial result quirk.

- Camera2Client:
- Detect partial result quirk
- Camera3Device:
- Accumulate all partial results together
- Fire off 3A-only result once all 3A states are available
- FrameProcessorBase:
- Filter out partials, don't send to listeners
- FrameProcessor:
- Skip face detect on partials
- Make sure to only handle a 3A update for a given frame once
- Trigger AF notifications when AF mode or trigger changes, to
properly detect all AF transitions.

Bug: 11115603
Change-Id: Iea8aa73c568701562a46071f7ea100624251d10b
amera3Device.cpp
amera3Device.h
ff3e31d2b100d8efd969b358b18e4405c49dd10d 24-Oct-2013 Igor Murashkin <iam@google.com> camera: Collect stack traces when bad things happen, print with dumpsys

Bug: 11324229
Change-Id: Ic920e170a8f5a389fc139bbf5416c0e3186c7fb6
amera3Device.cpp
15ad2470b2f2ac34473eb568b606ad75e8e63ac6 12-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: Fix deadlock in Camera3OutputStream

process capture request thread, process capture result and setParameter
binder threads can run into circular locking situation when acquiring
StreamingProcessor lock, Camera3Stream lock, and bufferQueue lock.
Releasing the Camera3Stream lock briefly in process capture request
thread getbuffer call can break this deadlock.

Bug: 11016037
Change-Id: If08d4b134c26be26039b1d5363759e60f911bad6
amera3OutputStream.cpp
1dd08b30e2366cabc50d883885d6229dab8218f2 11-Oct-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera2/3: Add more tracing for API1" into klp-dev
2b07e0207da44d7b3cc63c369fd10c9f12a5e2cd 11-Oct-2013 Eino-Ville Talvala <etalvala@google.com> Camera2/3: Add more tracing for API1

- AF state
- Async autofocus completion
- Async takePicture completion
- Stages of takePicture

Bug: 10570497
Change-Id: Ida9fedd81aa4ee3ae3fb8dfada858a3bc3c213a3
amera3Device.cpp
cc27e117ed01c9a2b4def5a9c7a3103af83ee47e 04-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: Save 1 frame time for takePicture call

Move the latest request signal call right before submitting request to HAL,
which avoids unnecessary 1 frame time wait.

Also fix request status constructor issue, and the log tag for Camera2Client.

Bug: 10570497
Change-Id: I0b1818658bee9983b117e49a5a00f1aab515c567
amera3Device.cpp
amera3Device.h
07d2169d46f3536add6044dbf106967a1982252f 25-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Improve resilience to stream failures

- Handle binder connection drops (DEAD_OBJECT) for streams
- Just log an error, don't go to an error state when queue/dequeue fails

Bug: 10347526
Change-Id: Ib463ffe15d58db444cf5d8cad176a201c7d1facc
amera3Device.cpp
amera3IOStreamBase.cpp
19fffcbd89a51af797265af2e11c97be5820a07d 04-Oct-2013 Zhijun He <zhijunhe@google.com> Merge "Camera3: track request status in inflight queue" into klp-dev
1d1f846c0dbaa36d0944e7b1e54cc07863e00a92 03-Oct-2013 Zhijun He <zhijunhe@google.com> Camera3: track request status in inflight queue

Bug: 9758581
Change-Id: I1d7135cd0932bd6b453acabfeb9a553985c887bc
amera3Device.cpp
amera3Device.h
f1e98d857ec377f2c9b916073d40732e6ebb7ced 06-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera API 2, Device 2/3: Implement idle and shutter callbacks

- Update callback Binder interface
- Rename frameId to be requestId to be consistent and disambiguate
from frameNumber.
- Implement shutter callback from HAL2/3 notify()
- Add in-flight tracking to HAL2
- Add requestId to in-flight tracking
- Report requestId from shutter callback
- Implement idle callback from HAL3 process_capture_result
- Add new idle tracker thread
- Update all idle waiting to use the tracker
- Add reporting from request thread, all streams to tracker
- Remove existing idle waiting infrastructure

Bug: 10549462
Change-Id: I867bfc248e3848c50e71527e3561fe92dc037958
amera3Device.cpp
amera3Device.h
amera3IOStreamBase.cpp
amera3IOStreamBase.h
amera3InputStream.cpp
amera3OutputStream.cpp
amera3Stream.cpp
amera3Stream.h
amera3StreamInterface.h
tatusTracker.cpp
tatusTracker.h
2f876f9ee63396e4e0117f85c5b3132cac7e2c9d 13-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Always set a trigger ID for an active trigger

This is to work around HAL implementations that expect to see an
ID for every trigger.

Use a dummy trigger ID of 1, since 0 has special meaning for older
HALs.

Bug: 10720617
Change-Id: I9cb1b8dbcb113cb9e737e5adb04032fd61a54c12
amera3Device.cpp
amera3Device.h
6220f993541b0317e6ace3c410dd35a8d76e30bc 10-Sep-2013 Igor Murashkin <iam@google.com> Merge "camera3: Dump latest request sent with dumpsys" into klp-dev
d1d6467d3bcbc1305eeba0176a2edf04925c368e 07-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: Correct stream id types

Bug: 10604704
Change-Id: I223ac5d200eb6439c08955fb7ad586592099fbae
amera3Device.cpp
1e479c0f4cb3e2174dde0b02e5656fb658f73495 07-Sep-2013 Igor Murashkin <iam@google.com> camera3: Dump latest request sent with dumpsys

Bug: 10606535
Change-Id: I0dd5ca3e09f45701659ab9ebd3b51939a2f6e6ba
amera3Device.cpp
amera3Device.h
26fe6c7c56477ef227205c68f17df07ca3501d65 29-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Be busy as soon as work arrives.

RequestThread's internal busy flag (mPaused) was not being immediately
set when new work was submitted to it. This allowed for a race
condition where a capture() followed by an immediate
waitUntilDrained() would immediately return from the wait.

Set the mPaused flag to false immediately in capture() and
setStreamingRequest() to avoid this, instead of waiting until the end
of the next RequestThread iteration.

Bug: 10531739
Change-Id: I54a79fe5361d527ec717f41ad805e9b319a48cd8
amera3Device.cpp
amera3Device.h
abaa51d3ca31f0eda99e1d271e6dc64c877dbf58 14-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Camera2: Add flush support

- On HAL2 devices, fall back to wait until idle
- On HAL3 devices, call HAL flush method

Bug: 9758581
Change-Id: Ie1c570a15f6590a1ee6c271e3b989c48079b468a
amera3Device.cpp
amera3Device.h
deeef54487a34034dc0cfaab20b20d557224c07c 02-Aug-2013 Mathias Agopian <mathias@google.com> separte producer and consumer interfaces

Bug: 9265647
Change-Id: Iefabc11e4bd2e2e8ffd31160476c450affe6629c
amera3InputStream.cpp
amera3InputStream.h
amera3ZslStream.cpp
b2f5b19e5b6e1408a259add23dba91037756a943 30-Jul-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Provide consumer usage flags to HAL for each stream

At stream configure time, pass on the stream's consumer usage flags
to the HAL, to speed up final hardware configuration.

Bug: 9592202
Change-Id: Ie467be053be36a09e482f5f05cad65df42d66476
amera3IOStreamBase.h
amera3InputStream.cpp
amera3InputStream.h
amera3OutputStream.cpp
amera3OutputStream.h
amera3Stream.cpp
amera3Stream.h
7b82efe7a376c882f8f938e1c41b8311a8cdda4a 26-Jul-2013 Eino-Ville Talvala <etalvala@google.com> Camera: Rename new API to camera2, rearrange camera service

- Support API rename from photography to camera2
- Reorganize camera service files
- API support files to api1/, api2/, api_pro/
- HAL device support files into device{1,2,3}/
- Common files into common/
- Camera service remains at top-level

Change-Id: Ie474c12536f543832fba0a2dc936ac4fd39fe6a9
amera3Device.cpp
amera3Device.h
amera3IOStreamBase.cpp
amera3IOStreamBase.h
amera3InputStream.cpp
amera3InputStream.h
amera3OutputStream.cpp
amera3OutputStream.h
amera3OutputStreamInterface.h
amera3Stream.cpp
amera3Stream.h
amera3StreamBufferListener.h
amera3StreamInterface.h
amera3ZslStream.cpp
amera3ZslStream.h