History log of /frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6c2f7aeb10fb2050c27afa0212a1e167ca2809ec 21-Jun-2017 Shuzhen Wang <shuzhenwang@google.com> Camera: Add debug messages for camera latency

Log latency histogram of:
- processCaptureRequest call,
- dequeueBuffer call, and
- waiting time for handout count fall below max_buffers

Test: Camera CTS
Bug: 62651109
Change-Id: I5ee1cdb4139fa359f0887d6f6871884e28739340
(cherry picked from commit 686f644f981badd481d8781bf80b221544df7b1f)
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
c58cf4c4104b001425f9d4a36f3e5441874efd3d 11-May-2017 Emilian Peev <epeev@google.com> Camera: Close acquire fences on failed buffers

Buffers that didn't get a chance to be processed
might still hold valid acquire fences. Check and
close those if necessary.

Bug: 38229510
Test: Manual using application
Change-Id: I8e823a655cc30ed966e277ace090e96c64ba1c8c
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
63eb7e79cf94662a5412fd6e473cf12f5f48eef0 04-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Camera: Cleanup 'CameraModule' dependend code" into oc-dev
c5cbb87d00ead068a7088db4060bce1c0e699b8c 27-Apr-2017 Eino-Ville Talvala <etalvala@google.com> Camera service: Don't crash if the camera HAL dies mid-use.

Check for transaction errors in all calls to the HIDL interface;
return DEAD_OBJECT consistently if a transaction error occurs.

Test: Camera CTS does not regress; killing camera HAL does not kill camera service.
Bug: 37748853
Change-Id: Iab3ad08376e164db340f8f29c3cfc7fdf261cc00
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
f53f66edb3b06d1df5caf1fa806f7ed95305a4cf 11-Apr-2017 Emilian Peev <epeev@google.com> Camera: Cleanup 'CameraModule' dependend code

CameraModule is already part of the HIDL wrapper and
is no longer needed in the service code.
Add extra logic in camera provder manager for identifying
camera API1 compatible devices.

Bug: 34392075
Test: Complete Camera CTS
Change-Id: I64a49e9091557c88859872d0c599c5be378db8b5
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
2a53da4379f1a5624203673cce8c1773b0cffa50 10-Apr-2017 Emilian Peev <epeev@google.com> Camera: Remove RAW boost value override logic

RAW boost value will be inserted by HIDL wrapper. The logic
needs to move there.

Bug: 34392075
Test: runtest -x
cts/tests/camera/src/android/hardware/camera2/cts/DngCreatorTest.java
Change-Id: I7d4321d728eba11b5ec1345536bb669d70f3cffc
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
7e25e5e2195823b4b9cbe61c072b9267297cab34 07-Apr-2017 Emilian Peev <epeev@google.com> Camera: Remove AE pre-capture trigger cancel override

Bug: 34392075
Test: runtest -x
cts/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java
-m testAePrecaptureTriggerCancelJpegCapture
Change-Id: I0e632c83fb3ae0e4df26fe35bf1ef8441c1f20fa
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
08dd245c7c30900637197065213fbaa2b2a5c1ee 06-Apr-2017 Emilian Peev <epeev@google.com> Camera: Make device related code version agnostic

Camera device related code should be agnostic w.r.t.
device version as much as possible. Specifically the
following requirements must hold true:
- Since support for devices 3.0&3.1 is deprecated
"ANDROID_QUIRKS_USE_PARTIAL_RESULT" is no longer considered.
- "ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS" is always
used instead of the deprecated "ANDROID_SCALER_AVAILABLE_JPEG_SIZES".
- Buffer manager for camera streams is used for dynamic buffer
allocation.
- "flush" is always used instead of waiting for buffers to drain.
- Similar to "flush" stream "tearDown" is always available.
- Dead code handling buffer registration is removed.

Bug: 34392075
Test: Manual using camera application
Change-Id: If1b215f785ba61c6991fdf163d4eb18733690471
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
238ef5f352a59e97a90e2f9af88a27ad705442e5 19-Apr-2017 Yin-Chia Yeh <yinchiayeh@google.com> Camera: allow shifted camera metadata for some interface

Allow shifted metadata when the buffer is allocated by
hwbinder (which might allocate buffers to 4 bytes boundary
on 32-bits CPU)

Test: compile, GCA working
Bug: 37095012
Change-Id: I404b73ac3b460f5ff03cb64001c24f7a05b91396
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
a640c5a8731adb001b955192ce032c69c7322849 13-Apr-2017 Yifan Hong <elsk@google.com> Use fmq for camera capture result.

