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