blob: 3ef46766e28443704f778b594fb09f759882b921 [file] [log] [blame]
Igor Murashkin634a5152013-02-20 17:15:11 -08001/*
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
27struct camera_metadata;
28
29namespace android {
30
31class IProCameraUserClient;
32class IGraphicBufferProducer;
33class Surface;
34
35class IProCameraUser: public IInterface
36{
37public:
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;
Igor Murashkin985fd302013-02-20 18:24:43 -080066 virtual status_t createStream(int width, int height, int format,
67 const sp<Surface>& surface,
68 /*out*/
69 int* streamId) = 0;
70
71 // Create a request object from a template.
72 virtual status_t createDefaultRequest(int templateId,
73 /*out*/
74 camera_metadata** request)
75 = 0;
Igor Murashkin634a5152013-02-20 17:15:11 -080076
77};
78
79// ----------------------------------------------------------------------------
80
81class BnProCameraUser: public BnInterface<IProCameraUser>
82{
83public:
84 virtual status_t onTransact( uint32_t code,
85 const Parcel& data,
86 Parcel* reply,
87 uint32_t flags = 0);
88};
89
90}; // namespace android
91
92#endif