The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | /* |
| 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 Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 23 | #include <ui/ISurface.h> |
| 24 | #include <utils/IMemory.h> |
| 25 | #include <utils/String8.h> |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 26 | #include <ui/Camera.h> |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 27 | |
| 28 | namespace android { |
| 29 | |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 30 | class ICameraClient; |
| 31 | |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 32 | class ICamera: public IInterface |
| 33 | { |
| 34 | public: |
| 35 | DECLARE_META_INTERFACE(Camera); |
| 36 | |
| 37 | virtual void disconnect() = 0; |
| 38 | |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 39 | // connect new client with existing camera remote |
| 40 | virtual status_t connect(const sp<ICameraClient>& client) = 0; |
| 41 | |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 42 | // pass the buffered ISurface to the camera service |
| 43 | virtual status_t setPreviewDisplay(const sp<ISurface>& surface) = 0; |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 44 | |
| 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 Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 48 | |
| 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 | |
| 70 | class BnCamera: public BnInterface<ICamera> |
| 71 | { |
| 72 | public: |
| 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 |