Test: camera works.

Bug: 35788245 [Treble] Pass camera metadata using shared memory

Change-Id: I344212cfd80f6df4e5aec01ec3f12f1ee9bb71c8
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
f79b55484121b70652411272cf286a3bebd4fdb6 11-Apr-2017 Yifan Hong <elsk@google.com> Use fmq for camera capture request.

Test: camera works.
Bug: 35788245 [Treble] Pass camera metadata using shared memory

Change-Id: I58d7f6ef91ff45680840bf61a431a0c071ebbdfb
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
67a0c0e77dce4dccc9155f4bfce490d167457c8a 06-Apr-2017 Chia-I Wu <olv@google.com> libcameraservice: update for revised HIDL gralloc

There is only BufferUsage instead of ProducerUsage/ConsumerUsage
now.

Test: make
Change-Id: I265ca4c27e284fb1f704659efd74355f82d3c192
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
71c73a2985a7ac65ee597be3441ab300fa56e22e 21-Mar-2017 Emilian Peev <epeev@google.com> Camera: Support vendor tags from multiple providers

Different vendors could have different vendor tags.
A global vendor tag cache will store all available
vendor tag descriptors from different providers.
The cache will then be shared with each camera client.
Camera metadata will use specific vendor ids stored
in the metadata buffer to identify the correct vendor
tag provider.

Bug: 34275821
Test: adb shell /data/nativetest/cameraservice_test/cameraservice_test
--gtest_filter=CameraProviderManagerTest.MultipleVendorTagTest
Complete Camera/Camera2 CTS tests
Change-Id: I2262128f21a0167504f018230624e2a89786c467
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
47cf8e62b81770c0896aac444ef22a840b3a2c5e 04-Apr-2017 Yin-Chia Yeh <yinchiayeh@google.com> Revert "Camera: Map between bufferqueue gralloc0 usage, and HIDL gralloc1 usages"

This reverts commit 1a2f15daf13552e86324025cf6d31d887cd8fa02.

Test: fix b/36876770
Bug: b/36876770
Change-Id: Ie7b8c9ee444e3e8667154b396e3e6a556b54739a
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
ac3e2cce871b7cdbb0526d4af9d0bc477e795b2e 04-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Camera: Try to remove inflight requests during error notifications" into oc-dev
654be2e6354e4685393c8c1bc8408ae6579ce7dd 04-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Camera: add buffer freed notification interface" into oc-dev
be83fa713da45b1c751d33ad69ce0017ebe9f707 30-Mar-2017 Yin-Chia Yeh <yinchiayeh@google.com> Camera: add buffer freed notification interface

To cleanup caches of obsolete buffers.
This CL addressed the input stream bit, the output
stream hook will be a followup CL.
Also cleanup some dead API in CameraDeviceBase.h

Test: fix CTS ReprocessCaptureTest
Bug: 34461678
Change-Id: I801cd81c29becaa45630ed0a5c2dab8df1278a6a
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
ba0fac313cc2451681f62a398253c2c01c1c61e7 30-Mar-2017 Emilian Peev <epeev@google.com> Camera: Try to remove inflight requests during error notifications

Make it possible for clients to clear the internal inflight queue
as part of error result notifications. For this to work all pending
buffers must be returned previously with the exception of the
result metadata.

Bug: 35652756
Test: Complete Camera/Camera2 CTS without any regressions.
Change-Id: I9d8a6b63364fd254311cda2f8c836b99ee05cacb
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
1a2f15daf13552e86324025cf6d31d887cd8fa02 23-Mar-2017 Eino-Ville Talvala <etalvala@google.com> Camera: Map between bufferqueue gralloc0 usage, and HIDL gralloc1 usages

Otherwise some bits aren't where they're supposed to be.

Also stop using HW_CAMERA_ZSL; we need to only set HW_CAMERA_READ, and it's
confusing to set a producer flag on the consumer usage side.

Test: Camera CTS passes
Bug: 35215313
Change-Id: I23e6e60bf875fe9d8f2d7a1f805d2ef854c16b97
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
be3d40cadb8490291512a6d7882791dda9104316 27-Mar-2017 Emilian Peev <epeev@google.com> Camera: Update 'indexOfKey' return check

Method 'indexOfKey' will return 'NAME_NOT_FOUND' error
status in case it doesn't find any values matching the
given key. Checking for anything other than this error
code could lead to instabilities.

