Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [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 | |
Eino-Ville Talvala | 2f1a2e4 | 2013-07-25 17:12:05 -0700 | [diff] [blame] | 17 | package android.hardware.camera2; |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 18 | |
| 19 | import android.view.Surface; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 20 | import android.hardware.camera2.impl.CameraMetadataNative; |
Eino-Ville Talvala | 2f1a2e4 | 2013-07-25 17:12:05 -0700 | [diff] [blame] | 21 | import android.hardware.camera2.CaptureRequest; |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 22 | |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 23 | import android.hardware.camera2.utils.LongParcelable; |
Jianing Wei | d2c3a82 | 2014-03-27 18:27:43 -0700 | [diff] [blame] | 24 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 25 | /** @hide */ |
| 26 | interface ICameraDeviceUser |
| 27 | { |
| 28 | /** |
Ruben Brunk | feb50af | 2014-05-09 19:58:49 -0700 | [diff] [blame^] | 29 | * Keep up-to-date with frameworks/av/include/camera/camera2/ICameraDeviceUser.h and |
| 30 | * frameworks/base/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 31 | */ |
| 32 | void disconnect(); |
| 33 | |
| 34 | // ints here are status_t |
| 35 | |
| 36 | // non-negative value is the requestId. negative value is status_t |
Jianing Wei | d2c3a82 | 2014-03-27 18:27:43 -0700 | [diff] [blame] | 37 | int submitRequest(in CaptureRequest request, boolean streaming, |
| 38 | out LongParcelable lastFrameNumber); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 39 | |
Jianing Wei | d2c3a82 | 2014-03-27 18:27:43 -0700 | [diff] [blame] | 40 | int submitRequestList(in List<CaptureRequest> requestList, boolean streaming, |
| 41 | out LongParcelable lastFrameNumber); |
| 42 | |
| 43 | int cancelRequest(int requestId, out LongParcelable lastFrameNumber); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 44 | |
Ruben Brunk | feb50af | 2014-05-09 19:58:49 -0700 | [diff] [blame^] | 45 | /** |
| 46 | * Begin the device configuration. |
| 47 | * |
| 48 | * <p> |
| 49 | * beginConfigure must be called before any call to deleteStream, createStream, |
| 50 | * or endConfigure. It is not valid to call this when the device is not idle. |
| 51 | * <p> |
| 52 | */ |
| 53 | int beginConfigure(); |
| 54 | |
| 55 | /** |
| 56 | * End the device configuration. |
| 57 | * |
| 58 | * <p> |
| 59 | * endConfigure must be called after stream configuration is complete (i.e. after |
| 60 | * a call to beginConfigure and subsequent createStream/deleteStream calls). This |
| 61 | * must be called before any requests can be submitted. |
| 62 | * <p> |
| 63 | */ |
| 64 | int endConfigure(); |
| 65 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 66 | int deleteStream(int streamId); |
| 67 | |
| 68 | // non-negative value is the stream ID. negative value is status_t |
| 69 | int createStream(int width, int height, int format, in Surface surface); |
| 70 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 71 | int createDefaultRequest(int templateId, out CameraMetadataNative request); |
Igor Murashkin | d7bf177 | 2013-07-12 18:01:31 -0700 | [diff] [blame] | 72 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 73 | int getCameraInfo(out CameraMetadataNative info); |
Zhijun He | 7f4d314 | 2013-07-23 07:54:38 -0700 | [diff] [blame] | 74 | |
| 75 | int waitUntilIdle(); |
Eino-Ville Talvala | 8ebd52b | 2013-08-13 12:09:44 -0700 | [diff] [blame] | 76 | |
Jianing Wei | d2c3a82 | 2014-03-27 18:27:43 -0700 | [diff] [blame] | 77 | int flush(out LongParcelable lastFrameNumber); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 78 | } |