blob: c47abe03d06cd392fc88fdb687b08cd6cd9113d1 [file] [log] [blame]
Jayant Chowdharyc67af1b2022-04-07 18:05:04 +00001/*
2 * Copyright (C) 2022 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#ifndef ANDROID_SERVERS_CAMERA_SESSION_CONFIGURATION_UTILS_HIDL_H
17#define ANDROID_SERVERS_CAMERA_SESSION_CONFIGURATION_UTILS_HIDL_H
18
Jayant Chowdharyc67af1b2022-04-07 18:05:04 +000019#include <android/hardware/camera/device/3.4/ICameraDeviceSession.h>
20#include <android/hardware/camera/device/3.7/ICameraDeviceSession.h>
Jayant Chowdharyc67af1b2022-04-07 18:05:04 +000021
22#include <utils/SessionConfigurationUtils.h>
23
24// Convenience methods for constructing binder::Status objects for error returns
25
26namespace android {
27namespace camera3 {
28
29namespace SessionConfigurationUtils {
30
Jayant Chowdharyc67af1b2022-04-07 18:05:04 +000031// utility function to convert AIDL SessionConfiguration to HIDL
32// streamConfiguration. Also checks for validity of SessionConfiguration and
33// returns a non-ok binder::Status if the passed in session configuration
34// isn't valid.
35binder::Status
36convertToHALStreamCombination(const SessionConfiguration& sessionConfiguration,
37 const String8 &cameraId, const CameraMetadata &deviceInfo,
38 metadataGetter getMetadata, const std::vector<std::string> &physicalCameraIds,
Jayant Chowdhary1f1b7aa2022-05-12 18:34:34 +000039 hardware::camera::device::V3_7::StreamConfiguration &streamConfiguration,
Jayant Chowdharyc67af1b2022-04-07 18:05:04 +000040 bool overrideForPerfClass, bool *earlyExit);
41
Jayant Chowdharyc67af1b2022-04-07 18:05:04 +000042// Utility function to convert a V3_7::StreamConfiguration to
43// V3_4::StreamConfiguration. Return false if the original V3_7 configuration cannot
44// be used by older version HAL.
45bool convertHALStreamCombinationFromV37ToV34(
46 hardware::camera::device::V3_4::StreamConfiguration &streamConfigV34,
47 const hardware::camera::device::V3_7::StreamConfiguration &streamConfigV37);
48} // SessionConfigurationUtils
49} // camera3
50} // android
51
52#endif