Camera2Client.cpp revision 61ab9f93315ea817cd1ac110e2a95da4dab6b4d1
1/* 2 * Copyright (C) 2012 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 "Camera2Client" 18//#define LOG_NDEBUG 0 19 20#include <cutils/properties.h> 21#include <gui/SurfaceTextureClient.h> 22#include <gui/Surface.h> 23 24#include "Camera2Client.h" 25 26namespace android { 27 28#define ALOG1(...) ALOGD_IF(gLogLevel >= 1, __VA_ARGS__); 29#define ALOG2(...) ALOGD_IF(gLogLevel >= 2, __VA_ARGS__); 30 31#define ALOG1_ENTRY { \ 32 int callingPid = getCallingPid(); \ 33 ALOG1("%s: E (pid %d, id %d) ", __FUNCTION__, \ 34 callingPid, mCameraId); \ 35} 36 37static int getCallingPid() { 38 return IPCThreadState::self()->getCallingPid(); 39} 40 41static int getCallingUid() { 42 return IPCThreadState::self()->getCallingUid(); 43} 44 45// Interface used by CameraService 46 47Camera2Client::Camera2Client(const sp<CameraService>& cameraService, 48 const sp<ICameraClient>& cameraClient, 49 const sp<Camera2Device>& device, 50 int cameraId, 51 int cameraFacing, 52 int clientPid): 53 Client(cameraService, cameraClient, 54 cameraId, cameraFacing, clientPid) { 55 int callingPid = getCallingPid(); 56 ALOG1("%s: E (pid %d, id %d)", __FUNCTION__, callingPid, cameraId); 57 ALOG1_ENTRY; 58 59} 60 61Camera2Client::~Camera2Client() { 62} 63 64status_t Camera2Client::dump(int fd, const Vector<String16>& args) { 65 return BAD_VALUE; 66} 67 68// ICamera interface 69 70void Camera2Client::disconnect() { 71 CameraService::Client::disconnect(); 72} 73 74status_t Camera2Client::connect(const sp<ICameraClient>& client) { 75 return BAD_VALUE; 76} 77 78status_t Camera2Client::lock() { 79 return BAD_VALUE; 80} 81 82status_t Camera2Client::unlock() { 83 return BAD_VALUE; 84} 85 86status_t Camera2Client::setPreviewDisplay(const sp<Surface>& surface) { 87 return BAD_VALUE; 88} 89 90status_t Camera2Client::setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture) { 91 return BAD_VALUE; 92} 93 94void Camera2Client::setPreviewCallbackFlag(int flag) { 95 96} 97 98status_t Camera2Client::startPreview() { 99 return BAD_VALUE; 100} 101 102void Camera2Client::stopPreview() { 103 104} 105 106bool Camera2Client::previewEnabled() { 107 return false; 108} 109 110status_t Camera2Client::storeMetaDataInBuffers(bool enabled) { 111 return BAD_VALUE; 112} 113 114status_t Camera2Client::startRecording() { 115 return BAD_VALUE; 116} 117 118void Camera2Client::stopRecording() { 119} 120 121bool Camera2Client::recordingEnabled() { 122 return BAD_VALUE; 123} 124 125void Camera2Client::releaseRecordingFrame(const sp<IMemory>& mem) { 126 127} 128 129status_t Camera2Client::autoFocus() { 130 return BAD_VALUE; 131} 132 133status_t Camera2Client::cancelAutoFocus() { 134 return BAD_VALUE; 135} 136 137status_t Camera2Client::takePicture(int msgType) { 138 return BAD_VALUE; 139} 140 141status_t Camera2Client::setParameters(const String8& params) { 142 return BAD_VALUE; 143} 144String8 Camera2Client::getParameters() const { 145 return String8(); 146} 147 148status_t Camera2Client::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) { 149 return BAD_VALUE; 150} 151 152 153} // namespace android 154