Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_SERVERS_CAMERA_CAMERA2DEVICE_H |
| 18 | #define ANDROID_SERVERS_CAMERA_CAMERA2DEVICE_H |
| 19 | |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 20 | #include <utils/Condition.h> |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 21 | #include <utils/Errors.h> |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 22 | #include <utils/List.h> |
| 23 | #include <utils/Mutex.h> |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 24 | |
Eino-Ville Talvala | 7b82efe | 2013-07-25 17:12:35 -0700 | [diff] [blame] | 25 | #include "common/CameraDeviceBase.h" |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 26 | |
| 27 | namespace android { |
| 28 | |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 29 | /** |
| 30 | * CameraDevice for HAL devices with version CAMERA_DEVICE_API_VERSION_2_0 |
Eino-Ville Talvala | f1e98d8 | 2013-09-06 09:32:43 -0700 | [diff] [blame] | 31 | * |
| 32 | * TODO for camera2 API implementation: |
| 33 | * Does not produce notifyShutter / notifyIdle callbacks to NotificationListener |
| 34 | * Use waitUntilDrained for idle. |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 35 | */ |
| 36 | class Camera2Device: public CameraDeviceBase { |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 37 | public: |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 38 | Camera2Device(int id); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 39 | |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 40 | virtual ~Camera2Device(); |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 41 | |
| 42 | /** |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 43 | * CameraDevice interface |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 44 | */ |
Igor Murashkin | 7138105 | 2013-03-04 14:53:08 -0800 | [diff] [blame] | 45 | virtual int getId() const; |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 46 | virtual status_t initialize(camera_module_t *module); |
| 47 | virtual status_t disconnect(); |
| 48 | virtual status_t dump(int fd, const Vector<String16>& args); |
| 49 | virtual const CameraMetadata& info() const; |
Jianing Wei | cb0652e | 2014-03-12 18:29:36 -0700 | [diff] [blame^] | 50 | virtual status_t capture(CameraMetadata &request, int64_t *lastFrameNumber = NULL); |
| 51 | virtual status_t captureList(const List<const CameraMetadata> &requests, |
| 52 | int64_t *lastFrameNumber = NULL); |
| 53 | virtual status_t setStreamingRequest(const CameraMetadata &request, |
| 54 | int64_t *lastFrameNumber = NULL); |
| 55 | virtual status_t setStreamingRequestList(const List<const CameraMetadata> &requests, |
| 56 | int64_t *lastFrameNumber = NULL); |
| 57 | virtual status_t clearStreamingRequest(int64_t *lastFrameNumber = NULL); |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 58 | virtual status_t waitUntilRequestReceived(int32_t requestId, nsecs_t timeout); |
| 59 | virtual status_t createStream(sp<ANativeWindow> consumer, |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 60 | uint32_t width, uint32_t height, int format, size_t size, |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 61 | int *id); |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 62 | virtual status_t createReprocessStreamFromStream(int outputId, int *id); |
| 63 | virtual status_t getStreamInfo(int id, |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 64 | uint32_t *width, uint32_t *height, uint32_t *format); |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 65 | virtual status_t setStreamTransform(int id, int transform); |
| 66 | virtual status_t deleteStream(int id); |
| 67 | virtual status_t deleteReprocessStream(int id); |
| 68 | virtual status_t createDefaultRequest(int templateId, CameraMetadata *request); |
| 69 | virtual status_t waitUntilDrained(); |
| 70 | virtual status_t setNotifyCallback(NotificationListener *listener); |
Eino-Ville Talvala | 46910bd | 2013-07-18 19:15:17 -0700 | [diff] [blame] | 71 | virtual bool willNotify3A(); |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 72 | virtual status_t waitForNextFrame(nsecs_t timeout); |
Jianing Wei | cb0652e | 2014-03-12 18:29:36 -0700 | [diff] [blame^] | 73 | virtual status_t getNextResult(CaptureResult *frame); |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 74 | virtual status_t triggerAutofocus(uint32_t id); |
| 75 | virtual status_t triggerCancelAutofocus(uint32_t id); |
| 76 | virtual status_t triggerPrecaptureMetering(uint32_t id); |
| 77 | virtual status_t pushReprocessBuffer(int reprocessStreamId, |
Eino-Ville Talvala | 69230df | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 78 | buffer_handle_t *buffer, wp<BufferReleasedListener> listener); |
Eino-Ville Talvala | abaa51d | 2013-08-14 11:37:00 -0700 | [diff] [blame] | 79 | // Flush implemented as just a wait |
Jianing Wei | cb0652e | 2014-03-12 18:29:36 -0700 | [diff] [blame^] | 80 | virtual status_t flush(int64_t *lastFrameNumber = NULL); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 81 | private: |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 82 | const int mId; |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 83 | camera2_device_t *mHal2Device; |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 84 | |
Eino-Ville Talvala | cab96a4 | 2012-08-24 11:29:22 -0700 | [diff] [blame] | 85 | CameraMetadata mDeviceInfo; |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * Queue class for both sending requests to a camera2 device, and for |
| 89 | * receiving frames from a camera2 device. |
| 90 | */ |
| 91 | class MetadataQueue: public camera2_request_queue_src_ops_t, |
| 92 | public camera2_frame_queue_dst_ops_t { |
| 93 | public: |
| 94 | MetadataQueue(); |
| 95 | ~MetadataQueue(); |
| 96 | |
| 97 | // Interface to camera2 HAL device, either for requests (device is |
| 98 | // consumer) or for frames (device is producer) |
| 99 | const camera2_request_queue_src_ops_t* getToConsumerInterface(); |
| 100 | void setFromConsumerInterface(camera2_device_t *d); |
| 101 | |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 102 | // Connect queue consumer endpoint to a camera2 device |
| 103 | status_t setConsumerDevice(camera2_device_t *d); |
| 104 | // Connect queue producer endpoint to a camera2 device |
| 105 | status_t setProducerDevice(camera2_device_t *d); |
| 106 | |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 107 | const camera2_frame_queue_dst_ops_t* getToProducerInterface(); |
| 108 | |
| 109 | // Real interfaces. On enqueue, queue takes ownership of buffer pointer |
| 110 | // On dequeue, user takes ownership of buffer pointer. |
| 111 | status_t enqueue(camera_metadata_t *buf); |
Eino-Ville Talvala | fbd6066 | 2012-10-16 10:28:07 -0700 | [diff] [blame] | 112 | status_t dequeue(camera_metadata_t **buf, bool incrementCount = false); |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 113 | int getBufferCount(); |
| 114 | status_t waitForBuffer(nsecs_t timeout); |
Eino-Ville Talvala | 4c9eb71 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 115 | // Wait until a buffer with the given ID is dequeued. Will return |
| 116 | // immediately if the latest buffer dequeued has that ID. |
| 117 | status_t waitForDequeue(int32_t id, nsecs_t timeout); |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 118 | |
| 119 | // Set repeating buffer(s); if the queue is empty on a dequeue call, the |
| 120 | // queue copies the contents of the stream slot into the queue, and then |
Eino-Ville Talvala | 6ed1ed1 | 2012-06-07 10:46:38 -0700 | [diff] [blame] | 121 | // dequeues the first new entry. The metadata buffers passed in are |
| 122 | // copied. |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 123 | status_t setStreamSlot(camera_metadata_t *buf); |
| 124 | status_t setStreamSlot(const List<camera_metadata_t*> &bufs); |
| 125 | |
Eino-Ville Talvala | abaa51d | 2013-08-14 11:37:00 -0700 | [diff] [blame] | 126 | // Clear the request queue and the streaming slot |
| 127 | status_t clear(); |
| 128 | |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 129 | status_t dump(int fd, const Vector<String16>& args); |
| 130 | |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 131 | private: |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 132 | status_t signalConsumerLocked(); |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 133 | status_t freeBuffers(List<camera_metadata_t*>::iterator start, |
| 134 | List<camera_metadata_t*>::iterator end); |
| 135 | |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 136 | camera2_device_t *mHal2Device; |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 137 | |
| 138 | Mutex mMutex; |
| 139 | Condition notEmpty; |
| 140 | |
| 141 | int mFrameCount; |
Eino-Ville Talvala | 4c9eb71 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 142 | int32_t mLatestRequestId; |
| 143 | Condition mNewRequestId; |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 144 | |
| 145 | int mCount; |
| 146 | List<camera_metadata_t*> mEntries; |
| 147 | int mStreamSlotCount; |
| 148 | List<camera_metadata_t*> mStreamSlot; |
| 149 | |
| 150 | bool mSignalConsumer; |
| 151 | |
| 152 | static MetadataQueue* getInstance( |
| 153 | const camera2_frame_queue_dst_ops_t *q); |
| 154 | static MetadataQueue* getInstance( |
| 155 | const camera2_request_queue_src_ops_t *q); |
| 156 | |
| 157 | static int consumer_buffer_count( |
| 158 | const camera2_request_queue_src_ops_t *q); |
| 159 | |
| 160 | static int consumer_dequeue(const camera2_request_queue_src_ops_t *q, |
| 161 | camera_metadata_t **buffer); |
| 162 | |
| 163 | static int consumer_free(const camera2_request_queue_src_ops_t *q, |
| 164 | camera_metadata_t *old_buffer); |
| 165 | |
| 166 | static int producer_dequeue(const camera2_frame_queue_dst_ops_t *q, |
| 167 | size_t entries, size_t bytes, |
| 168 | camera_metadata_t **buffer); |
| 169 | |
| 170 | static int producer_cancel(const camera2_frame_queue_dst_ops_t *q, |
| 171 | camera_metadata_t *old_buffer); |
| 172 | |
| 173 | static int producer_enqueue(const camera2_frame_queue_dst_ops_t *q, |
| 174 | camera_metadata_t *filled_buffer); |
| 175 | |
| 176 | }; // class MetadataQueue |
| 177 | |
| 178 | MetadataQueue mRequestQueue; |
| 179 | MetadataQueue mFrameQueue; |
| 180 | |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 181 | /** |
| 182 | * Adapter from an ANativeWindow interface to camera2 device stream ops. |
| 183 | * Also takes care of allocating/deallocating stream in device interface |
| 184 | */ |
| 185 | class StreamAdapter: public camera2_stream_ops, public virtual RefBase { |
| 186 | public: |
| 187 | StreamAdapter(camera2_device_t *d); |
| 188 | |
| 189 | ~StreamAdapter(); |
| 190 | |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 191 | /** |
| 192 | * Create a HAL device stream of the requested size and format. |
| 193 | * |
| 194 | * If format is CAMERA2_HAL_PIXEL_FORMAT_OPAQUE, then the HAL device |
| 195 | * selects an appropriate format; it can be queried with getFormat. |
| 196 | * |
| 197 | * If format is HAL_PIXEL_FORMAT_COMPRESSED, the size parameter must |
| 198 | * be equal to the size in bytes of the buffers to allocate for the |
| 199 | * stream. For other formats, the size parameter is ignored. |
| 200 | */ |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 201 | status_t connectToDevice(sp<ANativeWindow> consumer, |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 202 | uint32_t width, uint32_t height, int format, size_t size); |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 203 | |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 204 | status_t release(); |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 205 | |
Eino-Ville Talvala | c94cd19 | 2012-06-15 12:47:42 -0700 | [diff] [blame] | 206 | status_t setTransform(int transform); |
| 207 | |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 208 | // Get stream parameters. |
| 209 | // Only valid after a successful connectToDevice call. |
| 210 | int getId() const { return mId; } |
| 211 | uint32_t getWidth() const { return mWidth; } |
| 212 | uint32_t getHeight() const { return mHeight; } |
| 213 | uint32_t getFormat() const { return mFormat; } |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 214 | |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 215 | // Dump stream information |
| 216 | status_t dump(int fd, const Vector<String16>& args); |
| 217 | |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 218 | private: |
| 219 | enum { |
| 220 | ERROR = -1, |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 221 | RELEASED = 0, |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 222 | ALLOCATED, |
| 223 | CONNECTED, |
| 224 | ACTIVE |
| 225 | } mState; |
| 226 | |
| 227 | sp<ANativeWindow> mConsumerInterface; |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 228 | camera2_device_t *mHal2Device; |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 229 | |
| 230 | uint32_t mId; |
| 231 | uint32_t mWidth; |
| 232 | uint32_t mHeight; |
| 233 | uint32_t mFormat; |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 234 | size_t mSize; |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 235 | uint32_t mUsage; |
| 236 | uint32_t mMaxProducerBuffers; |
| 237 | uint32_t mMaxConsumerBuffers; |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 238 | uint32_t mTotalBuffers; |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 239 | int mFormatRequested; |
| 240 | |
Eino-Ville Talvala | 3297daa | 2012-06-14 10:49:45 -0700 | [diff] [blame] | 241 | /** Debugging information */ |
| 242 | uint32_t mActiveBuffers; |
| 243 | uint32_t mFrameCount; |
| 244 | int64_t mLastTimestamp; |
| 245 | |
Eino-Ville Talvala | 6db981c | 2012-05-21 18:54:30 -0700 | [diff] [blame] | 246 | const camera2_stream_ops *getStreamOps(); |
| 247 | |
| 248 | static ANativeWindow* toANW(const camera2_stream_ops_t *w); |
| 249 | |
| 250 | static int dequeue_buffer(const camera2_stream_ops_t *w, |
| 251 | buffer_handle_t** buffer); |
| 252 | |
| 253 | static int enqueue_buffer(const camera2_stream_ops_t* w, |
| 254 | int64_t timestamp, |
| 255 | buffer_handle_t* buffer); |
| 256 | |
| 257 | static int cancel_buffer(const camera2_stream_ops_t* w, |
| 258 | buffer_handle_t* buffer); |
| 259 | |
| 260 | static int set_crop(const camera2_stream_ops_t* w, |
| 261 | int left, int top, int right, int bottom); |
| 262 | }; // class StreamAdapter |
| 263 | |
| 264 | typedef List<sp<StreamAdapter> > StreamList; |
| 265 | StreamList mStreams; |
| 266 | |
Eino-Ville Talvala | 69230df | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 267 | /** |
| 268 | * Adapter from an ANativeWindow interface to camera2 device stream ops. |
| 269 | * Also takes care of allocating/deallocating stream in device interface |
| 270 | */ |
| 271 | class ReprocessStreamAdapter: public camera2_stream_in_ops, public virtual RefBase { |
| 272 | public: |
| 273 | ReprocessStreamAdapter(camera2_device_t *d); |
| 274 | |
| 275 | ~ReprocessStreamAdapter(); |
| 276 | |
| 277 | /** |
| 278 | * Create a HAL device reprocess stream based on an existing output stream. |
| 279 | */ |
| 280 | status_t connectToDevice(const sp<StreamAdapter> &outputStream); |
| 281 | |
| 282 | status_t release(); |
| 283 | |
| 284 | /** |
| 285 | * Push buffer into stream for reprocessing. Takes ownership until it notifies |
| 286 | * that the buffer has been released |
| 287 | */ |
| 288 | status_t pushIntoStream(buffer_handle_t *handle, |
| 289 | const wp<BufferReleasedListener> &releaseListener); |
| 290 | |
| 291 | /** |
| 292 | * Get stream parameters. |
| 293 | * Only valid after a successful connectToDevice call. |
| 294 | */ |
| 295 | int getId() const { return mId; } |
| 296 | uint32_t getWidth() const { return mWidth; } |
| 297 | uint32_t getHeight() const { return mHeight; } |
| 298 | uint32_t getFormat() const { return mFormat; } |
| 299 | |
| 300 | // Dump stream information |
| 301 | status_t dump(int fd, const Vector<String16>& args); |
| 302 | |
| 303 | private: |
| 304 | enum { |
| 305 | ERROR = -1, |
| 306 | RELEASED = 0, |
| 307 | ACTIVE |
| 308 | } mState; |
| 309 | |
| 310 | sp<ANativeWindow> mConsumerInterface; |
| 311 | wp<StreamAdapter> mBaseStream; |
| 312 | |
| 313 | struct QueueEntry { |
| 314 | buffer_handle_t *handle; |
| 315 | wp<BufferReleasedListener> releaseListener; |
| 316 | }; |
| 317 | |
| 318 | List<QueueEntry> mQueue; |
| 319 | |
| 320 | List<QueueEntry> mInFlightQueue; |
| 321 | |
Eino-Ville Talvala | 7fa43f3 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 322 | camera2_device_t *mHal2Device; |
Eino-Ville Talvala | 69230df | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 323 | |
| 324 | uint32_t mId; |
| 325 | uint32_t mWidth; |
| 326 | uint32_t mHeight; |
| 327 | uint32_t mFormat; |
| 328 | |
| 329 | /** Debugging information */ |
| 330 | uint32_t mActiveBuffers; |
| 331 | uint32_t mFrameCount; |
| 332 | int64_t mLastTimestamp; |
| 333 | |
| 334 | const camera2_stream_in_ops *getStreamOps(); |
| 335 | |
| 336 | static int acquire_buffer(const camera2_stream_in_ops_t *w, |
| 337 | buffer_handle_t** buffer); |
| 338 | |
| 339 | static int release_buffer(const camera2_stream_in_ops_t* w, |
| 340 | buffer_handle_t* buffer); |
| 341 | |
| 342 | }; // class ReprocessStreamAdapter |
| 343 | |
| 344 | typedef List<sp<ReprocessStreamAdapter> > ReprocessStreamList; |
| 345 | ReprocessStreamList mReprocessStreams; |
| 346 | |
Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 347 | // Receives HAL notifications and routes them to the NotificationListener |
| 348 | static void notificationCallback(int32_t msg_type, |
| 349 | int32_t ext1, |
| 350 | int32_t ext2, |
| 351 | int32_t ext3, |
| 352 | void *user); |
| 353 | |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 354 | }; // class Camera2Device |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 355 | |
| 356 | }; // namespace android |
| 357 | |
| 358 | #endif |