/* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CPP_EVS_MANAGER_AIDL_WRAPPERS_INCLUDE_HIDLCAMERA_H #define CPP_EVS_MANAGER_AIDL_WRAPPERS_INCLUDE_HIDLCAMERA_H #include "AidlCameraStream.h" #include #include #include #include #include #include #include #include #include #include #include #include namespace aidl::android::automotive::evs::implementation { namespace aidlevs = ::aidl::android::hardware::automotive::evs; namespace hidlevs = ::android::hardware::automotive::evs; class HidlCamera final : public hidlevs::V1_1::IEvsCamera { public: // Methods from ::android::hardware::automotive::evs::V1_0::IEvsCamera follow. ::android::hardware::Return getCameraInfo(getCameraInfo_cb _hidl_cb) override; ::android::hardware::Return setMaxFramesInFlight( uint32_t bufferCount) override; ::android::hardware::Return startVideoStream( const ::android::sp<::android::hardware::automotive::evs::V1_0::IEvsCameraStream>& stream) override; ::android::hardware::Return doneWithFrame( const hidlevs::V1_0::BufferDesc& buffer) override; ::android::hardware::Return stopVideoStream() override; ::android::hardware::Return getExtendedInfo(uint32_t opaqueIdentifier) override; ::android::hardware::Return setExtendedInfo( uint32_t opaqueIdentifier, int32_t opaqueValue) override; // Methods from ::android::hardware::automotive::evs::V1_1::IEvsCamera follow. ::android::hardware::Return getCameraInfo_1_1(getCameraInfo_1_1_cb _hidl_cb) override; ::android::hardware::Return getPhysicalCameraInfo( const ::android::hardware::hidl_string& deviceId, getPhysicalCameraInfo_cb _hidl_cb) override; ::android::hardware::Return doneWithFrame_1_1( const ::android::hardware::hidl_vec& buffer) override; ::android::hardware::Return pauseVideoStream() override { return hidlevs::V1_0::EvsResult::UNDERLYING_SERVICE_ERROR; } ::android::hardware::Return resumeVideoStream() override { return hidlevs::V1_0::EvsResult::UNDERLYING_SERVICE_ERROR; } ::android::hardware::Return setMaster() override; ::android::hardware::Return forceMaster( const ::android::sp& display) override; ::android::hardware::Return unsetMaster() override; ::android::hardware::Return getParameterList(getParameterList_cb _hidl_cb) override; ::android::hardware::Return getIntParameterRange( hidlevs::V1_1::CameraParam id, getIntParameterRange_cb _hidl_cb) override; ::android::hardware::Return setIntParameter(hidlevs::V1_1::CameraParam id, int32_t value, setIntParameter_cb _hidl_cb) override; ::android::hardware::Return getIntParameter(hidlevs::V1_1::CameraParam id, getIntParameter_cb _hidl_cb) override; ::android::hardware::Return setExtendedInfo_1_1( uint32_t opaqueIdentifier, const ::android::hardware::hidl_vec& opaqueValue) override; ::android::hardware::Return getExtendedInfo_1_1(uint32_t opaqueIdentifier, getExtendedInfo_1_1_cb _hidl_cb) override; ::android::hardware::Return importExternalBuffers( const ::android::hardware::hidl_vec& buffers, importExternalBuffers_cb _hidl_cb) override; explicit HidlCamera(const std::shared_ptr& camera) : mAidlCamera(camera) {} virtual ~HidlCamera(); const std::shared_ptr getAidlCamera() const { return mAidlCamera; } private: // The low level camera interface that backs this proxy std::shared_ptr mAidlCamera; std::shared_ptr mAidlStream; }; } // namespace aidl::android::automotive::evs::implementation #endif // CPP_EVS_MANAGER_AIDL_WRAPPERS_INCLUDE_HIDLCAMERA_H