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>
263cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
273cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopiannamespace android {
283cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
293cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianclass ICameraService : public IInterface
303cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian{
313cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic:
323cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    enum {
3335a055b8bfc6f3cbea409b2897caf936654519cbChih-Chung Chang        GET_NUMBER_OF_CAMERAS = IBinder::FIRST_CALL_TRANSACTION,
34ddbdb35d176266b5ab64c30178f5cb76c5b1b4b4Chih-Chung Chang        GET_CAMERA_INFO,
3535a055b8bfc6f3cbea409b2897caf936654519cbChih-Chung Chang        CONNECT
363cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    };
373cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
383cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic:
393cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    DECLARE_META_INTERFACE(CameraService);
403cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
4135a055b8bfc6f3cbea409b2897caf936654519cbChih-Chung Chang    virtual int32_t         getNumberOfCameras() = 0;
42ddbdb35d176266b5ab64c30178f5cb76c5b1b4b4Chih-Chung Chang    virtual status_t        getCameraInfo(int cameraId,
43ddbdb35d176266b5ab64c30178f5cb76c5b1b4b4Chih-Chung Chang                                          struct CameraInfo* cameraInfo) = 0;
4435a055b8bfc6f3cbea409b2897caf936654519cbChih-Chung Chang    virtual sp<ICamera>     connect(const sp<ICameraClient>& cameraClient,
4508ad5efcef90e24db2863c0f85972ed05fe848a2Wu-cheng Li                                    int cameraId) = 0;
463cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian};
473cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
483cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian// ----------------------------------------------------------------------------
493cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
503cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianclass BnCameraService: public BnInterface<ICameraService>
513cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian{
523cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic:
533cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian    virtual status_t    onTransact( uint32_t code,
543cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian                                    const Parcel& data,
553cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian                                    Parcel* reply,
563cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian                                    uint32_t flags = 0);
573cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian};
583cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
593cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian}; // namespace android
603cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian
613cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#endif
62