blob: 49daf695fd9a5aaf200305ab96ff4238fb402e01 [file] [log] [blame]
Igor Murashkine7ee7632013-06-11 18:10:18 -07001/*
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_PHOTOGRAPHY_ICAMERADEVICEUSER_H
18#define ANDROID_HARDWARE_PHOTOGRAPHY_ICAMERADEVICEUSER_H
19
20#include <binder/IInterface.h>
21#include <binder/Parcel.h>
Jianing Weicb0652e2014-03-12 18:29:36 -070022#include <utils/List.h>
Igor Murashkine7ee7632013-06-11 18:10:18 -070023
24struct camera_metadata;
25
26namespace android {
27
28class ICameraDeviceUserClient;
29class IGraphicBufferProducer;
30class Surface;
31class CaptureRequest;
32class CameraMetadata;
33
34class ICameraDeviceUser : public IInterface
35{
36 /**
37 * Keep up-to-date with ICameraDeviceUser.aidl in frameworks/base
38 */
39public:
40 DECLARE_META_INTERFACE(CameraDeviceUser);
41
42 virtual void disconnect() = 0;
43
44 /**
45 * Request Handling
46 **/
47
Jianing Weicb0652e2014-03-12 18:29:36 -070048 /**
49 * For streaming requests, output lastFrameNumber is the last frame number
50 * of the previous repeating request.
51 * For non-streaming requests, output lastFrameNumber is the expected last
52 * frame number of the current request.
53 */
Igor Murashkine7ee7632013-06-11 18:10:18 -070054 virtual int submitRequest(sp<CaptureRequest> request,
Jianing Weicb0652e2014-03-12 18:29:36 -070055 bool streaming = false,
56 /*out*/
57 int64_t* lastFrameNumber = NULL) = 0;
58
59 /**
60 * For streaming requests, output lastFrameNumber is the last frame number
61 * of the previous repeating request.
62 * For non-streaming requests, output lastFrameNumber is the expected last
63 * frame number of the current request.
64 */
65 virtual int submitRequestList(List<sp<CaptureRequest> > requestList,
66 bool streaming = false,
67 /*out*/
68 int64_t* lastFrameNumber = NULL) = 0;
69
70 /**
71 * Output lastFrameNumber is the last frame number of the previous repeating request.
72 */
73 virtual status_t cancelRequest(int requestId,
74 /*out*/
75 int64_t* lastFrameNumber = NULL) = 0;
Igor Murashkine7ee7632013-06-11 18:10:18 -070076
77 virtual status_t deleteStream(int streamId) = 0;
78 virtual status_t createStream(
79 int width, int height, int format,
80 const sp<IGraphicBufferProducer>& bufferProducer) = 0;
81
82 // Create a request object from a template.
83 virtual status_t createDefaultRequest(int templateId,
84 /*out*/
85 CameraMetadata* request) = 0;
86 // Get static camera metadata
Igor Murashkin099b4572013-07-12 17:52:16 -070087 virtual status_t getCameraInfo(/*out*/
88 CameraMetadata* info) = 0;
Igor Murashkine7ee7632013-06-11 18:10:18 -070089
Zhijun He2ab500c2013-07-23 08:02:53 -070090 // Wait until all the submitted requests have finished processing
91 virtual status_t waitUntilIdle() = 0;
Eino-Ville Talvalaabaa51d2013-08-14 11:37:00 -070092
Jianing Weicb0652e2014-03-12 18:29:36 -070093 /**
94 * Flush all pending and in-progress work as quickly as possible.
95 * Output lastFrameNumber is the last frame number of the previous repeating request.
96 */
97 virtual status_t flush(/*out*/
98 int64_t* lastFrameNumber = NULL) = 0;
Igor Murashkine7ee7632013-06-11 18:10:18 -070099};
100
101// ----------------------------------------------------------------------------
102
103class BnCameraDeviceUser: public BnInterface<ICameraDeviceUser>
104{
105public:
106 virtual status_t onTransact( uint32_t code,
107 const Parcel& data,
108 Parcel* reply,
109 uint32_t flags = 0);
110};
111
112}; // namespace android
113
114#endif