blob: e27819641cb90d7b17c17cc99128ae15ee09754c [file] [log] [blame]
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -08001/*
2 * Copyright (C) 2015 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
Yin-Chia Yeh3e49be12016-04-12 16:00:33 -070017/**
18 * @addtogroup Camera
19 * @{
20 */
21
22/**
23 * @file NdkCaptureRequest.h
24 */
25
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080026/*
27 * This file defines an NDK API.
28 * Do not remove methods.
29 * Do not change method signatures.
30 * Do not change the value of constants.
31 * Do not change the size of any of the classes defined in here.
32 * Do not reference types that are not part of the NDK.
33 * Do not #include files that aren't part of the NDK.
34 */
35#include <android/native_window.h>
36#include "NdkCameraError.h"
37#include "NdkCameraMetadata.h"
38
39#ifndef _NDK_CAPTURE_REQUEST_H
40#define _NDK_CAPTURE_REQUEST_H
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46// Container for output targets
47typedef struct ACameraOutputTargets ACameraOutputTargets;
48
49// Container for a single output target
50typedef struct ACameraOutputTarget ACameraOutputTarget;
51
52typedef struct ACaptureRequest ACaptureRequest;
53
Yin-Chia Yehead91462016-01-06 16:45:08 -080054camera_status_t ACameraOutputTarget_create(ANativeWindow* window, ACameraOutputTarget** out);
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080055void ACameraOutputTarget_free(ACameraOutputTarget*);
56
57camera_status_t ACaptureRequest_addTarget(ACaptureRequest*, const ACameraOutputTarget*);
58camera_status_t ACaptureRequest_removeTarget(ACaptureRequest*, const ACameraOutputTarget*);
Yin-Chia Yehead91462016-01-06 16:45:08 -080059//TODO: do we need API to query added targets?
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080060
61/*
62 * Get a metadata entry
63 */
64camera_status_t ACaptureRequest_getConstEntry(
65 const ACaptureRequest*, uint32_t tag, ACameraMetadata_const_entry* entry);
Yin-Chia Yeh8aac03f2016-03-03 15:45:23 -080066
67/*
68 * List all the entry tags in this capture request.
69 * The memory of tags is managed by ACaptureRequest itself and must NOT be free/delete
70 * by application. Calling ACaptureRequest_setEntry_* API will invalidate previous
71 * output of ACaptureRequest_getAllTags. Do not access tags after calling
72 * ACaptureRequest_setEntry_*. To get new list of tags after updating capture request,
73 * application must call ACaptureRequest_getAllTags again.
74 * Do NOT access tags after calling ACaptureRequest_free.
75 */
76camera_status_t ACaptureRequest_getAllTags(
77 const ACaptureRequest*, /*out*/int32_t* numTags, /*out*/const uint32_t** tags);
78
Yin-Chia Yeh0dea57f2015-12-09 16:46:07 -080079/*
80 * Set an entry of corresponding type.
81 * The entry tag's type must match corresponding set API or an
82 * ACAMERA_ERROR_INVALID_PARAMETER error will occur.
83 * Also, the input ACameraMetadata* must belong to a capture request or an
84 * ACAMERA_ERROR_INVALID_PARAMETER error will occur.
85 */
86camera_status_t ACaptureRequest_setEntry_u8(
87 ACaptureRequest*, uint32_t tag, uint32_t count, const uint8_t* data);
88camera_status_t ACaptureRequest_setEntry_i32(
89 ACaptureRequest*, uint32_t tag, uint32_t count, const int32_t* data);
90camera_status_t ACaptureRequest_setEntry_float(
91 ACaptureRequest*, uint32_t tag, uint32_t count, const float* data);
92camera_status_t ACaptureRequest_setEntry_i64(
93 ACaptureRequest*, uint32_t tag, uint32_t count, const int64_t* data);
94camera_status_t ACaptureRequest_setEntry_double(
95 ACaptureRequest*, uint32_t tag, uint32_t count, const double* data);
96camera_status_t ACaptureRequest_setEntry_rational(
97 ACaptureRequest*, uint32_t tag, uint32_t count, const ACameraMetadata_rational* data);
98
99// free the capture request created by ACameraDevice_createCaptureRequest
100void ACaptureRequest_free(ACaptureRequest* request);
101
102#ifdef __cplusplus
103} // extern "C"
104#endif
105
106#endif // _NDK_CAPTURE_REQUEST_H
Yin-Chia Yeh3e49be12016-04-12 16:00:33 -0700107
108/** @} */