History log of /frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
91cd3f89bee99f1a982f1950091bcf578f9a1529 22-Aug-2017 Eino-Ville Talvala <etalvala@google.com> Camera service: Add support for camera.device@3.3

Support overriding the dataSpace field if the HAL does so.

Test: Camera CTS passes
Bug: 62358514
Change-Id: I4c22237ebbf8c54afc0d0b202098f6530d8ec7f8
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
710c142d6a83a5f96cd34e4209bd9cac2f4c6639 30-Aug-2017 Emilian Peev <epeev@google.com> Camera: Avoid stream re-configuration when format gets overridden

It is allowed and expected some stream formats to get overriden
by the Hal implementation. In such cases the original format should
be stored and made available to device clients.

Bug: 64571102
Test: Camera CTS
Change-Id: Ic1153390e0c4d194475fbda8c8a13323bd7e73c0
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
050f5dcf7d1903926b165ebdd2dd30f7a2e83c02 18-May-2017 Emilian Peev <epeev@google.com> Camera: Switch usage flags to 64-bit unsigned

Usage flags should use 64-bit unsigned values.

Bug: 35215313
Test: Camera CTS
Change-Id: Ib8d8ec07e16698e34183c3e54498ad7491348087
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
889234d4b84ef011c21e28be51ff614231603a06 19-Jul-2017 Emilian Peev <epeev@google.com> Camera: Avoid freeing outstanding input buffers

The producer end can disconnect at any time which
will trigger the freeing of the input buffer. If
any input buffers are outstanding and being processed
by the camera device freeing them can cause stability
issues.

Bug: 63682712
Test: Manual using application.
Change-Id: I25da97786d75e82b1b13dce34953de597bea9b2e
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
32ab0585ffe4c84fa9b873ab2a51ed977d70b02f 17-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Camera: fix bufferFreed callback object lifecycle issue" into oc-dr1-dev
1c484a65f1afeec8e4bf2aecbeab9df103f14c85 15-Jul-2017 Shuzhen Wang <shuzhenwang@google.com> Camera: Fix "use after free" for mOutstandingBuffers

Fix below use after free issues:

==4947==ERROR: AddressSanitizer: heap-use-after-free on address
0xec61f434 at pc 0xf1954c18 bp 0xed3ff6f0 sp 0xed3ff6e8
READ of size 4 at 0xec61f434 thread T12 (C3Dev-1-ReqQueu)
#0 0xf1954c17 in _ZN7android7camera313Camera3Stream23removeOutstandingBufferERK21camera3_stream_buffer
frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp:508
#1 0xf1954c17 in _ZN7android7camera313Camera3Stream12returnBufferERK21camera3_stream_bufferx
frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp:543
#2 0xf193c663 in _ZN7android13Camera3Device13RequestThread21cleanUpFailedRequestsEb
frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp:4131
#3 0xf193db5b in _ZN7android13Camera3Device13RequestThread10threadLoopEv
frameworks/av/services/camera/libcameraservice/device3/Camera3Device.cpp:3854
#4 0xf1562f35 in _ZN7android6Thread11_threadLoopEPv system/core/libutils/Threads.cpp:747
#5 0xf0ee6947 in _ZL15__pthread_startPv bionic/libc/bionic/pthread_create.cpp:214
#6 0xf0eba381 in __start_thread bionic/libc/bionic/clone.cpp:47

0xec61f434 is located 68 bytes inside of 136-byte region [0xec61f3f0,0xec61f478)
freed by thread T0 here:
#7 0xf1a64963 in _ZdlPvSt11align_val_tRKSt9nothrow_t [asan_rtl]
#8 0xf155df09 in _ZNK7android7RefBase9decStrongEPKv system/core/libutils/RefBase.cpp:435
#9 0xf19693ab in _ZN7android7camera319Camera3OutputStream22BufferReleasedListener16onBufferReleasedEv
frameworks/av/services/camera/libcameraservice/device3/Camera3OutputStream.cpp:720
#3 0x1ff56dfb (<unknown module>)

Bug: 62218367
Change-Id: Ib03415f73a1e3c283520af752904b1bcc40bff28
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
db1e864daf162007341d6715094330c13bf5482f 15-Jul-2017 Yin-Chia Yeh <yinchiayeh@google.com> Camera: fix bufferFreed callback object lifecycle issue

Make sure the callback object won't be freed in the middle
of callback execution.

Test: CTS + stress test
Bug: 63683767
Change-Id: I6fb1b754cadb3d499c1c246687d2f60d444d00bb
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
ba435258270476d7931329dc0239bdc468e9ddbd 22-Jun-2017 Eino-Ville Talvala <etalvala@google.com> Camera: Device 3: Ignore buffer limits when clearing request queue

When abortCaptures is called, the request queue is cleared; as part of that,
any requests with input buffers trigger the removal and return of one input
buffer from the input stream.

However, if the HAL currently is processing some number of reprocess
requests, the stream's max buffer limit may have been reached, in
which case getInputBuffer will block until the HAL returns an input
buffer. This stalls flushing (and calling of capture_request) for
some time, and seems to cause problems for the HAL during the flush.

So instead, don't respect the HAL's max buffer limit when all we're
doing is throwing work away.

Test: CTS, manual testing
Bug: 62420820
Change-Id: I72d8cdaf67fb3cc6876a03cee9e0021d95cecdfe
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
686f644f981badd481d8781bf80b221544df7b1f 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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.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/Camera3Stream.cpp
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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.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/Camera3Stream.cpp
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/Camera3Stream.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/Camera3Stream.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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/Camera3Stream.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.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/Camera3Stream.cpp
13c878f07fb36a49aade20cec684ed8e12724751 06-May-2014 Zhijun He <zhijunhe@google.com> Camera3: fix missing string in logging code

Change-Id: I15da6bb8b586b4641837f42d2145530fb45dd0bd
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.cpp
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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.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/Camera3Stream.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/Camera3Stream.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
/frameworks/av/services/camera/libcameraservice/device3/Camera3Stream.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/Camera3Stream.cpp