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> |
| 23 | |
| 24 | #include <ui/ISurface.h> |
| 25 | #include <utils/IMemory.h> |
| 26 | #include <utils/String8.h> |
| 27 | |
| 28 | namespace android { |
| 29 | |
| 30 | class ICamera: public IInterface |
| 31 | { |
| 32 | public: |
| 33 | DECLARE_META_INTERFACE(Camera); |
| 34 | |
| 35 | virtual void disconnect() = 0; |
| 36 | |
| 37 | // pass the buffered ISurface to the camera service |
| 38 | virtual status_t setPreviewDisplay(const sp<ISurface>& surface) = 0; |
| 39 | |
| 40 | // tell the service whether to callback with each preview frame |
| 41 | virtual void setHasFrameCallback(bool installed) = 0; |
| 42 | |
| 43 | // start preview mode, must call setPreviewDisplay first |
| 44 | virtual status_t startPreview() = 0; |
| 45 | |
| 46 | // stop preview mode |
| 47 | virtual void stopPreview() = 0; |
| 48 | |
| 49 | // auto focus |
| 50 | virtual status_t autoFocus() = 0; |
| 51 | |
| 52 | // take a picture |
| 53 | virtual status_t takePicture() = 0; |
| 54 | |
| 55 | // set preview/capture parameters - key/value pairs |
| 56 | virtual status_t setParameters(const String8& params) = 0; |
| 57 | |
| 58 | // get preview/capture parameters - key/value pairs |
| 59 | virtual String8 getParameters() const = 0; |
| 60 | }; |
| 61 | |
| 62 | // ---------------------------------------------------------------------------- |
| 63 | |
| 64 | class BnCamera: public BnInterface<ICamera> |
| 65 | { |
| 66 | public: |
| 67 | virtual status_t onTransact( uint32_t code, |
| 68 | const Parcel& data, |
| 69 | Parcel* reply, |
| 70 | uint32_t flags = 0); |
| 71 | }; |
| 72 | |
| 73 | }; // namespace android |
| 74 | |
| 75 | #endif |