blob: f12230ca2ba2b6fb29c0a53c1170d07c932c8beb [file] [log] [blame]
Shuzhen Wang82e36b32017-11-28 17:00:43 -08001/*
2 * Copyright (C) 2018 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#define LOG_TAG "android.hardware.camera.device@3.4-convert-impl"
18#include <log/log.h>
19
20#include <cstring>
21#include "include/convert.h"
22
23namespace android {
24namespace hardware {
25namespace camera {
26namespace device {
27namespace V3_4 {
28namespace implementation {
29
30using ::android::hardware::graphics::common::V1_0::Dataspace;
31using ::android::hardware::graphics::common::V1_0::PixelFormat;
32using ::android::hardware::camera::device::V3_2::BufferUsageFlags;
33
34void convertToHidl(const Camera3Stream* src, HalStream* dst) {
35 V3_3::implementation::convertToHidl(src, &dst->v3_3);
36 dst->physicalCameraId = src->physical_camera_id;
37}
38
39void convertToHidl(const camera3_stream_configuration_t& src, HalStreamConfiguration* dst) {
40 dst->streams.resize(src.num_streams);
41 for (uint32_t i = 0; i < src.num_streams; i++) {
42 convertToHidl(static_cast<Camera3Stream*>(src.streams[i]), &dst->streams[i]);
43 }
44 return;
45}
46
47void convertFromHidl(const Stream &src, Camera3Stream* dst) {
48 V3_2::implementation::convertFromHidl(src.v3_2, dst);
49 // Initialize physical_camera_id
50 dst->physical_camera_id = nullptr;
51 return;
52}
53
54} // namespace implementation
55} // namespace V3_4
56} // namespace device
57} // namespace camera
58} // namespace hardware
59} // namespace android