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 | #ifndef _ACAPTURE_REQUEST_H |
| 17 | #define _ACAPTURE_REQUEST_H |
| 18 | |
Colin Cross | 7e8d4ba | 2017-05-04 16:17:42 -0700 | [diff] [blame] | 19 | #include <camera/NdkCaptureRequest.h> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 20 | #include <set> |
Shuzhen Wang | 6c17e21 | 2019-02-19 14:51:47 -0800 | [diff] [blame^] | 21 | #include <unordered_map> |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 22 | |
| 23 | using namespace android; |
| 24 | |
Jayant Chowdhary | 6df2607 | 2018-11-06 23:55:12 -0800 | [diff] [blame] | 25 | #ifdef __ANDROID_VNDK__ |
| 26 | #include "ndk_vendor/impl/ACaptureRequestVendor.h" |
| 27 | #else |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 28 | struct ACameraOutputTarget { |
Jayant Chowdhary | 6df2607 | 2018-11-06 23:55:12 -0800 | [diff] [blame] | 29 | explicit ACameraOutputTarget(ACameraWindowType* window) : mWindow(window) {}; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 30 | |
| 31 | bool operator == (const ACameraOutputTarget& other) const { |
| 32 | return mWindow == other.mWindow; |
| 33 | } |
| 34 | bool operator != (const ACameraOutputTarget& other) const { |
| 35 | return mWindow != other.mWindow; |
| 36 | } |
| 37 | bool operator < (const ACameraOutputTarget& other) const { |
| 38 | return mWindow < other.mWindow; |
| 39 | } |
| 40 | bool operator > (const ACameraOutputTarget& other) const { |
| 41 | return mWindow > other.mWindow; |
| 42 | } |
| 43 | |
Jayant Chowdhary | 6df2607 | 2018-11-06 23:55:12 -0800 | [diff] [blame] | 44 | ACameraWindowType* mWindow; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 45 | }; |
Jayant Chowdhary | 6df2607 | 2018-11-06 23:55:12 -0800 | [diff] [blame] | 46 | #endif |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 47 | |
| 48 | struct ACameraOutputTargets { |
| 49 | std::set<ACameraOutputTarget> mOutputs; |
| 50 | }; |
| 51 | |
| 52 | struct ACaptureRequest { |
Yin-Chia Yeh | d39b9e3 | 2017-10-30 17:39:23 -0700 | [diff] [blame] | 53 | camera_status_t setContext(void* ctx) { |
| 54 | context = ctx; |
| 55 | return ACAMERA_OK; |
| 56 | } |
| 57 | |
| 58 | camera_status_t getContext(void** ctx) const { |
| 59 | *ctx = context; |
| 60 | return ACAMERA_OK; |
| 61 | } |
| 62 | |
Shuzhen Wang | 6c17e21 | 2019-02-19 14:51:47 -0800 | [diff] [blame^] | 63 | sp<ACameraMetadata> settings; |
| 64 | std::unordered_map<std::string, sp<ACameraMetadata>> physicalSettings; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 65 | ACameraOutputTargets* targets; |
Yin-Chia Yeh | d39b9e3 | 2017-10-30 17:39:23 -0700 | [diff] [blame] | 66 | void* context; |
Yin-Chia Yeh | 0dea57f | 2015-12-09 16:46:07 -0800 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | #endif // _ACAPTURE_REQUEST_H |