]>
Commit | Line | Data |
---|---|---|
a49d2536 AC |
1 | /* |
2 | * Support for Intel Camera Imaging ISP subsystem. | |
3 | * Copyright (c) 2015, Intel Corporation. | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify it | |
6 | * under the terms and conditions of the GNU General Public License, | |
7 | * version 2, as published by the Free Software Foundation. | |
8 | * | |
9 | * This program is distributed in the hope it will be useful, but WITHOUT | |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
12 | * more details. | |
13 | */ | |
14 | ||
15 | #ifndef __IA_CSS_METADATA_H | |
16 | #define __IA_CSS_METADATA_H | |
17 | ||
d929fb4e | 18 | /* @file |
a49d2536 AC |
19 | * This file contains structure for processing sensor metadata. |
20 | */ | |
21 | ||
22 | #include <type_support.h> | |
23 | #include "ia_css_types.h" | |
24 | #include "ia_css_stream_format.h" | |
25 | ||
d929fb4e | 26 | /* Metadata configuration. This data structure contains necessary info |
a49d2536 AC |
27 | * to process sensor metadata. |
28 | */ | |
29 | struct ia_css_metadata_config { | |
d929fb4e | 30 | enum ia_css_stream_format data_type; /** Data type of CSI-2 embedded |
a49d2536 AC |
31 | data. The default value is IA_CSS_STREAM_FORMAT_EMBEDDED. For |
32 | certain sensors, user can choose non-default data type for embedded | |
33 | data. */ | |
d929fb4e | 34 | struct ia_css_resolution resolution; /** Resolution */ |
a49d2536 AC |
35 | }; |
36 | ||
37 | struct ia_css_metadata_info { | |
d929fb4e MCC |
38 | struct ia_css_resolution resolution; /** Resolution */ |
39 | uint32_t stride; /** Stride in bytes */ | |
40 | uint32_t size; /** Total size in bytes */ | |
a49d2536 AC |
41 | }; |
42 | ||
43 | struct ia_css_metadata { | |
d929fb4e MCC |
44 | struct ia_css_metadata_info info; /** Layout info */ |
45 | ia_css_ptr address; /** CSS virtual address */ | |
a49d2536 | 46 | uint32_t exp_id; |
d929fb4e | 47 | /** Exposure ID, see ia_css_event_public.h for more detail */ |
a49d2536 AC |
48 | }; |
49 | #define SIZE_OF_IA_CSS_METADATA_STRUCT sizeof(struct ia_css_metadata) | |
50 | ||
d929fb4e | 51 | /* @brief Allocate a metadata buffer. |
a49d2536 AC |
52 | * @param[in] metadata_info Metadata info struct, contains details on metadata buffers. |
53 | * @return Pointer of metadata buffer or NULL (if error) | |
54 | * | |
55 | * This function allocates a metadata buffer according to the properties | |
56 | * specified in the metadata_info struct. | |
57 | */ | |
58 | struct ia_css_metadata * | |
59 | ia_css_metadata_allocate(const struct ia_css_metadata_info *metadata_info); | |
60 | ||
d929fb4e | 61 | /* @brief Free a metadata buffer. |
a49d2536 AC |
62 | * |
63 | * @param[in] metadata Pointer of metadata buffer. | |
64 | * @return None | |
65 | * | |
66 | * This function frees a metadata buffer. | |
67 | */ | |
68 | void | |
69 | ia_css_metadata_free(struct ia_css_metadata *metadata); | |
70 | ||
71 | #endif /* __IA_CSS_METADATA_H */ |