blob: 5c82ab7fa7b2c974a37dade1bfc7a258f0f09259 [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>
21
22using namespace android;
23
Jayant Chowdhary6df26072018-11-06 23:55:12 -080024#ifdef __ANDROID_VNDK__
25#include "ndk_vendor/impl/ACaptureRequestVendor.h"
26#else
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080027struct ACameraOutputTarget {
Jayant Chowdhary6df26072018-11-06 23:55:12 -080028 explicit ACameraOutputTarget(ACameraWindowType* window) : mWindow(window) {};
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080029
30 bool operator == (const ACameraOutputTarget& other) const {
31 return mWindow == other.mWindow;
32 }
33 bool operator != (const ACameraOutputTarget& other) const {
34 return mWindow != other.mWindow;
35 }
36 bool operator < (const ACameraOutputTarget& other) const {
37 return mWindow < other.mWindow;
38 }
39 bool operator > (const ACameraOutputTarget& other) const {
40 return mWindow > other.mWindow;
41 }
42
Jayant Chowdhary6df26072018-11-06 23:55:12 -080043 ACameraWindowType* mWindow;
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080044};
Jayant Chowdhary6df26072018-11-06 23:55:12 -080045#endif
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080046
47struct ACameraOutputTargets {
48 std::set<ACameraOutputTarget> mOutputs;
49};
50
51struct ACaptureRequest {
Yin-Chia Yehd39b9e32017-10-30 17:39:23 -070052 camera_status_t setContext(void* ctx) {
53 context = ctx;
54 return ACAMERA_OK;
55 }
56
57 camera_status_t getContext(void** ctx) const {
58 *ctx = context;
59 return ACAMERA_OK;
60 }
61
Yin-Chia Yehdd045bf2018-08-20 12:39:19 -070062 sp<ACameraMetadata> settings;
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080063 ACameraOutputTargets* targets;
Yin-Chia Yehd39b9e32017-10-30 17:39:23 -070064 void* context;
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080065};
66
67#endif // _ACAPTURE_REQUEST_H