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
- 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 0xa6;
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
66 extern int active_raw_buffer;
67 extern char * raw_buffers[];
68
69 char *hook_raw_image_addr()
70 {
71 return raw_buffers[(active_raw_buffer&1)];
72 }
73
74 char *hook_alt_raw_image_addr()
75 {
76 return raw_buffers[((active_raw_buffer&1)^1)];
77 }
78
79
80
81
82
83 extern void* viewport_buffers[];
84 extern void *current_viewport_buffer;
85
86 void *vid_get_viewport_fb() {
87
88 return (void*)0x43312300;
89 }
90
91
92
93
94
95 void *vid_get_viewport_fb_d() {
96
97 extern void *current_fb_d;
98 return current_fb_d;
99 }
100
101
102
103
104
105
106
107
108
109 void *vid_get_viewport_live_fb()
110 {
111
112 int i;
113 for(i=0;i<4;i++) {
114 if(current_viewport_buffer == viewport_buffers[i]) {
115 return viewport_buffers[(i+1)&3];
116 }
117 }
118 return 0;
119 }
120
121 int vid_get_viewport_width() {
122 extern int _GetVRAMHPixelsSize();
123 if (camera_info.state.mode_play)
124 {
125 return 640;
126 }
127
128
129 return _GetVRAMHPixelsSize();
130 }
131
132 long vid_get_viewport_height() {
133 extern int _GetVRAMVPixelsSize();
134 if (camera_info.state.mode_play)
135 {
136 return 480;
137 }
138
139 return _GetVRAMVPixelsSize();
140 }
141
142 int vid_get_viewport_yoffset() {
143
144 return 0;
145 }
146
147
148 static long vp_xo[4] = { 0, 0, 0, 80 };
149
150 int vid_get_viewport_display_xoffset() {
151 if (camera_info.state.mode_play)
152 {
153 return 0;
154 }
155
156 if(camera_info.state.mode_video || is_video_recording()) {
157 return 0;
158 }
159 return vp_xo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
160 }
161
162
163 static long vp_yo[4] = { 0, 60, 28, 0 };
164
165 int vid_get_viewport_display_yoffset() {
166 if (camera_info.state.mode_play)
167 {
168 return 0;
169 }
170
171 if(camera_info.state.mode_video || is_video_recording()) {
172 if(shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 2) {
173 return 0;
174 } else {
175 return 60;
176 }
177 }
178 return vp_yo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
179 }
180
181 extern char* bitmap_buffer[];
182
183 void *vid_get_bitmap_fb() {
184
185 return bitmap_buffer[0];
186 }
187
188 int vid_get_viewport_byte_width() {
189 return 640*2;
190 }
191
192
193 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset(); }
194 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset(); }
195 int vid_get_viewport_fullscreen_width() { return 640; }
196 int vid_get_viewport_fullscreen_height() { return 480; }
197 int vid_get_viewport_buffer_width_proper() { return 640; }
198 int vid_get_viewport_type() { return LV_FB_YUV8B; }
199
200 void *vid_get_bitmap_active_buffer() {
201 return bitmap_buffer[active_bitmap_buffer&1];
202 }
203
204
205
206
207 volatile char *opacity_buffer[2] = {(char*)0x4161b400, (void*)0x41699d00};
208
209
210 void *vid_get_opacity_active_buffer() {
211 return (void *)opacity_buffer[active_bitmap_buffer&1];
212 }
213
214
215
216
217 #ifdef CAM_SUPPORT_BITMAP_RES_CHANGE
218
219
220
221
222 void update_screen_dimensions() {
223
224 extern int displaytype;
225 static int old_displaytype = -1;
226
227 if (old_displaytype == displaytype) {
228 return;
229 }
230 old_displaytype = displaytype;
231
232 switch(displaytype) {
233 case 0:
234 case 3:
235 case 4:
236 case 5:
237
238 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 640;
239 camera_screen.height = camera_screen.buffer_height = 480;
240 camera_screen.size = camera_screen.buffer_size = 640*480;
241 break;
242 case 1:
243 case 2:
244 case 8:
245 case 9:
246
247 camera_screen.width = 720;
248 camera_screen.physical_width = camera_screen.buffer_width = 736;
249 camera_screen.height = camera_screen.buffer_height = 480;
250 camera_screen.size = 720*480;
251 camera_screen.buffer_size = 736*480;
252 break;
253 case 6:
254 case 7:
255
256 camera_screen.width = camera_screen.physical_width = camera_screen.buffer_width = 960;
257 camera_screen.height = camera_screen.buffer_height = 540;
258 camera_screen.size = camera_screen.buffer_size = 960*540;
259 break;
260 }
261 }
262 #endif
263
264
265 char *camera_jpeg_count_str()
266 {
267 extern char jpeg_count_str[];
268 return jpeg_count_str;
269 }