This source file includes following definitions.
- vid_bitmap_refresh
- shutdown
- debug_led
- camera_set_led
- shutdown_soft
- get_flash_params_count
- JogDial_CW
- JogDial_CCW
- hook_raw_image_addr
- hook_alt_raw_image_addr
- vid_get_viewport_fb_d
- vid_get_viewport_fb
- vid_get_viewport_live_fb
- vid_get_viewport_width
- vid_get_viewport_height
- vid_get_viewport_yoffset
- vid_get_viewport_display_xoffset
- vid_get_viewport_display_yoffset
- vid_get_bitmap_fb
- vid_get_viewport_display_xoffset_proper
- vid_get_viewport_display_yoffset_proper
- vid_get_viewport_fullscreen_height
- vid_get_viewport_buffer_width_proper
- vid_get_viewport_byte_width
- vid_get_viewport_type
- vid_get_bitmap_active_buffer
- vid_get_opacity_active_buffer
- update_screen_dimensions
1 #include "platform.h"
2 #include "lolevel.h"
3 #include "live_view.h"
4
5 void vid_bitmap_refresh() {
6 extern void _transfer_src_overlay(int);
7 _transfer_src_overlay(0);
8 _transfer_src_overlay(1);
9 }
10
11 void shutdown() {
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 while(1);
27 }
28
29 #define LED_PR 0xd20b0994
30
31 void debug_led(int state) {
32 volatile long *p = (void*)LED_PR;
33 *p = ((state) ? 0x4d0002 : 0x4c0003);
34 }
35
36
37
38 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
39 static char led_table[2]={0,4};
40 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
41 }
42
43 void shutdown_soft() {
44 _PostLogicalEventForNotPowerType(0x1005,0);
45 }
46
47 int get_flash_params_count(void) {
48 return 0x91;
49 }
50
51 void JogDial_CW(void) {
52 _PostLogicalEventToUI(0x872, 1);
53 }
54
55 void JogDial_CCW(void) {
56 _PostLogicalEventToUI(0x873, 1);
57 }
58
59 extern int active_raw_buffer;
60 extern char* raw_buffers[];
61
62 char *hook_raw_image_addr()
63 {
64 return raw_buffers[(active_raw_buffer&1)];
65 }
66
67 char *hook_alt_raw_image_addr()
68 {
69 return raw_buffers[((active_raw_buffer&1)^1)];
70 }
71
72
73
74
75
76
77
78
79 void *vid_get_viewport_fb_d() {
80 extern void *current_fb_d;
81 return current_fb_d;
82 }
83
84 extern void* viewport_buffers[];
85 extern void *current_viewport_buffer;
86
87 void *vid_get_viewport_fb() {
88
89 return viewport_buffers[0];
90
91 }
92
93 void *vid_get_viewport_live_fb() {
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109 int i;
110 for(i=0;i<4;i++) {
111 if(current_viewport_buffer == viewport_buffers[i]) {
112 return viewport_buffers[(i+1)&3];
113 }
114 }
115 return 0;
116 }
117
118 int vid_get_viewport_width() {
119
120
121
122
123
124
125 extern int _GetVRAMHPixelsSize();
126
127 if (camera_info.state.mode_play)
128 return camera_screen.physical_width;
129 return _GetVRAMHPixelsSize();
130 }
131
132 long vid_get_viewport_height() {
133
134
135
136
137
138
139 extern int _GetVRAMVPixelsSize();
140
141 if (camera_info.state.mode_play)
142 return camera_screen.buffer_height;
143 return _GetVRAMVPixelsSize();
144 }
145
146 int vid_get_viewport_yoffset() {
147
148 return 0;
149 }
150
151 int vid_get_viewport_display_xoffset() {
152 return 0;
153 }
154
155 int vid_get_viewport_display_yoffset() {
156 return 0;
157 }
158
159 extern int active_bitmap_buffer;
160 extern char* bitmap_buffer[];
161
162 void *vid_get_bitmap_fb() {
163
164 return bitmap_buffer[0];
165 }
166
167
168 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset(); }
169 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset(); }
170 int vid_get_viewport_fullscreen_height() { return camera_screen.height; }
171 int vid_get_viewport_buffer_width_proper() { return camera_screen.buffer_width; }
172 int vid_get_viewport_byte_width() { return camera_screen.buffer_width * 2; }
173
174 int vid_get_viewport_type() {
175
176
177
178
179
180 return LV_FB_YUV8B;
181 }
182
183 void *vid_get_bitmap_active_buffer() {
184 return bitmap_buffer[active_bitmap_buffer&1];
185 }
186
187
188 volatile char *opacity_buffer[2] = {(char*)0x41718600, (char*)0x41796f00};
189
190 void *vid_get_opacity_active_buffer() {
191 return (void *)opacity_buffer[active_bitmap_buffer&1];
192 }
193
194 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
195
196
197
198
199 void update_screen_dimensions() {
200
201 extern int displaytype;
202 static int old_displaytype = -1;
203
204 if (old_displaytype == displaytype) {
205 return;
206 }
207 old_displaytype = displaytype;
208
209 switch(displaytype) {
210 case 0:
211 case 3:
212 case 4:
213 case 5:
214
215 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 640;
216 camera_screen.height = camera_screen.buffer_height = 480;
217 camera_screen.size = camera_screen.buffer_size = 640*480;
218 break;
219 case 1:
220 case 2:
221 case 8:
222 case 9:
223
224 camera_screen.width = 720;
225 camera_screen.physical_width = camera_screen.buffer_width = 736;
226 camera_screen.height = camera_screen.buffer_height = 480;
227 camera_screen.size = 720*480;
228 camera_screen.buffer_size = 736*480;
229 break;
230 case 6:
231 case 7:
232
233 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 960;
234 camera_screen.height = camera_screen.buffer_height = 540;
235 camera_screen.size = camera_screen.buffer_size = 960*540;
236 break;
237 }
238 }
239 #endif
240