blob: 4dd3483df1beb18beb1ea3e8ec2b6af9359fe186 [file] [log] [blame]
Scott Randolphdcc35342017-01-19 13:33:42 -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_AUTOMOTIVE_EVS_V1_0_EVSCAMERAENUMERATOR_H
18#define ANDROID_AUTOMOTIVE_EVS_V1_0_EVSCAMERAENUMERATOR_H
19
20#include <list>
21
22#include "HalCamera.h"
23#include "VirtualCamera.h"
24
Scott Randolphf1b55e72017-03-01 20:35:44 -080025#include <android/hardware/automotive/evs/1.0/IEvsEnumerator.h>
26#include <android/hardware/automotive/evs/1.0/IEvsDisplay.h>
Scott Randolphdcc35342017-01-19 13:33:42 -080027
Scott Randolphf1b55e72017-03-01 20:35:44 -080028using namespace ::android::hardware::automotive::evs::V1_0;
Scott Randolphdcc35342017-01-19 13:33:42 -080029using ::android::hardware::Return;
30using ::android::hardware::hidl_string;
31
32namespace android {
33namespace automotive {
34namespace evs {
35namespace V1_0 {
36namespace implementation {
37
38class Enumerator : public IEvsEnumerator {
39public:
Scott Randolphf1b55e72017-03-01 20:35:44 -080040 // Methods from ::android::hardware::automotive::evs::V1_0::IEvsEnumerator follow.
Scott Randolphdcc35342017-01-19 13:33:42 -080041 Return<void> getCameraList(getCameraList_cb _hidl_cb) override;
42 Return<sp<IEvsCamera>> openCamera(const hidl_string& cameraId) override;
43 Return<void> closeCamera(const ::android::sp<IEvsCamera>& virtualCamera) override;
44 Return<sp<IEvsDisplay>> openDisplay() override;
45 Return<void> closeDisplay(const ::android::sp<IEvsDisplay>& display) override;
46 Return<DisplayState> getDisplayState() override;
47
48 // Implementation details
49 bool init(const char* hardwareServiceName);
50
51private:
52 sp<IEvsEnumerator> mHwEnumerator; // Hardware enumerator
Changyeon Jocd5e3fb2019-03-22 15:12:22 -070053 wp<IEvsDisplay> mActiveDisplay; // Display proxy object warpping hw display
Scott Randolphdcc35342017-01-19 13:33:42 -080054 std::list<sp<HalCamera>> mCameras; // Camera proxy objects wrapping hw cameras
55};
56
57} // namespace implementation
58} // namespace V1_0
59} // namespace evs
60} // namespace automotive
61} // namespace android
62
63#endif // ANDROID_AUTOMOTIVE_EVS_V1_0_EVSCAMERAENUMERATOR_H