blob: 118c2a581130d966d2467b7531995e0f9bf26681 [file] [log] [blame]
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -08001/*
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 Cross7e8d4ba2017-05-04 16:17:42 -070019#include <camera/NdkCaptureRequest.h>
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080020#include <set>
Shuzhen Wang6c17e212019-02-19 14:51:47 -080021#include <unordered_map>
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080022
23using namespace android;
24
25struct ACameraOutputTarget {
Avichal Rakesh8effe982023-11-13 18:53:40 -080026 explicit ACameraOutputTarget(ANativeWindow* window) : mWindow(window) {};
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080027
28 bool operator == (const ACameraOutputTarget& other) const {
29 return mWindow == other.mWindow;
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
Avichal Rakesh8effe982023-11-13 18:53:40 -080041 ANativeWindow* mWindow;
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080042};
43
44struct ACameraOutputTargets {
45 std::set<ACameraOutputTarget> mOutputs;
46};
47
48struct ACaptureRequest {
Yin-Chia Yehd39b9e32017-10-30 17:39:23 -070049 camera_status_t setContext(void* ctx) {
50 context = ctx;
51 return ACAMERA_OK;
52 }
53
54 camera_status_t getContext(void** ctx) const {
55 *ctx = context;
56 return ACAMERA_OK;
57 }
58
Shuzhen Wang6c17e212019-02-19 14:51:47 -080059 sp<ACameraMetadata> settings;
60 std::unordered_map<std::string, sp<ACameraMetadata>> physicalSettings;
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080061 ACameraOutputTargets* targets;
Yin-Chia Yehd39b9e32017-10-30 17:39:23 -070062 void* context;
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080063};
64
65#endif // _ACAPTURE_REQUEST_H