Igor Murashkin | e7ee763 | 2013-06-11 18:10:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 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_HARDWARE_PHOTOGRAPHY_ICAMERADEVICEUSER_H |
| 18 | #define ANDROID_HARDWARE_PHOTOGRAPHY_ICAMERADEVICEUSER_H |
| 19 | |
| 20 | #include <binder/IInterface.h> |
| 21 | #include <binder/Parcel.h> |
| 22 | |
| 23 | struct camera_metadata; |
| 24 | |
| 25 | namespace android { |
| 26 | |
| 27 | class ICameraDeviceUserClient; |
| 28 | class IGraphicBufferProducer; |
| 29 | class Surface; |
| 30 | class CaptureRequest; |
| 31 | class CameraMetadata; |
| 32 | |
| 33 | class ICameraDeviceUser : public IInterface |
| 34 | { |
| 35 | /** |
| 36 | * Keep up-to-date with ICameraDeviceUser.aidl in frameworks/base |
| 37 | */ |
| 38 | public: |
| 39 | DECLARE_META_INTERFACE(CameraDeviceUser); |
| 40 | |
| 41 | virtual void disconnect() = 0; |
| 42 | |
| 43 | /** |
| 44 | * Request Handling |
| 45 | **/ |
| 46 | |
| 47 | virtual int submitRequest(sp<CaptureRequest> request, |
| 48 | bool streaming = false) = 0; |
| 49 | virtual status_t cancelRequest(int requestId) = 0; |
| 50 | |
| 51 | virtual status_t deleteStream(int streamId) = 0; |
| 52 | virtual status_t createStream( |
| 53 | int width, int height, int format, |
| 54 | const sp<IGraphicBufferProducer>& bufferProducer) = 0; |
| 55 | |
| 56 | // Create a request object from a template. |
| 57 | virtual status_t createDefaultRequest(int templateId, |
| 58 | /*out*/ |
| 59 | CameraMetadata* request) = 0; |
| 60 | // Get static camera metadata |
Igor Murashkin | 099b457 | 2013-07-12 17:52:16 -0700 | [diff] [blame] | 61 | virtual status_t getCameraInfo(/*out*/ |
| 62 | CameraMetadata* info) = 0; |
Igor Murashkin | e7ee763 | 2013-06-11 18:10:18 -0700 | [diff] [blame] | 63 | |
Zhijun He | 2ab500c | 2013-07-23 08:02:53 -0700 | [diff] [blame^] | 64 | // Wait until all the submitted requests have finished processing |
| 65 | virtual status_t waitUntilIdle() = 0; |
Igor Murashkin | e7ee763 | 2013-06-11 18:10:18 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | // ---------------------------------------------------------------------------- |
| 69 | |
| 70 | class BnCameraDeviceUser: public BnInterface<ICameraDeviceUser> |
| 71 | { |
| 72 | public: |
| 73 | virtual status_t onTransact( uint32_t code, |
| 74 | const Parcel& data, |
| 75 | Parcel* reply, |
| 76 | uint32_t flags = 0); |
| 77 | }; |
| 78 | |
| 79 | }; // namespace android |
| 80 | |
| 81 | #endif |