blob: 44eac765273d58e6fc61eabc1bb21ffb39fe2074 [file] [log] [blame]
Alex Ray61f7a0c2013-07-03 17:54:19 -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 EXAMPLE_CAMERA_H_
18#define EXAMPLE_CAMERA_H_
19
20#include <system/camera_metadata.h>
21#include "Camera.h"
22
23namespace 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.
28class ExampleCamera : public Camera {
29 public:
Chih-Hung Hsieh928e6792016-06-30 14:17:31 -070030 explicit ExampleCamera(int id);
Alex Ray61f7a0c2013-07-03 17:54:19 -070031 ~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 Ray62735082013-10-21 12:55:24 -070038 // 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 Ray61f7a0c2013-07-03 17:54:19 -070044 // 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_