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_aspect_ratio
- 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
10
11
12
13
14
15 extern void _transfer_src_overlay(int);
16
17
18 _transfer_src_overlay(0);
19 _transfer_src_overlay(1);
20 }
21
22 void shutdown() {
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 while(1);
38 }
39
40 #define LED_PR 0xd20b0994
41
42 void debug_led(int state) {
43 volatile long *p = (void*)LED_PR;
44 *p = ((state) ? 0x4d0002 : 0x4c0003);
45 }
46
47
48
49 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
50 static char led_table[2]={0,4};
51 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
52 }
53
54 void shutdown_soft() {
55 _PostLogicalEventForNotPowerType(0x1005,0);
56 }
57
58 int get_flash_params_count(void) {
59 return 0xde;
60 }
61
62 void JogDial_CW(void) {
63 _PostLogicalEventToUI(0x872, 1);
64 }
65
66 void JogDial_CCW(void) {
67 _PostLogicalEventToUI(0x873, 1);
68 }
69
70
71 extern int active_raw_buffer;
72 extern char* raw_buffers_canon_raw[];
73 extern char* raw_buffers_jpeg[];
74
75
76 extern char* current_raw_addr;
77
78 char *hook_raw_image_addr()
79 {
80 if(current_raw_addr) {
81 return current_raw_addr;
82 }
83
84
85
86 int i=active_raw_buffer&3;
87 if(i>2) {
88 i=0;
89 }
90 if( camera_info.state.mode_shooting == MODE_AUTO) {
91
92 return (char *)0x46f04300;
93 }else if(shooting_get_prop(PROPCASE_IMAGE_FORMAT) == 1) {
94
95 return raw_buffers_jpeg[i];
96 } else {
97
98 return raw_buffers_canon_raw[i];
99 }
100
101 }
102
103
104
105
106
107
108
109
110
111 void *vid_get_viewport_fb() {
112 return (void*)0x43334300;
113
114
115
116
117 }
118
119
120
121
122
123
124
125
126
127 void *vid_get_viewport_fb_d() {
128
129
130
131
132
133
134
135
136
137
138 extern void *current_fb_d;
139 return current_fb_d;
140 }
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175 extern void* viewport_buffers[];
176 extern void *current_viewport_buffer;
177
178 void *vid_get_viewport_live_fb()
179 {
180
181 int i;
182 for(i=0;i<4;i++) {
183 if(current_viewport_buffer == viewport_buffers[i]) {
184 return viewport_buffers[(i+1)&3];
185 }
186 }
187 return 0;
188 }
189
190
191 static int vp_full_width = 720;
192 static int vp_full_buf_width = 736;
193 static int vp_full_height = 480;
194 static int lv_aspect = LV_ASPECT_3_2;
195
196
197
198 int vid_get_viewport_width() {
199 extern int _GetVRAMHPixelsSize();
200 if (camera_info.state.mode_play)
201 {
202 return vp_full_width;
203 }
204 return _GetVRAMHPixelsSize();
205 }
206
207 long vid_get_viewport_height() {
208 extern int _GetVRAMVPixelsSize();
209 if (camera_info.state.mode_play)
210 {
211 return vp_full_height;
212 }
213 return _GetVRAMVPixelsSize();
214 }
215
216 int vid_get_viewport_yoffset() {
217
218 return 0;
219 }
220
221
222 static long vp_xo[3][5] = {
223
224 { 0, 0, 0, 90, 144 },
225 { 0, 0, 0, 0, 0 },
226 { 40, 0, 0, 120, 168 },
227 };
228
229 int vid_get_viewport_display_xoffset() {
230 if (camera_info.state.mode_play)
231 {
232 return 0;
233 }
234
235 if(camera_info.state.mode_video || is_video_recording()) {
236 if(shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 2) {
237 return vp_xo[lv_aspect][0];
238 } else {
239 return 0;
240 }
241 }
242 return vp_xo[lv_aspect][shooting_get_prop(PROPCASE_ASPECT_RATIO)];
243 }
244
245 static long vp_yo[3][5] = {
246
247 { 0, 60, 27, 0, 0 },
248 { 0, 0, 0, 0, 0 },
249 { 0, 36, 0, 0, 0 },
250 };
251
252 int vid_get_viewport_display_yoffset() {
253 if (camera_info.state.mode_play)
254 {
255 return 0;
256 }
257
258 if(camera_info.state.mode_video || is_video_recording()) {
259 if(shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 2) {
260 return 0;
261 } else {
262 return vp_yo[lv_aspect][1];
263 }
264 }
265 return vp_yo[lv_aspect][shooting_get_prop(PROPCASE_ASPECT_RATIO)];
266 }
267
268 extern char* bitmap_buffer[];
269
270 void *vid_get_bitmap_fb() {
271 return (void *)0x41441000;
272 }
273
274 int vid_get_viewport_byte_width() {
275 return (vp_full_buf_width * 2);
276 }
277
278
279 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset(); }
280 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset(); }
281 int vid_get_viewport_fullscreen_width() { return vp_full_width; }
282 int vid_get_viewport_fullscreen_height() { return vp_full_height; }
283 int vid_get_viewport_buffer_width_proper() { return vp_full_buf_width; }
284 int vid_get_viewport_type() { return LV_FB_YUV8B; }
285 int vid_get_aspect_ratio() { return lv_aspect; }
286 void *vid_get_bitmap_active_buffer() {
287 return bitmap_buffer[active_bitmap_buffer&1];
288 }
289
290
291
292
293
294
295
296
297
298 volatile char *opacity_buffer[2] = {(char*)0x4163b400, (void*)0x416b9d00};
299
300
301 void *vid_get_opacity_active_buffer() {
302 return (void *)opacity_buffer[active_bitmap_buffer&1];
303 }
304
305 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
306
307
308
309
310 void update_screen_dimensions() {
311
312 extern int displaytype;
313 static int old_displaytype = -1;
314
315 if (old_displaytype == displaytype) {
316 return;
317 }
318 old_displaytype = displaytype;
319
320 switch(displaytype) {
321 case 0:
322 case 3:
323 case 4:
324 case 5:
325
326 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 640;
327 camera_screen.height = camera_screen.buffer_height = 480;
328 camera_screen.size = camera_screen.buffer_size = 640*480;
329 break;
330 case 1:
331 case 2:
332 case 8:
333 case 9:
334 case 10:
335 camera_screen.width = camera_screen.physical_width = 720;
336 camera_screen.buffer_width = 736;
337 camera_screen.height = camera_screen.buffer_height = 480;
338 camera_screen.size = 720*480;
339 camera_screen.buffer_size = 736*480;
340 break;
341 case 6:
342 case 7:
343 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 960;
344 camera_screen.height = camera_screen.buffer_height = 540;
345 camera_screen.size = camera_screen.buffer_size = 960*540;
346 break;
347 case 11:
348 camera_screen.width = 1024;
349 camera_screen.physical_width = camera_screen.buffer_width = 1024;
350 camera_screen.height = camera_screen.buffer_height = 768;
351 camera_screen.size = 1024*768;
352 camera_screen.buffer_size = 1024*768;
353 break;
354 }
355 if(displaytype == 6 || displaytype == 7) {
356 vp_full_width = 1920;
357 vp_full_buf_width = 1920;
358 vp_full_height = 1080;
359 lv_aspect = LV_ASPECT_16_9;
360 } else {
361
362 vp_full_width = 720;
363 vp_full_buf_width = 736;
364 vp_full_height = 480;
365 if(displaytype == 10) {
366 lv_aspect = LV_ASPECT_3_2;
367 } else {
368 lv_aspect = LV_ASPECT_4_3;
369 }
370 }
371 }
372 #endif
373
374 char *camera_jpeg_count_str()
375 {
376 extern char jpeg_count_str[];
377 return jpeg_count_str;
378 }