• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.3-impl"
18 #include <log/log.h>
19 
20 #include <utils/Vector.h>
21 #include <utils/Trace.h>
22 #include "CameraDevice_3_3.h"
23 #include <include/convert.h>
24 
25 namespace android {
26 namespace hardware {
27 namespace camera {
28 namespace device {
29 namespace V3_3 {
30 namespace implementation {
31 
32 using ::android::hardware::camera::common::V1_0::Status;
33 using namespace ::android::hardware::camera::device;
34 
CameraDevice(sp<CameraModule> module,const std::string & cameraId,const SortedVector<std::pair<std::string,std::string>> & cameraDeviceNames)35 CameraDevice::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 
~CameraDevice()41 CameraDevice::~CameraDevice() {
42 }
43 
createSession(camera3_device_t * device,const camera_metadata_t * deviceInfo,const sp<V3_2::ICameraDeviceCallback> & callback)44 sp<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 (const 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_3
64 }  // namespace device
65 }  // namespace camera
66 }  // namespace hardware
67 }  // namespace android
68