1*ec779b8eSAndroid Build Coastguard Worker /* 2*ec779b8eSAndroid Build Coastguard Worker * Copyright (C) 2015 The Android Open Source Project 3*ec779b8eSAndroid Build Coastguard Worker * 4*ec779b8eSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*ec779b8eSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*ec779b8eSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*ec779b8eSAndroid Build Coastguard Worker * 8*ec779b8eSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*ec779b8eSAndroid Build Coastguard Worker * 10*ec779b8eSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*ec779b8eSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*ec779b8eSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*ec779b8eSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*ec779b8eSAndroid Build Coastguard Worker * limitations under the License. 15*ec779b8eSAndroid Build Coastguard Worker */ 16*ec779b8eSAndroid Build Coastguard Worker #ifndef _ACAPTURE_REQUEST_H 17*ec779b8eSAndroid Build Coastguard Worker #define _ACAPTURE_REQUEST_H 18*ec779b8eSAndroid Build Coastguard Worker 19*ec779b8eSAndroid Build Coastguard Worker #include <camera/NdkCaptureRequest.h> 20*ec779b8eSAndroid Build Coastguard Worker #include <set> 21*ec779b8eSAndroid Build Coastguard Worker #include <unordered_map> 22*ec779b8eSAndroid Build Coastguard Worker 23*ec779b8eSAndroid Build Coastguard Worker using namespace android; 24*ec779b8eSAndroid Build Coastguard Worker 25*ec779b8eSAndroid Build Coastguard Worker struct ACameraOutputTarget { ACameraOutputTargetACameraOutputTarget26*ec779b8eSAndroid Build Coastguard Worker explicit ACameraOutputTarget(ANativeWindow* window) : mWindow(window) {}; 27*ec779b8eSAndroid Build Coastguard Worker 28*ec779b8eSAndroid Build Coastguard Worker bool operator == (const ACameraOutputTarget& other) const { 29*ec779b8eSAndroid Build Coastguard Worker return mWindow == other.mWindow; 30*ec779b8eSAndroid Build Coastguard Worker } 31*ec779b8eSAndroid Build Coastguard Worker bool operator != (const ACameraOutputTarget& other) const { 32*ec779b8eSAndroid Build Coastguard Worker return mWindow != other.mWindow; 33*ec779b8eSAndroid Build Coastguard Worker } 34*ec779b8eSAndroid Build Coastguard Worker bool operator < (const ACameraOutputTarget& other) const { 35*ec779b8eSAndroid Build Coastguard Worker return mWindow < other.mWindow; 36*ec779b8eSAndroid Build Coastguard Worker } 37*ec779b8eSAndroid Build Coastguard Worker bool operator > (const ACameraOutputTarget& other) const { 38*ec779b8eSAndroid Build Coastguard Worker return mWindow > other.mWindow; 39*ec779b8eSAndroid Build Coastguard Worker } 40*ec779b8eSAndroid Build Coastguard Worker 41*ec779b8eSAndroid Build Coastguard Worker ANativeWindow* mWindow; 42*ec779b8eSAndroid Build Coastguard Worker }; 43*ec779b8eSAndroid Build Coastguard Worker 44*ec779b8eSAndroid Build Coastguard Worker struct ACameraOutputTargets { 45*ec779b8eSAndroid Build Coastguard Worker std::set<ACameraOutputTarget> mOutputs; 46*ec779b8eSAndroid Build Coastguard Worker }; 47*ec779b8eSAndroid Build Coastguard Worker 48*ec779b8eSAndroid Build Coastguard Worker struct ACaptureRequest { setContextACaptureRequest49*ec779b8eSAndroid Build Coastguard Worker camera_status_t setContext(void* ctx) { 50*ec779b8eSAndroid Build Coastguard Worker context = ctx; 51*ec779b8eSAndroid Build Coastguard Worker return ACAMERA_OK; 52*ec779b8eSAndroid Build Coastguard Worker } 53*ec779b8eSAndroid Build Coastguard Worker getContextACaptureRequest54*ec779b8eSAndroid Build Coastguard Worker camera_status_t getContext(void** ctx) const { 55*ec779b8eSAndroid Build Coastguard Worker *ctx = context; 56*ec779b8eSAndroid Build Coastguard Worker return ACAMERA_OK; 57*ec779b8eSAndroid Build Coastguard Worker } 58*ec779b8eSAndroid Build Coastguard Worker 59*ec779b8eSAndroid Build Coastguard Worker sp<ACameraMetadata> settings; 60*ec779b8eSAndroid Build Coastguard Worker std::unordered_map<std::string, sp<ACameraMetadata>> physicalSettings; 61*ec779b8eSAndroid Build Coastguard Worker ACameraOutputTargets* targets; 62*ec779b8eSAndroid Build Coastguard Worker void* context; 63*ec779b8eSAndroid Build Coastguard Worker }; 64*ec779b8eSAndroid Build Coastguard Worker 65*ec779b8eSAndroid Build Coastguard Worker #endif // _ACAPTURE_REQUEST_H 66