CameraDevice.cpp revision e18057b42f1698f33f34d14e86a53934bd337bb8
1/* 2 * Copyright (C) 2017 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 "CamDev@3.4-impl" 18#include <log/log.h> 19 20#include <utils/Vector.h> 21#include <utils/Trace.h> 22#include "CameraDevice_3_4.h" 23#include <include/convert.h> 24 25namespace android { 26namespace hardware { 27namespace camera { 28namespace device { 29namespace V3_4 { 30namespace implementation { 31 32using ::android::hardware::camera::common::V1_0::Status; 33using namespace ::android::hardware::camera::device; 34 35CameraDevice::CameraDevice( 36 sp<CameraModule> module, const std::string& cameraId, 37 const SortedVector<std::pair<std::string, std::string>>& cameraDeviceNames) : 38 V3_2::implementation::CameraDevice(module, cameraId, cameraDeviceNames) { 39} 40 41CameraDevice::~CameraDevice() { 42} 43 44sp<V3_2::implementation::CameraDeviceSession> CameraDevice::createSession(camera3_device_t* device, 45 const camera_metadata_t* deviceInfo, 46 const sp<V3_2::ICameraDeviceCallback>& callback) { 47 sp<CameraDeviceSession> session = new CameraDeviceSession(device, deviceInfo, callback); 48 IF_ALOGV() { 49 session->getInterface()->interfaceChain([]( 50 ::android::hardware::hidl_vec<::android::hardware::hidl_string> interfaceChain) { 51 ALOGV("Session interface chain:"); 52 for (auto iface : interfaceChain) { 53 ALOGV(" %s", iface.c_str()); 54 } 55 }); 56 } 57 return session; 58} 59 60// End of methods from ::android::hardware::camera::device::V3_2::ICameraDevice. 61 62} // namespace implementation 63} // namespace V3_4 64} // namespace device 65} // namespace camera 66} // namespace hardware 67} // namespace android 68