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_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_viewport_type
- vid_get_bitmap_fb
- vid_get_viewport_display_xoffset_proper
- vid_get_viewport_display_yoffset_proper
- vid_get_viewport_buffer_width_proper
- vid_get_viewport_fullscreen_width
- vid_get_viewport_byte_width
- vid_get_viewport_fullscreen_height
- 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 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) _SleepTask(500);
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
45
46 _PostLogicalEventForNotPowerType(0x1005,0);
47 }
48
49 int get_flash_params_count(void) {
50 return 0xe6;
51 }
52
53 void JogDial_CW(void) {
54 _PostLogicalEventToUI(0x1134, 1);
55 _PostLogicalEventToUI(0x8AF, 1);
56 _PostLogicalEventToUI(0x1135, 1);
57 }
58
59 void JogDial_CCW(void) {
60 _PostLogicalEventToUI(0x1134, 1);
61 _PostLogicalEventToUI(0x8B0, 1);
62 _PostLogicalEventToUI(0x1135, 1);
63 }
64
65 extern int active_raw_buffer;
66 extern char* raw_buffers[];
67 extern char* raw_buffers_canon_raw[];
68 extern char* raw_buffers_jpeg[];
69
70 char *hook_raw_image_addr()
71 {
72
73 int i=active_raw_buffer&3;
74 if(i>2) i=0;
75 return raw_buffers[i];
76 }
77
78 void *vid_get_viewport_fb_d() {
79 extern void *current_fb_d;
80 return current_fb_d;
81 }
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 void *vid_get_viewport_live_fb()
93 {
94
95 int i;
96 for(i=0;i<4;i++) {
97 if(current_viewport_buffer == viewport_buffers[i]) {
98 return viewport_buffers[(i+1)&3];
99 }
100 }
101 return 0;
102 }
103
104 int vid_get_viewport_width() {
105 extern int _GetVRAMHPixelsSize();
106 if (camera_info.state.mode_play)
107 {
108 return 720;
109 }
110
111
112 return _GetVRAMHPixelsSize();
113 }
114
115 long vid_get_viewport_height() {
116 extern int _GetVRAMVPixelsSize();
117 if (camera_info.state.mode_play)
118 {
119 return 480;
120 }
121 return _GetVRAMVPixelsSize();
122 }
123
124 int vid_get_viewport_yoffset() {
125
126 return 0;
127 }
128
129
130 static long vp_xo[5] = { 40, 0, 0, 120, 168 };
131
132 int vid_get_viewport_display_xoffset() {
133 if (camera_info.state.mode_play)
134 {
135 return 0;
136 }
137
138 if(camera_info.state.mode_video || is_video_recording()) {
139 if(shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 2) {
140 return 40;
141 } else {
142 return 0;
143 }
144 }
145 return vp_xo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
146 }
147
148 int vid_get_viewport_display_yoffset() {
149 if (camera_info.state.mode_play)
150 {
151 return 0;
152 }
153
154 if(camera_info.state.mode_video || is_video_recording()) {
155 if(shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 2) {
156 return 0;
157 } else {
158 return 36;
159 }
160 }
161 if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1)
162 {
163 return 36;
164 }
165 return 0;
166 }
167
168 extern int active_bitmap_buffer;
169 extern char* bitmap_buffer[];
170
171 int vid_get_viewport_type() {
172
173 return LV_FB_YUV8B;
174
175 }
176
177
178 void *vid_get_bitmap_fb() {
179
180 return bitmap_buffer[0];
181 }
182
183
184 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset() ; }
185 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset() ; }
186 int vid_get_viewport_buffer_width_proper() { return camera_screen.buffer_width ; }
187 int vid_get_viewport_fullscreen_width() { return camera_screen.width; }
188 int vid_get_viewport_byte_width() { return (camera_screen.buffer_width * 2); }
189
190 int vid_get_viewport_fullscreen_height() { return 480; }
191 int vid_get_aspect_ratio() { return LV_ASPECT_3_2; }
192
193
194
195
196 volatile char *opacity_buffer[2] = {(char*)0x5FD87300, (void*)0x5FD08A00};
197
198 void *vid_get_bitmap_active_buffer() {
199 return bitmap_buffer[active_bitmap_buffer&1];
200 }
201
202 void *vid_get_opacity_active_buffer() {
203 return (void *)opacity_buffer[active_bitmap_buffer&1];
204 }
205
206
207 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
208
209
210
211
212 void update_screen_dimensions() {
213
214 extern int displaytype;
215 static int old_displaytype = -1;
216
217 if (old_displaytype == displaytype) {
218 return;
219 }
220 old_displaytype = displaytype;
221
222 switch(displaytype) {
223 case 0:
224 case 3:
225 case 4:
226 case 5:
227
228 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 640;
229 camera_screen.height = camera_screen.buffer_height = 480;
230 camera_screen.size = camera_screen.buffer_size = 640*480;
231 break;
232 case 1:
233 case 2:
234 case 8:
235 case 9:
236
237 camera_screen.physical_width = camera_screen.width = 720;
238 camera_screen.buffer_width = 736;
239 camera_screen.height = camera_screen.buffer_height = 480;
240 camera_screen.size = 720*480;
241 camera_screen.buffer_size = 736*480;
242 break;
243 case 6:
244 case 7:
245
246 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 960;
247 camera_screen.height = camera_screen.buffer_height = 540;
248 camera_screen.size = camera_screen.buffer_size = 960*540;
249 break;
250 case 10:
251
252 camera_screen.physical_width = camera_screen.width = 720;
253 camera_screen.buffer_width = 736;
254 camera_screen.height = camera_screen.buffer_height = 480;
255 camera_screen.size = 720*480;
256 camera_screen.buffer_size = 736*480;
257 break;
258 case 11:
259
260 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 1024;
261 camera_screen.height = camera_screen.buffer_height = 768;
262 camera_screen.size = camera_screen.buffer_size = 1024*768;
263 break;
264 case 12:
265
266 camera_screen.physical_width = camera_screen.width = 900;
267 camera_screen.buffer_width = 928;
268 camera_screen.height = camera_screen.buffer_height = 600;
269 camera_screen.size = 900*600;
270 camera_screen.buffer_size = 928*600;
271 break;
272 }
273 }
274 #endif
275
276 char *camera_jpeg_count_str()
277 {
278 extern char jpeg_count_str[];
279 return jpeg_count_str;
280 }