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
- vid_get_viewport_fb
- vid_get_viewport_fb_d
- 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_byte_width
- vid_get_viewport_display_xoffset_proper
- vid_get_viewport_display_yoffset_proper
- vid_get_viewport_fullscreen_width
- vid_get_viewport_fullscreen_height
- vid_get_viewport_buffer_width_proper
- vid_get_viewport_type
- vid_get_bitmap_active_buffer
- vid_get_opacity_active_buffer
- update_screen_dimensions
- camera_jpeg_count_str
1 #include "platform.h"
2 #include "lolevel.h"
3 #include "live_view.h"
4
5 extern int active_bitmap_buffer;
6
7 void vid_bitmap_refresh() {
8
9 extern void _transfer_src_overlay(int);
10
11
12 _transfer_src_overlay(0);
13 _transfer_src_overlay(1);
14 }
15
16 void shutdown() {
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 while(1);
32 }
33
34 #define LED_PR 0xd20b0994
35
36 void debug_led(int state) {
37 volatile long *p = (void*)LED_PR;
38 *p = ((state) ? 0x4d0002 : 0x4c0003);
39 }
40
41
42
43 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
44 static char led_table[2]={0,4};
45 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
46 }
47
48 void shutdown_soft() {
49 _PostLogicalEventForNotPowerType(0x1005,0);
50 }
51
52 int get_flash_params_count(void) {
53 return 0xe5;
54 }
55
56 void JogDial_CW(void) {
57 _PostLogicalEventToUI(0x872, 1);
58 }
59
60 void JogDial_CCW(void) {
61 _PostLogicalEventToUI(0x873, 1);
62 }
63
64
65 extern char* current_raw_addr;
66 char *hook_raw_image_addr()
67 {
68 if(current_raw_addr) {
69 return current_raw_addr;
70 }
71
72 return (char *)0x41574352;
73 }
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 void *vid_get_viewport_fb() {
89 return (void*)0x42cafe00;
90 }
91
92
93
94 void *vid_get_viewport_fb_d() {
95
96 extern void *current_fb_d;
97 return current_fb_d;
98 }
99
100 extern void* viewport_buffers[];
101
102
103
104
105
106
107
108
109 extern void *current_viewport_buffer;
110 void *vid_get_viewport_live_fb()
111 {
112
113 int i;
114 for(i=0;i<4;i++) {
115 if(current_viewport_buffer == viewport_buffers[i]) {
116 return viewport_buffers[(i+1)&3];
117 }
118 }
119 return 0;
120 }
121
122
123
124 static int vp_full_width = 640;
125 static int vp_full_buf_width = 640;
126 static int vp_full_height = 480;
127
128 int vid_get_viewport_width() {
129 extern int _GetVRAMHPixelsSize();
130 if (camera_info.state.mode_play)
131 {
132 return vp_full_width;
133 }
134
135
136 return _GetVRAMHPixelsSize();
137 }
138
139 long vid_get_viewport_height() {
140 extern int _GetVRAMVPixelsSize();
141 if (camera_info.state.mode_play)
142 {
143 return vp_full_height;
144 }
145
146 return _GetVRAMVPixelsSize();
147 }
148
149 int vid_get_viewport_yoffset() {
150
151 return 0;
152 }
153
154
155 static long vp_xo[4] = { 0, 0, 0, 80 };
156
157 int vid_get_viewport_display_xoffset() {
158 if (camera_info.state.mode_play)
159 {
160 return 0;
161 }
162
163 if(camera_info.state.mode_video || is_video_recording()) {
164 return 0;
165 }
166 return vp_xo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
167 }
168
169
170 static long vp_yo[4] = { 0, 60, 28, 0 };
171
172 int vid_get_viewport_display_yoffset() {
173 if (camera_info.state.mode_play)
174 {
175 return 0;
176 }
177
178 if(camera_info.state.mode_video || is_video_recording()) {
179 if(shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 2) {
180 return 0;
181 } else {
182 return 60;
183 }
184 }
185 return vp_yo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
186 }
187
188 extern char* bitmap_buffer[];
189
190 void *vid_get_bitmap_fb() {
191 return (void *)0x5ff02e00;
192 }
193
194 int vid_get_viewport_byte_width() {
195 return vp_full_buf_width*2;
196 }
197
198
199 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset(); }
200 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset(); }
201 int vid_get_viewport_fullscreen_width() { return vp_full_width; }
202 int vid_get_viewport_fullscreen_height() { return vp_full_height; }
203 int vid_get_viewport_buffer_width_proper() { return vp_full_buf_width; }
204 int vid_get_viewport_type() { return LV_FB_YUV8B; }
205
206 void *vid_get_bitmap_active_buffer() {
207 return bitmap_buffer[active_bitmap_buffer&1];
208 }
209
210
211
212 volatile char *opacity_buffer[2] = {(char*)0x5fd87300, (void*)0x5fd08a00};
213
214
215 void *vid_get_opacity_active_buffer() {
216 return (void *)opacity_buffer[active_bitmap_buffer&1];
217 }
218
219 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
220
221
222
223
224 void update_screen_dimensions() {
225
226 extern int displaytype;
227 static int old_displaytype = -1;
228
229 if (old_displaytype == displaytype) {
230 return;
231 }
232 old_displaytype = displaytype;
233
234 switch(displaytype) {
235 case 0:
236 case 3:
237 case 4:
238 case 5:
239
240 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 640;
241 camera_screen.height = camera_screen.buffer_height = 480;
242 camera_screen.size = camera_screen.buffer_size = 640*480;
243 break;
244
245 case 1:
246 case 2:
247 case 8:
248 case 9:
249 case 10:
250 camera_screen.physical_width = camera_screen.width = 720;
251 camera_screen.buffer_width = 736;
252 camera_screen.height = camera_screen.buffer_height = 480;
253 camera_screen.size = 720*480;
254 camera_screen.buffer_size = 736*480;
255 break;
256
257 case 6:
258 case 7:
259 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 960;
260 camera_screen.height = camera_screen.buffer_height = 540;
261 camera_screen.size = camera_screen.buffer_size = 960*540;
262 break;
263
264 case 11:
265 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 1024;
266 camera_screen.height = camera_screen.buffer_height = 768;
267 camera_screen.size = 1024*768;
268 camera_screen.buffer_size = 1024*768;
269 break;
270 case 12:
271 camera_screen.width = 900;
272 camera_screen.physical_width = camera_screen.buffer_width = 928;
273 camera_screen.height = camera_screen.buffer_height = 600;
274 camera_screen.size = 900*600;
275 camera_screen.buffer_size = 928*600;
276 break;
277
278 }
279 if(displaytype == 6 || displaytype == 7) {
280 vp_full_width = 1920;
281 vp_full_buf_width = 1920;
282 vp_full_height = 1080;
283 } else {
284
285 vp_full_width = camera_screen.width;
286 vp_full_buf_width = camera_screen.buffer_width;
287 vp_full_height = camera_screen.height;
288 }
289 }
290 #endif
291
292 char *camera_jpeg_count_str()
293 {
294 extern char jpeg_count_str[];
295 return jpeg_count_str;
296 }