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_PHOTOGRAPHY_ICAMERADEVICEUSER_H
18#define ANDROID_HARDWARE_PHOTOGRAPHY_ICAMERADEVICEUSER_H
19
20#include <binder/IInterface.h>
21#include <binder/Parcel.h>
22
23struct camera_metadata;
24
25namespace android {
26
27class ICameraDeviceUserClient;
28class IGraphicBufferProducer;
29class Surface;
30class CaptureRequest;
31class CameraMetadata;
32
33class ICameraDeviceUser : public IInterface
34{
35    /**
36     * Keep up-to-date with ICameraDeviceUser.aidl in frameworks/base
37     */
38public:
39    DECLARE_META_INTERFACE(CameraDeviceUser);
40
41    virtual void            disconnect() = 0;
42
43    /**
44     * Request Handling
45     **/
46
47    virtual int             submitRequest(sp<CaptureRequest> request,
48                                          bool streaming = false) = 0;
49    virtual status_t        cancelRequest(int requestId) = 0;
50
51    virtual status_t        deleteStream(int streamId) = 0;
52    virtual status_t        createStream(
53            int width, int height, int format,
54            const sp<IGraphicBufferProducer>& bufferProducer) = 0;
55
56    // Create a request object from a template.
57    virtual status_t        createDefaultRequest(int templateId,
58                                                 /*out*/
59                                                 CameraMetadata* request) = 0;
60    // Get static camera metadata
61    virtual status_t        getCameraInfo(/*out*/
62                                          CameraMetadata* info) = 0;
63
64    // Wait until all the submitted requests have finished processing
65    virtual status_t        waitUntilIdle() =  0;
66
67    // Flush all pending and in-progress work as quickly as possible.
68    virtual status_t        flush() = 0;
69};
70
71// ----------------------------------------------------------------------------
72
73class BnCameraDeviceUser: public BnInterface<ICameraDeviceUser>
74{
75public:
76    virtual status_t    onTransact( uint32_t code,
77                                    const Parcel& data,
78                                    Parcel* reply,
79                                    uint32_t flags = 0);
80};
81
82}; // namespace android
83
84#endif
85