Skip to content

Most visited

Recently visited

navigation

ACameraCaptureSession_captureCallbacks Struct Reference

ACameraCaptureSession_captureCallbacks Struct Reference

#include <NdkCameraCaptureSession.h>

Data Fields

void * context
 optional application context. More...
 
ACameraCaptureSession_captureCallback_start onCaptureStarted
 
ACameraCaptureSession_captureCallback_result onCaptureProgressed
 
ACameraCaptureSession_captureCallback_result onCaptureCompleted
 
ACameraCaptureSession_captureCallback_failed onCaptureFailed
 
ACameraCaptureSession_captureCallback_sequenceEnd onCaptureSequenceCompleted
 
ACameraCaptureSession_captureCallback_sequenceAbort onCaptureSequenceAborted
 
ACameraCaptureSession_captureCallback_bufferLost onCaptureBufferLost
 

Field Documentation

§ context

void* context

optional application context.

§ onCaptureBufferLost

This callback is called if a single buffer for a capture could not be sent to its destination ANativeWindow.

If the whole capture failed, then onCaptureFailed will be called instead. If some but not all buffers were captured but the result metadata will not be available, then onCaptureFailed will be invoked with ACameraCaptureFailure#wasImageCaptured returning true, along with one or more calls to onCaptureBufferLost for the failed outputs.

Note that the ACaptureRequest pointer in the callback will not match what application has submitted, but the contents the ACaptureRequest will match what application submitted. The ANativeWindow pointer will always match what application submitted in ACameraDevice_createCaptureSession

§ onCaptureCompleted

This callback is called when an image capture has fully completed and all the result metadata is available.

This callback will always fire after the last onCaptureProgressed; in other words, no more partial results will be delivered once the completed result is available.

For performance-intensive use-cases where latency is a factor, consider using onCaptureProgressed instead.

Note that the ACaptureRequest pointer in the callback will not match what application has submitted, but the contents the ACaptureRequest will match what application submitted.

§ onCaptureFailed

This callback is called instead of onCaptureCompleted when the camera device failed to produce a capture result for the request.

Other requests are unaffected, and some or all image buffers from the capture may have been pushed to their respective output streams.

Note that the ACaptureRequest pointer in the callback will not match what application has submitted, but the contents the ACaptureRequest will match what application submitted.

See also
ACameraCaptureFailure

§ onCaptureProgressed

This callback is called when an image capture makes partial forward progress; some (but not all) results from an image capture are available.

The result provided here will contain some subset of the fields of a full result. Multiple onCaptureProgressed calls may happen per capture; a given result field will only be present in one partial capture at most. The final onCaptureCompleted call will always contain all the fields (in particular, the union of all the fields of all the partial results composing the total result).

For each request, some result data might be available earlier than others. The typical delay between each partial result (per request) is a single frame interval. For performance-oriented use-cases, applications should query the metadata they need to make forward progress from the partial results and avoid waiting for the completed result.

For a particular request, onCaptureProgressed may happen before or after onCaptureStarted.

Each request will generate at least 1 partial results, and at most ACAMERA_REQUEST_PARTIAL_RESULT_COUNT partial results.

Depending on the request settings, the number of partial results per request will vary, although typically the partial count could be the same as long as the camera device subsystems enabled stay the same.

Note that the ACaptureRequest pointer in the callback will not match what application has submitted, but the contents the ACaptureRequest will match what application submitted.

§ onCaptureSequenceAborted

This callback is called independently of the others in ACameraCaptureSession_captureCallbacks, when a capture sequence aborts before any capture result or capture failure for it have been returned via this ACameraCaptureSession_captureCallbacks.

Due to the asynchronous nature of the camera device, not all submitted captures are immediately processed. It is possible to clear out the pending requests by a variety of operations such as ACameraCaptureSession_stopRepeating or ACameraCaptureSession_abortCaptures. When such an event happens, onCaptureSequenceCompleted will not be called.

§ onCaptureSequenceCompleted

This callback is called independently of the others in ACameraCaptureSession_captureCallbacks, when a capture sequence finishes and all capture result or capture failure for it have been returned via this ACameraCaptureSession_captureCallbacks.

In total, there will be at least one result/failure returned by this listener before this callback is invoked. If the capture sequence is aborted before any requests have been processed, onCaptureSequenceAborted is invoked instead.

§ onCaptureStarted

This callback is called when the camera device has started capturing the output image for the request, at the beginning of image exposure.

This callback is invoked right as the capture of a frame begins, so it is the most appropriate time for playing a shutter sound, or triggering UI indicators of capture.

The request that is being used for this capture is provided, along with the actual timestamp for the start of exposure. This timestamp matches the timestamps that will be included in ACAMERA_SENSOR_TIMESTAMP of the ACameraMetadata in onCaptureCompleted callback, and in the buffers sent to each output ANativeWindow. These buffer timestamps are accessible through, for example, AImage_getTimestamp or android.graphics.SurfaceTexture::getTimestamp().

Note that the ACaptureRequest pointer in the callback will not match what application has submitted, but the contents the ACaptureRequest will match what application submitted.


The documentation for this struct was generated from the following file:
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)