blob: 69caa170acb0e7a91ea5dccab9e473215c491737 [file] [log] [blame]
Scott Randolph5c99d852016-11-15 17:01:23 -08001/*
2 * Copyright (C) 2016 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
17#ifndef ANDROID_HARDWARE_EVS_V1_0_EVSCAMERAENUMERATOR_H
18#define ANDROID_HARDWARE_EVS_V1_0_EVSCAMERAENUMERATOR_H
19
20#include <android/hardware/evs/1.0/IEvsEnumerator.h>
21#include <android/hardware/evs/1.0/IEvsCamera.h>
22
23#include <list>
24
25#include "EvsCamera.h"
26
27namespace android {
28namespace hardware {
29namespace evs {
30namespace V1_0 {
31namespace implementation {
32
33class EvsEnumerator : public IEvsEnumerator {
34public:
35 // Methods from ::android::hardware::evs::V1_0::IEvsEnumerator follow.
36 Return<void> getCameraList(getCameraList_cb _hidl_cb) override;
37 Return<void> openCamera(const hidl_string& cameraId, openCamera_cb callback) override;
38 Return<void> closeCamera(const ::android::sp<IEvsCamera>& carCamera) override;
39 Return<void> openDisplay(openDisplay_cb callback) override;
40 Return<void> closeDisplay(const ::android::sp<IEvsDisplay>& display) override;
41
42 // Implementation details
43 EvsEnumerator();
44
45private:
46 struct CameraRecord {
47 sp<EvsCamera> pCamera;
48 bool inUse;
49 CameraRecord(EvsCamera* p, bool b) : pCamera(p), inUse(b) {}
50 };
51 std::list<CameraRecord> mCameraList;
52
53 sp<IEvsDisplay> mActiveDisplay;
54};
55
56} // namespace implementation
57} // namespace V1_0
58} // namespace evs
59} // namespace hardware
60} // namespace android
61
62#endif // ANDROID_HARDWARE_EVS_V1_0_EVSCAMERAENUMERATOR_H