1 /*
2  * Copyright (C) 2019 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 HARDWARE_GOOGLE_CAMERA_HAL_TESTS_TEST_UTILS_H_
18 #define HARDWARE_GOOGLE_CAMERA_HAL_TESTS_TEST_UTILS_H_
19 
20 #include "camera_device_session_hwl.h"
21 #include "hal_types.h"
22 
23 namespace android {
24 namespace google_camera_hal {
25 namespace test_utils {
26 
27 static const uint32_t kDefaultPreviewWidth = 1920;
28 static const uint32_t kDefaultPreviewHeight = 1080;
29 
30 // Return a stream configuration that consists of only a preview stream.
31 void GetPreviewOnlyStreamConfiguration(StreamConfiguration* config,
32                                        uint32_t width = kDefaultPreviewWidth,
33                                        uint32_t height = kDefaultPreviewHeight);
34 
35 // Return a stream configuration that consists of one preview stream for each
36 // physical camera.
37 void GetPhysicalPreviewStreamConfiguration(
38     StreamConfiguration* config,
39     const std::vector<uint32_t>& physical_camera_ids,
40     uint32_t width = kDefaultPreviewWidth,
41     uint32_t height = kDefaultPreviewHeight);
42 
43 // If the session belongs to a logical camera that consists of multiple
44 // physical cameras.
45 bool IsLogicalCamera(CameraDeviceSessionHwl* session_hwl);
46 
47 }  // namespace test_utils
48 }  // namespace google_camera_hal
49 }  // namespace android
50 
51 #endif  // HARDWARE_GOOGLE_CAMERA_HAL_TESTS_TEST_UTILS_H_