/* * Copyright (C) 2018 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 CAMERASERVER_CONVERT_HIDL #define CAMERASERVER_CONVERT_HIDL #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace android { namespace hardware { namespace cameraservice { namespace utils { namespace conversion { using hardware::camera2::impl::CaptureResultExtras; using hardware::camera2::impl::PhysicalCaptureResultInfo; using CaptureResultMetadataQueue = MessageQueue; using HCameraMetadata = frameworks::cameraservice::service::V2_0::CameraMetadata; using HCameraDeviceStatus = frameworks::cameraservice::service::V2_0::CameraDeviceStatus; using HCameraStatusAndId = frameworks::cameraservice::service::V2_0::CameraStatusAndId; using HCameraDeviceUser = frameworks::cameraservice::device::V2_0::ICameraDeviceUser; using HCaptureResultExtras = frameworks::cameraservice::device::V2_0::CaptureResultExtras; using HCaptureRequest = frameworks::cameraservice::device::V2_0::CaptureRequest; using HErrorCode = frameworks::cameraservice::device::V2_0::ErrorCode; using HGraphicBufferProducer = hardware::graphics::bufferqueue::V1_0::IGraphicBufferProducer; using HOutputConfiguration = frameworks::cameraservice::device::V2_0::OutputConfiguration; using HPhysicalCameraSettings = frameworks::cameraservice::device::V2_0::PhysicalCameraSettings; using HPhysicalCaptureResultInfo = frameworks::cameraservice::device::V2_0::PhysicalCaptureResultInfo; using HSessionConfiguration = frameworks::cameraservice::device::V2_0::SessionConfiguration; using HSubmitInfo = frameworks::cameraservice::device::V2_0::SubmitInfo; using HStatus = frameworks::cameraservice::common::V2_0::Status; using HStreamConfigurationMode = frameworks::cameraservice::device::V2_0::StreamConfigurationMode; using HTemplateId = frameworks::cameraservice::device::V2_0::TemplateId; // Note: existing data in dst will be gone. Caller still owns the memory of src void convertToHidl(const camera_metadata_t *src, HCameraMetadata* dst); int32_t convertFromHidl(HStreamConfigurationMode streamConfigurationMode); int32_t convertFromHidl(HTemplateId templateId); bool convertFromHidl(const HCameraMetadata &src, CameraMetadata *dst); hardware::camera2::params::OutputConfiguration convertFromHidl( const HOutputConfiguration &hOutputConfiguration); hardware::camera2::params::SessionConfiguration convertFromHidl( const HSessionConfiguration &hSessionConfiguration); HCameraDeviceStatus convertToHidlCameraDeviceStatus(int32_t status); void convertToHidl(const std::vector &src, hidl_vec* dst); void convertToHidl(const std::vector &src, hidl_vec* dst); void convertToHidl(const hardware::camera2::utils::SubmitInfo &submitInfo, HSubmitInfo *hSubmitInfo); HErrorCode convertToHidl(int32_t errorCode); HCaptureResultExtras convertToHidl(const CaptureResultExtras &captureResultExtras); hidl_vec convertToHidl( const std::vector &physicalCaptureResultInfos, std::shared_ptr &captureResultMetadataQueue); HStatus B2HStatus(const binder::Status &bStatus); } // conversion } // utils } // cameraservice } // hardware } //android #endif //CAMERASERVER_CONVERT_TO_HIDL