diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-04-02 15:45:11 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-04-17 15:01:08 -0700 |
commit | 3ee3550a2f529cbf56d87d8503f59a8f45dccf32 (patch) | |
tree | 99bf718ddc0429a1319523abaae975d3305face3 /include/camera | |
parent | d72ec85d1d0b92ed82927e3925f21912a659b799 (diff) | |
download | frameworks_av-3ee3550a2f529cbf56d87d8503f59a8f45dccf32.zip frameworks_av-3ee3550a2f529cbf56d87d8503f59a8f45dccf32.tar.gz frameworks_av-3ee3550a2f529cbf56d87d8503f59a8f45dccf32.tar.bz2 |
Camera: Add preview callback surface support
- Add call to set a preview callback surface
- Implement support for HAL2/3 devices
- Still need HAL1 implementation
Change-Id: I0dc0bd72e43d871aa487858d1665c1efca633ffe
Diffstat (limited to 'include/camera')
-rw-r--r-- | include/camera/Camera.h | 8 | ||||
-rw-r--r-- | include/camera/ICamera.h | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/camera/Camera.h b/include/camera/Camera.h index 37626a4..c34b3ea 100644 --- a/include/camera/Camera.h +++ b/include/camera/Camera.h @@ -121,7 +121,15 @@ public: void setListener(const sp<CameraListener>& listener); void setRecordingProxyListener(const sp<ICameraRecordingProxyListener>& listener); + + // Configure preview callbacks to app. Only one of the older + // callbacks or the callback surface can be active at the same time; + // enabling one will disable the other if active. Flags can be + // disabled by calling it with CAMERA_FRAME_CALLBACK_FLAG_NOOP, and + // Target by calling it with a NULL interface. void setPreviewCallbackFlags(int preview_callback_flag); + status_t setPreviewCallbackTarget( + const sp<IGraphicBufferProducer>& callbackProducer); sp<ICameraRecordingProxy> getRecordingProxy(); diff --git a/include/camera/ICamera.h b/include/camera/ICamera.h index 2236c1f..b2125bd 100644 --- a/include/camera/ICamera.h +++ b/include/camera/ICamera.h @@ -51,8 +51,15 @@ public: const sp<IGraphicBufferProducer>& bufferProducer) = 0; // set the preview callback flag to affect how the received frames from - // preview are handled. + // preview are handled. Enabling preview callback flags disables any active + // preview callback surface set by setPreviewCallbackTarget(). virtual void setPreviewCallbackFlag(int flag) = 0; + // set a buffer interface to use for client-received preview frames instead + // of preview callback buffers. Passing a valid interface here disables any + // active preview callbacks set by setPreviewCallbackFlag(). Passing NULL + // disables the use of the callback target. + virtual status_t setPreviewCallbackTarget( + const sp<IGraphicBufferProducer>& callbackProducer) = 0; // start preview mode, must call setPreviewDisplay first virtual status_t startPreview() = 0; |