Home | History | Annotate | Download | only in default
      1 /*
      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 (at) 3.4-convert-impl"
     18 #include <log/log.h>
     19 
     20 #include <cstring>
     21 #include "include/convert.h"
     22 
     23 namespace android {
     24 namespace hardware {
     25 namespace camera {
     26 namespace device {
     27 namespace V3_4 {
     28 namespace implementation {
     29 
     30 using ::android::hardware::graphics::common::V1_0::Dataspace;
     31 using ::android::hardware::graphics::common::V1_0::PixelFormat;
     32 using ::android::hardware::camera::device::V3_2::BufferUsageFlags;
     33 
     34 void convertToHidl(const Camera3Stream* src, HalStream* dst) {
     35     V3_3::implementation::convertToHidl(src, &dst->v3_3);
     36     dst->physicalCameraId = src->physical_camera_id;
     37 }
     38 
     39 void 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 
     47 void 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
     60