blob: 709de0b20ce7cf580b17d581aad0fb2f2f828a7d [file] [log] [blame]
Eino-Ville Talvala61ab9f92012-05-17 10:30:54 -07001/*
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#ifndef ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H
18#define ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H
19
20#include "Camera2Device.h"
21#include "CameraService.h"
22
23namespace android {
24
25/**
26 * Implements the android.hardware.camera API on top of
27 * camera device HAL version 2.
28 */
29class Camera2Client : public CameraService::Client
30{
31public:
32 // ICamera interface (see ICamera for details)
33 virtual void disconnect();
34 virtual status_t connect(const sp<ICameraClient>& client);
35 virtual status_t lock();
36 virtual status_t unlock();
37 virtual status_t setPreviewDisplay(const sp<Surface>& surface);
38 virtual status_t setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture);
39 virtual void setPreviewCallbackFlag(int flag);
40 virtual status_t startPreview();
41 virtual void stopPreview();
42 virtual bool previewEnabled();
43 virtual status_t storeMetaDataInBuffers(bool enabled);
44 virtual status_t startRecording();
45 virtual void stopRecording();
46 virtual bool recordingEnabled();
47 virtual void releaseRecordingFrame(const sp<IMemory>& mem);
48 virtual status_t autoFocus();
49 virtual status_t cancelAutoFocus();
50 virtual status_t takePicture(int msgType);
51 virtual status_t setParameters(const String8& params);
52 virtual String8 getParameters() const;
53 virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);
54
55 // Interface used by CameraService
56 Camera2Client(const sp<CameraService>& cameraService,
57 const sp<ICameraClient>& cameraClient,
58 const sp<Camera2Device>& device,
59 int cameraId,
60 int cameraFacing,
61 int clientPid);
62 ~Camera2Client();
63
64 virtual status_t dump(int fd, const Vector<String16>& args);
65
66private:
67
68
69};
70
71}; // namespace android
72
73#endif