Bug: 35925482
Test: Manual using application
Change-Id: Ie72eb29776b27a6d485f6e42ee7e62c62795ca9e
(cherry picked from commit 4219c290e526c6cb1767038776fff4f9b5d74cc7)
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
94c68e09c9a9f30a68ce46b5efb5795fccb34616 06-Mar-2017 Yin-Chia Yeh <yinchiayeh@google.com> Camera: add batching support for HFR

Test: GCA slow motion recording workin
Bug: 34899394
Change-Id: Icf56458d3fa6f0b4a6b8cfffe6a61da0626e81ec
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
403044af4352f6d56aef0fb9548d2bfce56d3127 27-Feb-2017 Shuzhen Wang <shuzhenwang@google.com> Camera: Fix error check for HFR timestamp

With Camera HAL sending empty metadata for HFR batching, service
shouldn't check matching timestamp for empty metadata.

Test: Manually test high speed recording
Bug: 35775704
Change-Id: I68f3c16ea9a91f15c70e406540764b02cb6951e1
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
8ce2339cb7dc61e5fac5af90ce73716dc9e3ba52 17-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Camera: Send shutter and result once per batch"
5ff9c91a90d7d5fad49de38bc314910251b25774 10-Mar-2017 Steven Moreland <smoreland@google.com> cameraservice: remove String\d+::std_string

Part of removing libc++ from libutils.

Bug: 35363681
Test: pass
Change-Id: Iae07bb7a5e3ce4794e0b999249c2e101e860e64a
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
4a472663e85585403ad0d15e1bf5b37c10628dd0 27-Feb-2017 Shuzhen Wang <shuzhenwang@google.com> Camera: Send shutter and result once per batch

For High Speed Recording, only send the shutter and result for the last
request in the batch, and count on the application process to derive
other results in the batch.

This reduces the binder transaction between the two processes, and saves
power.

Test: Manually test high speed recording with GCA, and CTS
Bug: 35775704
Change-Id: I3e1b4c1db3d1d1044400d825e2affa4461362b39
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
e7091aa805f44bc030235b4f5de12c151a35312a 08-Mar-2017 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Fix regression to old camera API operation.

When Camera2Client uses Camera3Device, it operates with lazy stream
configuration (in which streams are configured only once a capture
request is going to actually be sent). In this path, the operating
mode may never get set to a valid mode, and thus always fail
stream configuration.

Ensure that all paths calling into configureStreamsLocked set the
appropriate operating mode.

Test: Actually no camera CTS regressions this time, honest!
Bug: 34853980
Change-Id: I6e1855206f6d76cca5ff8348555b26bd7b868843
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
bbbbe84b3a7296c9c3266bb16e0dc98b11cb5939 01-Mar-2017 Eino-Ville Talvala <etalvala@google.com> Camera: Allow direct selection of operating mode

Instead of a true/false switch for high-speed mode, use an integer
enum instead and define the two existing modes, plus the start
of a vendor mode space.

For all non-high-speed modes, use the normal configuration path,
but pass the operating mode to the HAL.

Test: New CTS test passes
Bug: 34853980
Change-Id: I9dc2b2a2164e9779f079a30e936c4117bcf96efe
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
bee0f0a5e7aa19aa7c59de03b508985b68bc6b5e 24-Jan-2017 Shuzhen Wang <shuzhenwang@google.com> Camera: Rework StreamSplitter for camera use cases

- Merge notifyRequestedSurfaces into getBufferLocked, so that during
getBufferLocked, the stream splitter gets to know which outputs the
current request is on.

- Reserve buffer slot in the output queue during getBufferLocked instead
of during onFrameAvailable. So if there is no slot/buffer available, no
new request is sent to HAL. This aligns with current cameraservice logic.
Do not hold the lock while calling attachBuffer to output queue because
it could block for a slow consumer.

- Instead of setting the consumer buffer count of input buffer queue to
maximum of all shared outputs, set it to sum of them. By doing this,
In the case of a slow consumer, other consumers sharing the same stream
won't be impacted.

- Handle the case where onBufferReleased not being fired for buffer
replaced by attachBuffer/queueBuffer.

- Add function to check the return value of onFrameAvailable so that
when output is abandoned, the error code is propagated back to
queueBuffer.

Test: Camera CTS, and CTS with StreamSplitter enabled for all
implementation defined use cases.
Bug: 33777818
Change-Id: I863f501d5283bbe70c71e66b4d37d690484b90fa
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
2d6140b8dce137f89029b12468e25d5911f23420 13-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'api1_zsl_rework'

