diff options
author | Jianing Wei <jianingwei@google.com> | 2014-03-12 18:29:36 -0700 |
---|---|---|
committer | Jianing Wei <jianingwei@google.com> | 2014-04-10 11:54:08 -0700 |
commit | cb0652e5a850b2fcd919e977247e87239efaf70e (patch) | |
tree | bdba4ac95dedd4ad9be77b9f5a86e147c11224f3 /include/camera/camera2 | |
parent | d27368f7d28813f7dad37fc31940c822df80e68e (diff) | |
download | frameworks_av-cb0652e5a850b2fcd919e977247e87239efaf70e.zip frameworks_av-cb0652e5a850b2fcd919e977247e87239efaf70e.tar.gz frameworks_av-cb0652e5a850b2fcd919e977247e87239efaf70e.tar.bz2 |
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
Diffstat (limited to 'include/camera/camera2')
-rw-r--r-- | include/camera/camera2/ICameraDeviceCallbacks.h | 12 | ||||
-rw-r--r-- | include/camera/camera2/ICameraDeviceUser.h | 38 |
2 files changed, 42 insertions, 8 deletions
diff --git a/include/camera/camera2/ICameraDeviceCallbacks.h b/include/camera/camera2/ICameraDeviceCallbacks.h index 8dac4f2..f059b3d 100644 --- a/include/camera/camera2/ICameraDeviceCallbacks.h +++ b/include/camera/camera2/ICameraDeviceCallbacks.h @@ -24,9 +24,12 @@ #include <utils/Timers.h> #include <system/camera.h> +#include <camera/CaptureResult.h> + namespace android { class CameraMetadata; + class ICameraDeviceCallbacks : public IInterface { /** @@ -45,18 +48,19 @@ public: }; // One way - virtual void onDeviceError(CameraErrorCode errorCode) = 0; + virtual void onDeviceError(CameraErrorCode errorCode, + const CaptureResultExtras& resultExtras) = 0; // One way virtual void onDeviceIdle() = 0; // One way - virtual void onCaptureStarted(int32_t requestId, + virtual void onCaptureStarted(const CaptureResultExtras& resultExtras, int64_t timestamp) = 0; // One way - virtual void onResultReceived(int32_t requestId, - const CameraMetadata& result) = 0; + virtual void onResultReceived(const CameraMetadata& metadata, + const CaptureResultExtras& resultExtras) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/camera/camera2/ICameraDeviceUser.h b/include/camera/camera2/ICameraDeviceUser.h index f71f302..49daf69 100644 --- a/include/camera/camera2/ICameraDeviceUser.h +++ b/include/camera/camera2/ICameraDeviceUser.h @@ -19,6 +19,7 @@ #include <binder/IInterface.h> #include <binder/Parcel.h> +#include <utils/List.h> struct camera_metadata; @@ -44,9 +45,34 @@ public: * Request Handling **/ + /** + * For streaming requests, output lastFrameNumber is the last frame number + * of the previous repeating request. + * For non-streaming requests, output lastFrameNumber is the expected last + * frame number of the current request. + */ virtual int submitRequest(sp<CaptureRequest> request, - bool streaming = false) = 0; - virtual status_t cancelRequest(int requestId) = 0; + bool streaming = false, + /*out*/ + int64_t* lastFrameNumber = NULL) = 0; + + /** + * For streaming requests, output lastFrameNumber is the last frame number + * of the previous repeating request. + * For non-streaming requests, output lastFrameNumber is the expected last + * frame number of the current request. + */ + virtual int submitRequestList(List<sp<CaptureRequest> > requestList, + bool streaming = false, + /*out*/ + int64_t* lastFrameNumber = NULL) = 0; + + /** + * Output lastFrameNumber is the last frame number of the previous repeating request. + */ + virtual status_t cancelRequest(int requestId, + /*out*/ + int64_t* lastFrameNumber = NULL) = 0; virtual status_t deleteStream(int streamId) = 0; virtual status_t createStream( @@ -64,8 +90,12 @@ public: // Wait until all the submitted requests have finished processing virtual status_t waitUntilIdle() = 0; - // Flush all pending and in-progress work as quickly as possible. - virtual status_t flush() = 0; + /** + * Flush all pending and in-progress work as quickly as possible. + * Output lastFrameNumber is the last frame number of the previous repeating request. + */ + virtual status_t flush(/*out*/ + int64_t* lastFrameNumber = NULL) = 0; }; // ---------------------------------------------------------------------------- |