Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 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 | /* |
| 18 | * This file defines an NDK API. |
| 19 | * Do not remove methods. |
| 20 | * Do not change method signatures. |
| 21 | * Do not change the value of constants. |
| 22 | * Do not change the size of any of the classes defined in here. |
| 23 | * Do not reference types that are not part of the NDK. |
| 24 | * Do not #include files that aren't part of the NDK. |
| 25 | */ |
| 26 | #include <android/native_window.h> |
| 27 | #include "NdkCameraError.h" |
| 28 | #include "NdkCameraMetadata.h" |
| 29 | |
| 30 | #ifndef _NDK_CAPTURE_REQUEST_H |
| 31 | #define _NDK_CAPTURE_REQUEST_H |
| 32 | |
| 33 | #ifdef __cplusplus |
| 34 | extern "C" { |
| 35 | #endif |
| 36 | |
| 37 | // Container for output targets |
| 38 | typedef struct ACameraOutputTargets ACameraOutputTargets; |
| 39 | |
| 40 | // Container for a single output target |
| 41 | typedef struct ACameraOutputTarget ACameraOutputTarget; |
| 42 | |
| 43 | typedef struct ACaptureRequest ACaptureRequest; |
| 44 | |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame^] | 45 | camera_status_t ACameraOutputTarget_create(ANativeWindow* window, ACameraOutputTarget** out); |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 46 | void ACameraOutputTarget_free(ACameraOutputTarget*); |
| 47 | |
| 48 | camera_status_t ACaptureRequest_addTarget(ACaptureRequest*, const ACameraOutputTarget*); |
| 49 | camera_status_t ACaptureRequest_removeTarget(ACaptureRequest*, const ACameraOutputTarget*); |
Yin-Chia Yeh | ead9146 | 2016-01-06 16:45:08 -0800 | [diff] [blame^] | 50 | //TODO: do we need API to query added targets? |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 51 | |
| 52 | /* |
| 53 | * Get a metadata entry |
| 54 | */ |
| 55 | camera_status_t ACaptureRequest_getConstEntry( |
| 56 | const ACaptureRequest*, uint32_t tag, ACameraMetadata_const_entry* entry); |
| 57 | /* |
| 58 | * Set an entry of corresponding type. |
| 59 | * The entry tag's type must match corresponding set API or an |
| 60 | * ACAMERA_ERROR_INVALID_PARAMETER error will occur. |
| 61 | * Also, the input ACameraMetadata* must belong to a capture request or an |
| 62 | * ACAMERA_ERROR_INVALID_PARAMETER error will occur. |
| 63 | */ |
| 64 | camera_status_t ACaptureRequest_setEntry_u8( |
| 65 | ACaptureRequest*, uint32_t tag, uint32_t count, const uint8_t* data); |
| 66 | camera_status_t ACaptureRequest_setEntry_i32( |
| 67 | ACaptureRequest*, uint32_t tag, uint32_t count, const int32_t* data); |
| 68 | camera_status_t ACaptureRequest_setEntry_float( |
| 69 | ACaptureRequest*, uint32_t tag, uint32_t count, const float* data); |
| 70 | camera_status_t ACaptureRequest_setEntry_i64( |
| 71 | ACaptureRequest*, uint32_t tag, uint32_t count, const int64_t* data); |
| 72 | camera_status_t ACaptureRequest_setEntry_double( |
| 73 | ACaptureRequest*, uint32_t tag, uint32_t count, const double* data); |
| 74 | camera_status_t ACaptureRequest_setEntry_rational( |
| 75 | ACaptureRequest*, uint32_t tag, uint32_t count, const ACameraMetadata_rational* data); |
| 76 | |
| 77 | // free the capture request created by ACameraDevice_createCaptureRequest |
| 78 | void ACaptureRequest_free(ACaptureRequest* request); |
| 79 | |
| 80 | #ifdef __cplusplus |
| 81 | } // extern "C" |
| 82 | #endif |
| 83 | |
| 84 | #endif // _NDK_CAPTURE_REQUEST_H |