* changes:
Camera2: Add native test for framework-backed ZSL
Camera: Rework ZSL path when using API1 with HAL3
83f042776b131b149f803fff6ab184ae2c4d98cd 07-Feb-2017 Mikhail Naganov <mnaganov@google.com> audioflinger: Adjust priority of hal threads

HALs are prohibited from using framework binder, and there is
no equivalent scheduling policy service in hwbinder. Thus, in order
to match priorities of FastCapture / Mixer threads with their
counterparts in the HAL, it is needed to request the priority boost
from audioflinger on behalf of the HAL.

Test done to verify the priority was correctly set.

Bug: 34131400
Change-Id: If8b6b031c0fcba771fae901a5b8e7da89b3a1570
Test: check priority match between audioflinger's and hal's threads
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
2d16ffaae63051b5faf7c39a455c6d5af0226377 24-Jan-2017 Emilian Peev <epeev@google.com> Camera: Rework ZSL path when using API1 with HAL3

Currently this path relies entirely on the deprecated bi-directional
streams. This needs to be re-worked and the functionality should
only use input&ouput streams. In this case the dedicated
'Camera3ZslStream' module becomes mostly obsolete. Some of the logic
for buffer comparison will still be needed and can be moved to ZSL
processor entirely.
The processor module will now use two streams, one input stream and
one ZSL output stream, which will produce the queue data. Both of
them will be configured to use the supported sensor array size and
private format. Scaling from the sensor resolution to the final user
requested size will happen during the re-process pass once image
capture gets triggered.

BUG: 34131351
Test: Manual via TestingCamera, 'CameraTest' API1 test cases
Change-Id: I7c87b7e7f89815e01a7cb5ce39d9c561c58562df
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
d00111e3b0c2ee59736fda992dd9ea24b23ef46a 31-Jan-2017 Eino-Ville Talvala <etalvala@google.com> Camera service: Fix dump() for treble path and rearrange it

Get camera service dump working again in the Treble path, and clean
up the formatting a bit

- Switch to dprintf instead of write() for most dump calls
- Add clearer headers for each section
- Add static metadata details to CameraProviderManager dump

Test: adb shell dumpsys media.camera with Treble both enabled and disabled
Bug: 32991422
Change-Id: Ie1d431b68649777bfe84fbb1be0687dd02e671af
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
758c215374dba397dabe17b8e96dd38593c09dd7 11-Jan-2017 Shuzhen Wang <shuzhenwang@google.com> Camera: Combine handling of deferred surface and shared surface

- Refactor the OutputConfiguration to contain isDeferred and isShared
flag, and not contain NULL surface.
- Unify the handling of deferred surface and shared surface.

Test: Camera CTS, and manual testing of GoogleCamera use cases
Bug: 33777818
Change-Id: I5dd3472f0f2133699b0e9fbdd8ba456956222746
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
f3a8a2392e5dadee8afa51d384da008ae22b4091 18-Jan-2017 Yin-Chia Yeh <yinchiayeh@google.com> Merge changes from topics 'cam-hidl-fence', 'camera-hidl-bufId'

* changes:
Camera: wait for remote camera provider
Camera: setup vendor tag in binderized mode
Camera: treble: close acquire_fence
Camera: pass bufferId to HIDL interface
f4650601b4615f6a28727c1ad6bc956fd5ea532c 10-Jan-2017 Yin-Chia Yeh <yinchiayeh@google.com> Camera: treble: close acquire_fence

This is to make the behavior agnostic to passthrough/binderized
mode.

Test: running API2 CTS
Bug: 30985004
Change-Id: I48ce307f8566ff0a2a5b35763e1a37733e6ed9a0
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
773270525f68bdb706b85c3cd6e3750f27ca6d11 10-Jan-2017 Yin-Chia Yeh <yinchiayeh@google.com> Camera: pass bufferId to HIDL interface

This gives each buffer a unique ID and save some time sending
buffer_handle_t to HAL process.

Bug: 30985004
Change-Id: Idf0d3edde94e1331cadb271dce3e4bed8bfb8c14
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
0129d52df9794d6fdf06be304722b5cb51a2eab5 31-Oct-2016 Shuzhen Wang <shuzhenwang@google.com> camera2: Add support for secondary surface for stream

- Enhance OutputConfiguration to contain multiple surfaces for one
underlying stream.
- Create Camera3SharedOutputStream to handle streams with multiple
surfaces.
- Create Camera3StreamSplitter to handle buffer flows between camera and
multiple consumers.

