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
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:
30        ExampleCamera(int id);
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();
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);
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_
50