ICameraService.h revision 634a51509ee50475f3e9f8ccf897e90fc72ded31
13cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian/*
23cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * Copyright (C) 2008 The Android Open Source Project
33cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian *
43cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * Licensed under the Apache License, Version 2.0 (the "License");
53cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * you may not use this file except in compliance with the License.
63cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * You may obtain a copy of the License at
73cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian *
83cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian *      http://www.apache.org/licenses/LICENSE-2.0
93cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian *
103cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * Unless required by applicable law or agreed to in writing, software
113cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * distributed under the License is distributed on an "AS IS" BASIS,
123cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * See the License for the specific language governing permissions and
143cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * limitations under the License.
153cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian */
163cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
173cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#ifndef ANDROID_HARDWARE_ICAMERASERVICE_H
183cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#define ANDROID_HARDWARE_ICAMERASERVICE_H
193cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
203cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <utils/RefBase.h>
213cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <binder/IInterface.h>
223cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <binder/Parcel.h>
233cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
243cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <camera/ICameraClient.h>
253cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <camera/ICamera.h>
26634a51509ee50475f3e9f8ccf897e90fc72ded31Igor Murashkin#include <camera/IProCameraUser.h>
273cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
283cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopiannamespace android {
293cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
303cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianclass ICameraService : public IInterface
313cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian{
323cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic:
333cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    enum {
3435a055b8bfc6f3cbea409b2897caf936654519cbChih-Chung Chang        GET_NUMBER_OF_CAMERAS = IBinder::FIRST_CALL_TRANSACTION,
35ddbdb35d176266b5ab64c30178f5cb76c5b1b4b4Chih-Chung Chang        GET_CAMERA_INFO,
36634a51509ee50475f3e9f8ccf897e90fc72ded31Igor Murashkin        CONNECT,
37634a51509ee50475f3e9f8ccf897e90fc72ded31Igor Murashkin        CONNECT_PRO
383cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    };
393cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
403cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic:
413cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    DECLARE_META_INTERFACE(CameraService);
423cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
4335a055b8bfc6f3cbea409b2897caf936654519cbChih-Chung Chang    virtual int32_t         getNumberOfCameras() = 0;
44ddbdb35d176266b5ab64c30178f5cb76c5b1b4b4Chih-Chung Chang    virtual status_t        getCameraInfo(int cameraId,
45ddbdb35d176266b5ab64c30178f5cb76c5b1b4b4Chih-Chung Chang                                          struct CameraInfo* cameraInfo) = 0;
4635a055b8bfc6f3cbea409b2897caf936654519cbChih-Chung Chang    virtual sp<ICamera>     connect(const sp<ICameraClient>& cameraClient,
4708ad5efcef90e24db2863c0f85972ed05fe848a2Wu-cheng Li                                    int cameraId) = 0;
48634a51509ee50475f3e9f8ccf897e90fc72ded31Igor Murashkin
49634a51509ee50475f3e9f8ccf897e90fc72ded31Igor Murashkin    virtual sp<IProCameraUser>
50634a51509ee50475f3e9f8ccf897e90fc72ded31Igor Murashkin                            connect(const sp<IProCameraCallbacks>& cameraCb,
51634a51509ee50475f3e9f8ccf897e90fc72ded31Igor Murashkin                                    int cameraId) = 0;
523cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian};
533cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
543cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian// ----------------------------------------------------------------------------
553cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
563cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianclass BnCameraService: public BnInterface<ICameraService>
573cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian{
583cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic:
593cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    virtual status_t    onTransact( uint32_t code,
603cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian                                    const Parcel& data,
613cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian                                    Parcel* reply,
623cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian                                    uint32_t flags = 0);
633cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian};
643cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
653cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian}; // namespace android
663cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
673cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#endif
68