Test: cts, and manually test camera preview/snapshot/recording
Bug: 33777818
Change-Id: Ia010c3cc9d9b4bd5b9ea03cc42fe4e0a0d8033f1
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
52778d448123c185fd30cd77e84659fab966d740 23-Dec-2016 Yin-Chia Yeh <yinchiayeh@google.com> Camera: patching camera service for treble

Bug: 30985004
Change-Id: Idf3ec26abb6b10a0e3839e301e84c8b05ac165c5
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
0b1cb14c804d7d4343fe91c78578da8db9a678d5 20-Dec-2016 Eino-Ville Talvala <etalvala@google.com> Camera: Update camera service to use new HIDL HALs, part 2

- Use string for device ID in Camera3Device
- Remove camera3_device_t parameter from Camera3Stream::finishConfiguration
- Disables ability for the stream to register buffers
- This means device HALv3.0 and v3.1 are no longer supported
- Add HIDL support to Camera3Device:
- Add HalInterface class to abstract whether legacy or HIDL HAL is in use
- TODO
- CameraHardwareInterface
- Switch to using HIDL definitions instead of camera3.h definitions in
main body of code

Test: Compiles
Bug: 30985004
Bug: 32991422
Change-Id: I9c3c0f7b7ea5d1d74e14b1d882779e3b9445da69
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
2f09bac6632a5ee27ee14baa2aa1367f16b5b013 13-Dec-2016 Eino-Ville Talvala <etalvala@google.com> Camera: Update camera service to use new HIDL HALs, part 1

- Add CameraProviderManager
- Enumerates individual camera provider HAL instances, as well
as the devices they provide
- Handles dynamic provider and device appearance/disappearance
- Maps device names to public API namespace
- Add unit tests for CameraProviderManager
- Add logic to enable new HIDL path
- Switch various bits of service internals to use string camera IDs,
though leaving most camera1-facing bits using int IDs, since that's
what the old API uses.
- Update CameraService to use CameraProviderManager instead of
the legacy camera HAL
- Update clients to pass through provider manager to devices instead
of just camera module
- Still TODO:
- Update Camera3Device to use new HIDL interface
- Update CameraHardwareInterface to use new HIDL interface
- Update dump()
- Update vendor tag handling

Test: New unit tests pass, camera CTS passes with Treble disabled
Bug: 30985004
Bug: 32991422
Change-Id: I7ac41f13b9501d5e53256e28c0465ec70aa3980e
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
81d472ef3635bcf5cf05e4567f715c52f2cf3b22 17-Nov-2016 Jinguang Dong <dongjinguang@huawei.com> Merge "Camera3: Add missing mTriggerMutex lock" am: ad4663c5a5 am: fa43b5468f am: 51c4a65f5c
am: ce85a6975b

Change-Id: I0b2995ef33ae80eebb32085fd42a81d868aeb8aa
ce85a6975b2b416c8c267265f47ad32f924c0556 17-Nov-2016 Jinguang Dong <dongjinguang@huawei.com> Merge "Camera3: Add missing mTriggerMutex lock" am: ad4663c5a5 am: fa43b5468f
am: 51c4a65f5c

Change-Id: I0fbb1098a246db4dd2b0a6b9720dea275be23a42
fa43b5468f93af356297b5e2f381274d4b484ece 17-Nov-2016 Jinguang Dong <dongjinguang@huawei.com> Merge "Camera3: Add missing mTriggerMutex lock"
am: ad4663c5a5

Change-Id: I59b7de9cdd9f608afa503293947a19d3f11d533b
b26e7a07894882f8cef2c6b0127106e649f22d42 14-Nov-2016 Jinguang Dong <dongjinguang@huawei.com> Camera3: Add missing mTriggerMutex lock

There is thread safety problem for mTriggerMap in
Camera3Device::RequestThread::clear(). For correctness,
acquire mTriggerMutex before mTriggermap.clear().

Test: 1. Configure power saving mode to 2 seconds by
modification software;
2. using pyhon or monkey to turn on the screen every 4
second;
3. device doesn't crash any more on loop test.

Change-Id: I2f04e21dae3a9879d6cebfefb9d9c191ef3f4df4
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
c0fff7e64a3205ec7e91eae4cbd7926813ae70f8 08-Nov-2016 Shuzhen Wang <shuzhenwang@google.com> Camera: Clear not-yet-submitted request in cleanupFailedRequest am: cadb330fd8
am: cc621decd5

