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_CAMERA_PROVIDER_V2_4_CAMERAPROVIDER_H
18 #define ANDROID_HARDWARE_CAMERA_PROVIDER_V2_4_CAMERAPROVIDER_H
19 
20 #include <android/hardware/camera/provider/2.4/ICameraProvider.h>
21 #include <hidl/Status.h>
22 #include <hidl/MQDescriptor.h>
23 
24 namespace android {
25 namespace hardware {
26 namespace camera {
27 namespace provider {
28 namespace V2_4 {
29 namespace implementation {
30 
31 using ::android::hardware::camera::common::V1_0::Status;
32 using ::android::hardware::camera::provider::V2_4::ICameraProvider;
33 using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback;
34 using ::android::hardware::Return;
35 using ::android::hardware::hidl_string;
36 using ::android::sp;
37 
38 template<typename IMPL>
39 struct CameraProvider : public ICameraProvider {
CameraProviderCameraProvider40     CameraProvider() : impl() {}
~CameraProviderCameraProvider41     ~CameraProvider() {}
42 
43     // Caller must use this method to check if CameraProvider ctor failed
isInitFailedCameraProvider44     bool isInitFailed() { return impl.isInitFailed(); }
45 
46     // Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow.
setCallbackCameraProvider47     Return<Status> setCallback(const sp<ICameraProviderCallback>& callback) override {
48         return impl.setCallback(callback);
49     }
50 
getVendorTagsCameraProvider51     Return<void> getVendorTags(getVendorTags_cb _hidl_cb) override {
52         return impl.getVendorTags(_hidl_cb);
53     }
54 
getCameraIdListCameraProvider55     Return<void> getCameraIdList(getCameraIdList_cb _hidl_cb) override {
56         return impl.getCameraIdList(_hidl_cb);
57     }
58 
isSetTorchModeSupportedCameraProvider59     Return<void> isSetTorchModeSupported(isSetTorchModeSupported_cb _hidl_cb) override {
60         return impl.isSetTorchModeSupported(_hidl_cb);
61     }
62 
getCameraDeviceInterface_V1_xCameraProvider63     Return<void> getCameraDeviceInterface_V1_x(
64             const hidl_string& cameraDeviceName,
65             getCameraDeviceInterface_V1_x_cb _hidl_cb) override {
66         return impl.getCameraDeviceInterface_V1_x(cameraDeviceName, _hidl_cb);
67     }
68 
getCameraDeviceInterface_V3_xCameraProvider69     Return<void> getCameraDeviceInterface_V3_x(
70             const hidl_string& cameraDeviceName,
71             getCameraDeviceInterface_V3_x_cb _hidl_cb) override {
72         return impl.getCameraDeviceInterface_V3_x(cameraDeviceName, _hidl_cb);
73     }
74 
75 private:
76     IMPL impl;
77 };
78 
79 }  // namespace implementation
80 }  // namespace V2_4
81 }  // namespace provider
82 }  // namespace camera
83 }  // namespace hardware
84 }  // namespace android
85 
86 #endif  // ANDROID_HARDWARE_CAMERA_PROVIDER_V2_4_CAMERAPROVIDER_H
87