blob: 99c0d862b085705051f4a093381b328074d3c4fd [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 Project7c1b96a2008-10-21 07:00:00 -070042 // pass the buffered ISurface to the camera service
43 virtual status_t setPreviewDisplay(const sp<ISurface>& surface) = 0;
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080044
45 // set the frame callback flag to affect how the received frames from
46 // preview are handled.
47 virtual void setFrameCallbackFlag(int frame_callback_flag) = 0;
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070048
49 // start preview mode, must call setPreviewDisplay first
50 virtual status_t startPreview() = 0;
51
52 // stop preview mode
53 virtual void stopPreview() = 0;
54
55 // auto focus
56 virtual status_t autoFocus() = 0;
57
58 // take a picture
59 virtual status_t takePicture() = 0;
60
61 // set preview/capture parameters - key/value pairs
62 virtual status_t setParameters(const String8& params) = 0;
63
64 // get preview/capture parameters - key/value pairs
65 virtual String8 getParameters() const = 0;
66};
67
68// ----------------------------------------------------------------------------
69
70class BnCamera: public BnInterface<ICamera>
71{
72public:
73 virtual status_t onTransact( uint32_t code,
74 const Parcel& data,
75 Parcel* reply,
76 uint32_t flags = 0);
77};
78
79}; // namespace android
80
81#endif