Change-Id: Ic14af20f08280a4196388230040f8762b149bb7e
cc621decd54f2d469925de20f33812f2464fc313 08-Nov-2016 Shuzhen Wang <shuzhenwang@google.com> Camera: Clear not-yet-submitted request in cleanupFailedRequest
am: cadb330fd8

Change-Id: I655bdce42c508734a671c0f6f9ae8b668b8b2593
cadb330fd8b51d17b548e913651d13376ac2e3a5 04-Nov-2016 Shuzhen Wang <shuzhenwang@google.com> Camera: Clear not-yet-submitted request in cleanupFailedRequest

In case request fails for a burst, previous not-yet-submitted
requests that are put into mInFlightMap are never taken out.
This causes waitUntilDrained error.

Bug: 32466355
Change-Id: Icd28d465dca3f850938c13058c916efc477b0d2b
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
9d06601e54848f076b7472a376c672215cd70c46 30-Sep-2016 Shuzhen Wang <shuzhenwang@google.com> Camera2: Add onCaptureQueueEmpty callback

onCaptureQueueEmpty is called when the non-repeating request queue in
cameraservice becomes empty. Application can use this callback as a
trigger for a new request.

Test: testMultipleCapture in PerformanceTest.java

Bug: 29006447
Change-Id: Id21afd74381e0b70f924c6026025c91a8ffd5ee0
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
f81b009d77466c5b3901d2c49b0fcc618e3d1592 02-Aug-2016 Zhijun He <zhijunhe@google.com> Camera3: don't let dequeueBuffer block indefinitely

The synchronous consumers (e.g. ImageReader) may be very slow when the
clients have computational intensive image processings. When system
load is high, these processing will be even much slower. This could
starve the producer side and then cause dequeue/attach buffer block
indefinitely. If clients intends to close the capture session, right
after a capture request is submitted, the waitUntil drain could be
blocked indefinitely if the capture request dequeue buffer call is
blocked indefinitely, as the request thread will never become idle until
the last dequeue buffer is done and the request is sent.This indefinite
getBuffer() blocking could easily trigger the waitUntilDrained 5s timeout
thus put the camera device into error state although there is nothing
bad happening in the HAL.

Introducing the timeout will avoid such bad situation. When consumer is
slow, there will be no new request being sent to HAL, as there is really
no new buffer available.

Bug:30404840
Change-Id: Ibf08d2745911203bce6f31130800707f36d7f985
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
0878ecfc07712e0caa83642fba55af928b173363 19-Aug-2016 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Wait for empty in-flight map when waiting for idle am: e4df8abe28
am: e890fa14d6

Change-Id: I9ed6eb856a29a512b0ae1ca04011e122108ab999
e890fa14d6ba103132b2faac60726fb0dd217962 19-Aug-2016 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Wait for empty in-flight map when waiting for idle
am: e4df8abe28

Change-Id: Ia0095a20f128fff93f1adda905f2a8d71369915d
0ddc1ddb41eafa8d2bcbbfe77e99f3e4a58b228c 17-Aug-2016 Zhijun He <zhijunhe@google.com> Camera3Device: add prop to disable sched fifo am: 90f7c37361 am: 601f677b6d
am: e3fd0d0c51

Change-Id: I95fe0665eb2e124759d46b71fe47670c1f653e72
e3fd0d0c51d81fdc3f7b6892f8f3f2f821065009 17-Aug-2016 Zhijun He <zhijunhe@google.com> Camera3Device: add prop to disable sched fifo am: 90f7c37361
am: 601f677b6d

Change-Id: I86b6da77822a5c2b71ea9c2b75349c3c1e4a5482
90f7c37361c22f86bd3d63d22c27fbea34c188e1 17-Aug-2016 Zhijun He <zhijunhe@google.com> Camera3Device: add prop to disable sched fifo

to disable sched fifo:
adb root
adb shell setprop camera.fifo.disable 1

Bug: 30898724

Change-Id: Ic3d1d15f9deb36b49e7d710d60fac969a98a1730
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
7bc559a13c14acb3e74ffc08fd0d898b4d494d4d 12-Aug-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of 70066d9 to stage-aosp-master am: 311f99eade
am: f671d5bbf8

Change-Id: I80d1494c33d33a5ebe784dd894148d90747ae726
311f99eade1222575bc65a2fcbd9f9a5a40d2024 12-Aug-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of 70066d9 to stage-aosp-master

