summaryrefslogtreecommitdiff
path: root/libcamera2/MetadataConverter.h
blob: 2d637d0eac4cac6622802f0fb4df716253c09b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
**
** Copyright 2008, The Android Open Source Project
** Copyright 2012, Samsung Electronics Co. LTD
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

/*!
 * \file      MetadataConverter.h
 * \brief     header file for Metadata converter ( for camera hal2 implementation )
 * \author    Sungjoong Kang(sj3.kang@samsung.com)
 * \date      2012/05/31
 *
 * <b>Revision History: </b>
 * - 2012/05/31 : Sungjoong Kang(sj3.kang@samsung.com) \n
 *   Initial Release
 */

#ifndef METADATA_CONVERTER_H
#define METADATA_CONVERTER_H

#include <hardware/camera2.h>
#include <camera/Camera.h>
#include <camera/CameraParameters.h>

#include "system/camera_metadata.h"
#include "fimc-is-metadata.h"


namespace android {


class MetadataConverter  {
public:
    MetadataConverter();
    ~MetadataConverter();

    status_t ToInternalShot(camera_metadata_t * request, struct camera2_shot_ext * dst_ext);
    status_t ToDynamicMetadata(struct camera2_shot_ext * metadata_ext, camera_metadata_t * dst);

private:
    status_t CheckEntryTypeMismatch(camera_metadata_entry_t * entry, uint8_t type);	
    status_t CheckEntryTypeMismatch(camera_metadata_entry_t * entry, uint8_t type, size_t count);
    status_t ApplySceneModeParameters(camera_metadata_t * request, struct camera2_shot_ext * dst_ext);

    uint32_t    metaFaceRectangles[CAMERA2_MAX_FACES][4];
    uint8_t      metaFaceScores[CAMERA2_MAX_FACES];
    uint32_t    mataFaceLandmarks[CAMERA2_MAX_FACES][6];
    uint32_t    mataFaceIds[CAMERA2_MAX_FACES];
};

}; // namespace android

#endif