• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 
19 #ifndef __HI_COMM_VO_ADAPT_H__
20 #define __HI_COMM_VO_ADAPT_H__
21 
22 #include "hi_type.h"
23 #include "hi_comm_video_adapt.h"
24 #include "hi_comm_vo.h"
25 #include "hi_comm_vo_dev_adapt.h"
26 
27 #ifdef __cplusplus
28 #if __cplusplus
29 extern "C" {
30 #endif
31 #endif /* end of #ifdef __cplusplus */
32 
33 typedef VO_ZOOM_IN_E hi_vo_zoom_in;
34 
35 typedef struct {
36     hi_u32 priority; /* video out overlay pri sd */
37     hi_rect rect; /* rectangle of video output channel */
38     hi_bool deflicker; /* deflicker or not sd */
39 } hi_vo_chn_attr;
40 
41 typedef struct {
42     hi_aspect_ratio aspect_ratio; /* RW; aspect ratio */
43 } hi_vo_chn_param;
44 
45 typedef struct {
46     hi_bool border_en; /* RW; do frame or not */
47     hi_border border; /* RW; frame's top, bottom, left, right width and color */
48 } hi_vo_border;
49 
50 typedef struct {
51     hi_u32 chn_buf_used; /* channel buffer that been occupied */
52 } hi_vo_query_status;
53 
54 typedef struct {
55     hi_size target_size; /* RW; WBC zoom target size */
56     hi_pixel_format pixel_format; /* RW; the pixel format of WBC output */
57     hi_u32 frame_rate; /* RW; frame rate control */
58     hi_dynamic_range dynamic_range; /* RW; write back dynamic range type */
59     hi_compress_mode compress_mode; /* RW; write back compressing mode */
60 } hi_vo_wbc_attr;
61 
62 typedef VO_WBC_MODE_E hi_vo_wbc_mode;
63 
64 typedef VO_WBC_SOURCE_TYPE_E hi_vo_wbc_source_type;
65 
66 typedef struct {
67     hi_vo_wbc_source_type source_type; /* RW; WBC source's type */
68     hi_u32 source_id; /* RW; WBC source's ID */
69 } hi_vo_wbc_source;
70 
71 typedef VO_PART_MODE_E hi_vo_part_mode;
72 
73 typedef struct {
74     hi_rect disp_rect; /* RW; display resolution */
75     hi_size image_size; /* RW; canvas size of the video layer */
76     hi_u32 disp_frm_rt; /* RW; display frame rate */
77     hi_pixel_format pix_format; /* RW; pixel format of the video layer */
78     hi_bool double_frame; /* RW; whether to double frames */
79     hi_bool cluster_mode; /* RW; whether to take cluster way to use memory */
80     hi_dynamic_range dst_dynamic_range; /* RW; video layer output dynamic range type */
81 } hi_vo_video_layer_attr;
82 
83 typedef struct {
84     hi_aspect_ratio aspect_ratio; /* RW; aspect ratio */
85 } hi_vo_layer_param;
86 
87 typedef struct {
88     hi_u32 x_ratio; /* RW; range: [0, 1000]; x_ratio = x * 1000 / W,
89                               x means the start point to be zoomed, W means displaying channel's width. */
90     hi_u32 y_ratio; /* RW; range: [0, 1000]; y_ratio = y * 1000 / H,
91                               y means the start point to be zoomed, H means displaying channel's height. */
92     hi_u32 w_ratio; /* RW; range: [0, 1000]; w_ratio = w * 1000 / W,
93                               w means the width to be zoomed, W means displaying channel's width. */
94     hi_u32 h_ratio; /* RW; range: [0, 1000]; h_ratio = h * 1000 / H,
95                               h means the height to be zoomed, H means displaying channel's height. */
96 } hi_vo_zoom_ratio;
97 
98 typedef struct {
99     hi_vo_zoom_in zoom_type; /* choose the type of zoom in */
100     union {
101         hi_rect zoom_rect; /* zoom in by rect */
102         hi_vo_zoom_ratio zoom_ratio; /* zoom in by ratio */
103     };
104 } hi_vo_zoom_attr;
105 
106 typedef struct {
107     hi_u32 region_num; /* count of the region */
108     hi_rect *ATTRIBUTE region; /* region attribute */
109 } hi_vo_region_info;
110 
111 typedef struct {
112     hi_u32 width;
113     hi_u32 color[2]; /* RW; 2 color indexes */
114 } hi_vo_layer_boundary;
115 
116 typedef struct {
117     hi_bool boundary_en; /* RW; do frame or not */
118     hi_u32 color_index; /* RW; the index of frame color, {0,1} */
119 } hi_vo_chn_boundary;
120 
121 typedef VO_MIRROR_MODE_E hi_vo_mirror_mode;
122 
123 #ifdef __cplusplus
124 #if __cplusplus
125 }
126 #endif
127 #endif /* end of #ifdef __cplusplus */
128 
129 #endif /* end of #ifndef __HI_COMM_VO_ADAPT_H__ */
130