Alex Ray | 61f7a0c | 2013-07-03 17:54:19 -0700 | [diff] [blame] | 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 EXAMPLE_CAMERA_H_ |
| 18 | #define EXAMPLE_CAMERA_H_ |
| 19 | |
| 20 | #include <system/camera_metadata.h> |
| 21 | #include "Camera.h" |
| 22 | |
| 23 | namespace default_camera_hal { |
| 24 | // ExampleCamera is an example for a specific camera device. The Camera object |
| 25 | // contains all logic common between all cameras (e.g. front and back cameras), |
| 26 | // while a specific camera device (e.g. ExampleCamera) holds all specific |
| 27 | // metadata and logic about that device. |
| 28 | class ExampleCamera : public Camera { |
| 29 | public: |
Chih-Hung Hsieh | 928e679 | 2016-06-30 14:17:31 -0700 | [diff] [blame] | 30 | explicit ExampleCamera(int id); |
Alex Ray | 61f7a0c | 2013-07-03 17:54:19 -0700 | [diff] [blame] | 31 | ~ExampleCamera(); |
| 32 | |
| 33 | private: |
| 34 | // Initialize static camera characteristics for individual device |
| 35 | camera_metadata_t *initStaticInfo(); |
| 36 | // Initialize whole device (templates/etc) when opened |
| 37 | int initDevice(); |
Alex Ray | 6273508 | 2013-10-21 12:55:24 -0700 | [diff] [blame] | 38 | // Initialize each template metadata controls |
| 39 | int setPreviewTemplate(Metadata m); |
| 40 | int setStillTemplate(Metadata m); |
| 41 | int setRecordTemplate(Metadata m); |
| 42 | int setSnapshotTemplate(Metadata m); |
| 43 | int setZslTemplate(Metadata m); |
Alex Ray | 61f7a0c | 2013-07-03 17:54:19 -0700 | [diff] [blame] | 44 | // Verify settings are valid for a capture with this device |
| 45 | bool isValidCaptureSettings(const camera_metadata_t* settings); |
| 46 | }; |
| 47 | } // namespace default_camera_hal |
| 48 | |
| 49 | #endif // CAMERA_H_ |