blob: ea2fcee2ae5eecdd4b6ce22d52514438f869af33 [file] [log] [blame]
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -07001/*
2 * Copyright (C) 2008 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_HARDWARE_ICAMERA_H
18#define ANDROID_HARDWARE_ICAMERA_H
19
20#include <utils/RefBase.h>
21#include <utils/IInterface.h>
22#include <utils/Parcel.h>
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070023#include <ui/ISurface.h>
24#include <utils/IMemory.h>
25#include <utils/String8.h>
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080026#include <ui/Camera.h>
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070027
28namespace android {
29
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080030class ICameraClient;
31
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070032class ICamera: public IInterface
33{
34public:
35 DECLARE_META_INTERFACE(Camera);
36
37 virtual void disconnect() = 0;
38
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080039 // connect new client with existing camera remote
40 virtual status_t connect(const sp<ICameraClient>& client) = 0;
41
The Android Open Source Project27629322009-01-09 17:51:23 -080042 // prevent other processes from using this ICamera interface
43 virtual status_t lock() = 0;
44
45 // allow other processes to use this ICamera interface
46 virtual status_t unlock() = 0;
47
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070048 // pass the buffered ISurface to the camera service
49 virtual status_t setPreviewDisplay(const sp<ISurface>& surface) = 0;
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080050
51 // set the frame callback flag to affect how the received frames from
52 // preview are handled.
53 virtual void setFrameCallbackFlag(int frame_callback_flag) = 0;
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070054
55 // start preview mode, must call setPreviewDisplay first
56 virtual status_t startPreview() = 0;
57
58 // stop preview mode
59 virtual void stopPreview() = 0;
60
The Android Open Source Project27629322009-01-09 17:51:23 -080061 // get preview state
62 virtual bool previewEnabled() = 0;
63
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070064 // auto focus
65 virtual status_t autoFocus() = 0;
66
67 // take a picture
68 virtual status_t takePicture() = 0;
69
70 // set preview/capture parameters - key/value pairs
71 virtual status_t setParameters(const String8& params) = 0;
72
73 // get preview/capture parameters - key/value pairs
74 virtual String8 getParameters() const = 0;
75};
76
77// ----------------------------------------------------------------------------
78
79class BnCamera: public BnInterface<ICamera>
80{
81public:
82 virtual status_t onTransact( uint32_t code,
83 const Parcel& data,
84 Parcel* reply,
85 uint32_t flags = 0);
86};
87
88}; // namespace android
89
90#endif