blob: f059b3d4f846ac4981e7ab2e8304d6b6afbcafa5 [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_CALLBACKS_H
18#define ANDROID_HARDWARE_PHOTOGRAPHY_CALLBACKS_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/Timers.h>
25#include <system/camera.h>
26
Jianing Weicb0652e2014-03-12 18:29:36 -070027#include <camera/CaptureResult.h>
28
Igor Murashkine7ee7632013-06-11 18:10:18 -070029namespace android {
30class CameraMetadata;
31
Jianing Weicb0652e2014-03-12 18:29:36 -070032
Igor Murashkine7ee7632013-06-11 18:10:18 -070033class ICameraDeviceCallbacks : public IInterface
34{
35 /**
36 * Keep up-to-date with ICameraDeviceCallbacks.aidl in frameworks/base
37 */
38public:
39 DECLARE_META_INTERFACE(CameraDeviceCallbacks);
40
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -070041 /**
42 * Error codes for CAMERA_MSG_ERROR
43 */
44 enum CameraErrorCode {
45 ERROR_CAMERA_DISCONNECTED = 0,
46 ERROR_CAMERA_DEVICE = 1,
47 ERROR_CAMERA_SERVICE = 2
48 };
Igor Murashkine7ee7632013-06-11 18:10:18 -070049
50 // One way
Jianing Weicb0652e2014-03-12 18:29:36 -070051 virtual void onDeviceError(CameraErrorCode errorCode,
52 const CaptureResultExtras& resultExtras) = 0;
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -070053
54 // One way
55 virtual void onDeviceIdle() = 0;
56
57 // One way
Jianing Weicb0652e2014-03-12 18:29:36 -070058 virtual void onCaptureStarted(const CaptureResultExtras& resultExtras,
Eino-Ville Talvalaf1e98d82013-09-06 09:32:43 -070059 int64_t timestamp) = 0;
60
61 // One way
Jianing Weicb0652e2014-03-12 18:29:36 -070062 virtual void onResultReceived(const CameraMetadata& metadata,
63 const CaptureResultExtras& resultExtras) = 0;
Igor Murashkine7ee7632013-06-11 18:10:18 -070064};
65
66// ----------------------------------------------------------------------------
67
68class BnCameraDeviceCallbacks : public BnInterface<ICameraDeviceCallbacks>
69{
70public:
71 virtual status_t onTransact( uint32_t code,
72 const Parcel& data,
73 Parcel* reply,
74 uint32_t flags = 0);
75};
76
77}; // namespace android
78
79#endif