| Igor Murashkin | 634a515 | 2013-02-20 17:15:11 -0800 | [diff] [blame^] | 1 | /* | 
 | 2 |  * Copyright (C) 2013 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_IPROCAMERAUSER_H | 
 | 18 | #define ANDROID_HARDWARE_IPROCAMERAUSER_H | 
 | 19 |  | 
 | 20 | #include <utils/RefBase.h> | 
 | 21 | #include <binder/IInterface.h> | 
 | 22 | #include <binder/Parcel.h> | 
 | 23 | #include <binder/IMemory.h> | 
 | 24 | #include <utils/String8.h> | 
 | 25 | #include <camera/IProCameraCallbacks.h> | 
 | 26 |  | 
 | 27 | struct camera_metadata; | 
 | 28 |  | 
 | 29 | namespace android { | 
 | 30 |  | 
 | 31 | class IProCameraUserClient; | 
 | 32 | class IGraphicBufferProducer; | 
 | 33 | class Surface; | 
 | 34 |  | 
 | 35 | class IProCameraUser: public IInterface | 
 | 36 | { | 
 | 37 | public: | 
 | 38 |     DECLARE_META_INTERFACE(ProCameraUser); | 
 | 39 |  | 
 | 40 |     virtual void            disconnect() = 0; | 
 | 41 |  | 
 | 42 |     // connect to the service, given a callbacks listener | 
 | 43 |     virtual status_t        connect(const sp<IProCameraCallbacks>& callbacks) | 
 | 44 |                                                                             = 0; | 
 | 45 |  | 
 | 46 |     /** | 
 | 47 |      * Locking | 
 | 48 |      **/ | 
 | 49 |     virtual status_t        exclusiveTryLock() = 0; | 
 | 50 |     virtual status_t        exclusiveLock() = 0; | 
 | 51 |     virtual status_t        exclusiveUnlock() = 0; | 
 | 52 |  | 
 | 53 |     virtual bool            hasExclusiveLock() = 0; | 
 | 54 |  | 
 | 55 |     /** | 
 | 56 |      * Request Handling | 
 | 57 |      **/ | 
 | 58 |  | 
 | 59 |     // Note that the callee gets a copy of the metadata. | 
 | 60 |     virtual int             submitRequest(struct camera_metadata* metadata, | 
 | 61 |                                           bool streaming = false) = 0; | 
 | 62 |     virtual status_t        cancelRequest(int requestId) = 0; | 
 | 63 |  | 
 | 64 |     virtual status_t        requestStream(int streamId) = 0; | 
 | 65 |     virtual status_t        cancelStream(int streamId) = 0; | 
 | 66 |  | 
 | 67 | }; | 
 | 68 |  | 
 | 69 | // ---------------------------------------------------------------------------- | 
 | 70 |  | 
 | 71 | class BnProCameraUser: public BnInterface<IProCameraUser> | 
 | 72 | { | 
 | 73 | public: | 
 | 74 |     virtual status_t    onTransact( uint32_t code, | 
 | 75 |                                     const Parcel& data, | 
 | 76 |                                     Parcel* reply, | 
 | 77 |                                     uint32_t flags = 0); | 
 | 78 | }; | 
 | 79 |  | 
 | 80 | }; // namespace android | 
 | 81 |  | 
 | 82 | #endif |