blob: 2437758035e5efd9311074368b69554c5f49fc22
1 | /* |
2 | * Copyright (C) 2012 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 | /** |
18 | * This file includes various basic structures that are needed by multiple parts |
19 | * of the fake camera 2 implementation. |
20 | */ |
21 | |
22 | #ifndef HW_EMULATOR_CAMERA2_BASE_H |
23 | #define HW_EMULATOR_CAMERA2_BASE_H |
24 | |
25 | #include <system/window.h> |
26 | #include <hardware/camera2.h> |
27 | #include <utils/Vector.h> |
28 | |
29 | namespace android { |
30 | |
31 | |
32 | /* Internal structure for passing buffers across threads */ |
33 | struct StreamBuffer { |
34 | // Positive numbers are output streams |
35 | // Negative numbers are input reprocess streams |
36 | // Zero is an auxillary buffer |
37 | int streamId; |
38 | uint32_t width, height; |
39 | uint32_t format; |
40 | uint32_t stride; |
41 | buffer_handle_t *buffer; |
42 | uint8_t *img; |
43 | int share_fd; |
44 | }; |
45 | typedef Vector<StreamBuffer> Buffers; |
46 | |
47 | struct Stream { |
48 | const camera2_stream_ops_t *ops; |
49 | uint32_t width, height; |
50 | int32_t format; |
51 | uint32_t stride; |
52 | }; |
53 | |
54 | struct ReprocessStream { |
55 | const camera2_stream_in_ops_t *ops; |
56 | uint32_t width, height; |
57 | int32_t format; |
58 | uint32_t stride; |
59 | // -1 if the reprocessing stream is independent |
60 | int32_t sourceStreamId; |
61 | }; |
62 | |
63 | struct ExifInfo { |
64 | int mainwidth; |
65 | int mainheight; |
66 | int thumbwidth; |
67 | int thumbheight; |
68 | int64_t gpsTimestamp; |
69 | double longitude; |
70 | double latitude; |
71 | double altitude; |
72 | uint8_t gpsProcessingMethod[32]; |
73 | bool has_longitude; |
74 | bool has_latitude; |
75 | bool has_altitude; |
76 | bool has_gpsTimestamp; |
77 | bool has_gpsProcessingMethod; |
78 | bool has_focallen; |
79 | float focallen; |
80 | int orientation; |
81 | }; |
82 | } // namespace android; |
83 | |
84 | #endif |
85 |