Change-Id: I9af1ace904388c91e6ce885e8a6d3540eb57bb4a
5404ee174dd6b5e312d3a97bc63c2bc8d142012b 09-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in camera.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: I71d3008da843ba5f1df1a73a320fb2af6ceffa16
Merged-In: I71d3008da843ba5f1df1a73a320fb2af6ceffa16
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
8b0b971b1416738f22488a80be726d1ec12552a8 09-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in camera.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: I71d3008da843ba5f1df1a73a320fb2af6ceffa16
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
5a4af2945ab7557883a8b052915cd7dcf7825edc 09-Aug-2016 Yin-Chia Yeh <yinchiayeh@google.com> Camera: use wp for NotificationListener am: e1c8063521 am: ece9e36367
am: 04a0551e44

Change-Id: I2b2afca9cc6ff3bdbd98c1d2c325bdfa0b47627f
e1c8063521b0645b091b080d896106b2e6fd8670 08-Aug-2016 Yin-Chia Yeh <yinchiayeh@google.com> Camera: use wp for NotificationListener

Bug: 30737827
Change-Id: I01b8bee39fe329bf250b9179a84a8928d209a357
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
2f5f8bd49e8c2a4dc1698624ca81f162351cbeb6 02-Aug-2016 Zhijun He <zhijunhe@google.com> Camera3: don't let dequeueBuffer block indefinitely am: f0645c19a8 am: 1e8e893f8e
am: 4f370c878c

Change-Id: I7ece7f7b45f2a4f240cc89f7b3fbcc1d71945a26
f0645c19a8c8433766f4cb6edff7fca5db8017bf 02-Aug-2016 Zhijun He <zhijunhe@google.com> Camera3: don't let dequeueBuffer block indefinitely

The synchronous consumers (e.g. ImageReader) may be very slow when the
clients have computational intensive image processings. When system
load is high, these processing will be even much slower. This could
starve the producer side and then cause dequeue/attach buffer block
indefinitely. If clients intends to close the capture session, right
after a capture request is submitted, the waitUntil drain could be
blocked indefinitely if the capture request dequeue buffer call is
blocked indefinitely, as the request thread will never become idle until
the last dequeue buffer is done and the request is sent.This indefinite
getBuffer() blocking could easily trigger the waitUntilDrained 5s timeout
thus put the camera device into error state although there is nothing
bad happening in the HAL.

Introducing the timeout will avoid such bad situation. When consumer is
slow, there will be no new request being sent to HAL, as there is really
no new buffer available.

Bug:30404840
Change-Id: Ibf08d2745911203bce6f31130800707f36d7f985
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
58dc062f2a9e029a1ffceb98f109f44127533db9 27-Jul-2016 Zhijun He <zhijunhe@google.com> Camera3Device: make request thread SCHED_FIFO for all cases am: 7ee4c0778c
am: d22e96cc12

Change-Id: Ib511566ea5c63385cbafbe2d010e0a0a24c1a768
7ee4c0778c75a54cccf5ce82bd296e0dadcccb24 25-Jul-2016 Zhijun He <zhijunhe@google.com> Camera3Device: make request thread SCHED_FIFO for all cases

To mitigate the request thread CPU starvation for system highly loaded
situation.

Bug: 30357698
Bug: 28313712
Change-Id: Ied30103ce7245e139580219cce99d743b657307e
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
24b366ecd2d66af4fd6147c910460f2d68785b0f 21-Jul-2016 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Wait for empty in-flight map when waiting for idle

Currently we only wait for the request queue to be idle, and for
all outstanding buffers to be returned to their queues and their
fences triggered.

But we also need to wait for result metadata to arrive for all
in-flight requests. This is simplest to check for by monitoring
entries in the in-flight map and signaling idle/active to the
status tracker when the map becomes empty/nonempty.

Bug: 30282459
Change-Id: I34275b0fdb4f279783291d300707ac21a6aa5249
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
e4df8abe28ca2da39dcacc4f3396ba9aea7cfdb3 21-Jul-2016 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Wait for empty in-flight map when waiting for idle

Currently we only wait for the request queue to be idle, and for
all outstanding buffers to be returned to their queues and their
fences triggered.

But we also need to wait for result metadata to arrive for all
in-flight requests. This is simplest to check for by monitoring
entries in the in-flight map and signaling idle/active to the
status tracker when the map becomes empty/nonempty.

Bug: 30282459
Change-Id: I34275b0fdb4f279783291d300707ac21a6aa5249
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
4d453830b6a8fb7571a88a9a241eabd50a483c44 15-Jul-2016 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Add dumpsys monitoring of request/result metadata

