Scott Randolph | 5c99d85 | 2016-11-15 17:01:23 -0800 | [diff] [blame^] | 1 | /* |
| 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 | |
| 27 | namespace android { |
| 28 | namespace hardware { |
| 29 | namespace evs { |
| 30 | namespace V1_0 { |
| 31 | namespace implementation { |
| 32 | |
| 33 | class EvsEnumerator : public IEvsEnumerator { |
| 34 | public: |
| 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 | |
| 45 | private: |
| 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 |