10dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh/*
20dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Copyright (C) 2015 The Android Open Source Project
30dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *
40dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Licensed under the Apache License, Version 2.0 (the "License");
50dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * you may not use this file except in compliance with the License.
60dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * You may obtain a copy of the License at
70dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *
80dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *      http://www.apache.org/licenses/LICENSE-2.0
90dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh *
100dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * Unless required by applicable law or agreed to in writing, software
110dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * distributed under the License is distributed on an "AS IS" BASIS,
120dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
130dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * See the License for the specific language governing permissions and
140dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh * limitations under the License.
150dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh */
160dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#ifndef _ACAPTURE_REQUEST_H
170dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#define _ACAPTURE_REQUEST_H
180dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
197e8d4ba5887affda749978d787b898bf31fda729Colin Cross#include <camera/NdkCaptureRequest.h>
200dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#include <set>
210dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
220dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehusing namespace android;
230dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
240dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehstruct ACameraOutputTarget {
25d19d994770a04f02c204affd29985c5aeaa58baaChih-Hung Hsieh    explicit ACameraOutputTarget(ANativeWindow* window) : mWindow(window) {};
260dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
270dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    bool operator == (const ACameraOutputTarget& other) const {
280dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh        return mWindow == other.mWindow;
290dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    }
300dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    bool operator != (const ACameraOutputTarget& other) const {
310dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh        return mWindow != other.mWindow;
320dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    }
330dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    bool operator < (const ACameraOutputTarget& other) const {
340dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh        return mWindow < other.mWindow;
350dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    }
360dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    bool operator > (const ACameraOutputTarget& other) const {
370dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh        return mWindow > other.mWindow;
380dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    }
390dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
400dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    ANativeWindow* mWindow;
410dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh};
420dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
430dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehstruct ACameraOutputTargets {
440dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    std::set<ACameraOutputTarget> mOutputs;
450dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh};
460dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
470dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yehstruct ACaptureRequest {
48d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh    camera_status_t setContext(void* ctx) {
49d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh        context = ctx;
50d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh        return ACAMERA_OK;
51d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh    }
52d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh
53d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh    camera_status_t getContext(void** ctx) const {
54d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh        *ctx = context;
55d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh        return ACAMERA_OK;
56d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh    }
57d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh
580dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    ACameraMetadata*      settings;
590dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh    ACameraOutputTargets* targets;
60d39b9e3ec153f68b6ba81228b5aa29a9b72770b0Yin-Chia Yeh    void*                 context;
610dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh};
620dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh
630dea57fd9fc4b2ccaab97d9477359fbd5a626f5cYin-Chia Yeh#endif // _ACAPTURE_REQUEST_H
64