Add new -m dumpsys option to cameraservice dump for monitoring
changes in selected metadata values in requests and results.

This option takes a comma-separated list of metadata keys, or the
shortcut value "3a", which expands to all the "android.control" tags.

In subsequent dumpsys calls, the last 100 changes to the tags being
monitored are listed.

The monitoring must be turned on once the camera device is running.

Bug:
Change-Id: If8938b30611ccafa86c2c4a06e57fc72680f827b
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
e8a984e43504890e0f676256a0445b9917a2af91 18-Jun-2016 Eino-Ville Talvala <etalvala@google.com> resolve merge conflicts of 77c1a35 to nyc-mr1-dev

Change-Id: I18c301c55904c06b3f6f5d8eaa2df47ff87ddb4f
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
2591f8308729b8f7b5d669d774cdac5636731535 14-Jun-2016 Chien-Yu Chen <cychen@google.com> Merge \"CameraDevice3: Fail stream configuration more gracefully\" into nyc-dev
am: 642c0275dc

Change-Id: I5a6eee36000d2f4f0666abb0189369ba20d8e44d
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
aedd66764b713c5e56e911f45a43a1a44d3dee70 03-Jun-2016 Chien-Yu Chen <cychen@google.com> Merge "Camera3Device: Prepare video stream for high speed" into nyc-dev
am: 86823e4d1f

* commit '86823e4d1fc81fabdf4baf95d7635768bb9677ba':
Camera3Device: Prepare video stream for high speed

Change-Id: Ia81057ad033d89a3e705c1d9ee661bd365853f19
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
5d677d1f0879d5101e38df480a38228a64d63959 30-May-2016 Zhijun He <zhijunhe@google.com> Camera3: add deferred surface support

Initial native implementation and aidl changes for surfaceless support.

Bug: 28323863
Change-Id: Id6634c3ef2ecc84422a88f63de0a19a0cb496e96
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
e9154ced1216ceb06a82140ed65051c0397e8abc 07-Dec-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: plumbing for RAW OPAQUE

Bug: 25596619
Change-Id: I0867a36962084bc508aebc89cb910473402a5e09
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
95a1d0f2fb1ea85c549ef8b869ab9ab52601d1db 12-Aug-2015 Eino-Ville Talvala <etalvala@google.com> Camera: Allocate correctly-sized buffers for DEPTH_POINT_CLOUD

Bug: 20537722
Change-Id: I9fa2fcdcfd41cd3370732c70414914993d3dc94e
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
b25e3c87724b6147ed1da7c1d6617c39bfce2fbf 16-Jul-2015 Eino-Ville Talvala <etalvala@google.com> Camera: Add hidden experimental tearDown method.

Bug: 18949148
Change-Id: Ie86ec7d1ec3db54e1154563b2339a208a935f849
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
1fa8999c91d5df81949aa723000058380cd3faa2 02-Jun-2015 Zhijun He <zhijunhe@google.com> Camera2: implement high speed video APIs

Bug: 21442271
Change-Id: Ia0ae5bbd3e8c81bad293c29987301a2457817d12
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
0336d3649f13506a7daf425690d225beac9d214f 14-Apr-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: allow non-supported template

Bug: 19395059
Change-Id: I42bbd99fef6055173062266c1a490311105c6814
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
b97babb8c08969b55af3b6456d15f764c8873d3f 12-Mar-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: plumbing rotation field through

Change-Id: I0f4343a0bfa7bf09ba887c78a1da1c08daa35333
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
e11ae4b2f7d38c8092e7c67ff06610165d866d98 01-May-2014 Zhijun He <zhijunhe@google.com> Camera3: Don't notifyError for non-fatal errors

Bug: 14448494
Change-Id: Ie2e2dc6a8475189707c556845adb77f20f270df5
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
2d6bb3f9e3e7cc1c7debbbe3d74bf9c70b6f39d4 11-Apr-2014 Jianing Wei <jianingwei@google.com> CameraService: fix race condition and wrong last frame number.

Change-Id: Ie2be9a77a0b074497615de38cbb8e8f13b4858ec
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
1e479c0f4cb3e2174dde0b02e5656fb658f73495 07-Sep-2013 Igor Murashkin <iam@google.com> camera3: Dump latest request sent with dumpsys

Bug: 10606535
Change-Id: I0dd5ca3e09f45701659ab9ebd3b51939a2f6e6ba
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp