CHDK_DE Vorschauversion  Trunk Rev. 5279
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
lib.c-Dateireferenz
#include "platform.h"
#include "lolevel.h"
#include "live_view.h"
+ Include-Abhängigkeitsdiagramm für lib.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define LED_PR   0xd20b0994
 

Funktionen

void _LogCameraEvent (int id, const char *fmt,...)
 
void vid_bitmap_refresh ()
 
void shutdown ()
 
void debug_led (int state)
 
void camera_set_led (int led, int state, int bright)
 
void shutdown_soft ()
 
int get_flash_params_count (void)
 
void JogDial_CW (void)
 
void JogDial_CCW (void)
 
char * hook_raw_image_addr ()
 
void * vid_get_viewport_fb ()
 
void * vid_get_viewport_fb_d ()
 
void * vid_get_viewport_live_fb ()
 
int vid_get_viewport_width ()
 
long vid_get_viewport_height ()
 
int vid_get_viewport_yoffset ()
 
int vid_get_viewport_display_xoffset ()
 
int vid_get_viewport_display_yoffset ()
 
void * vid_get_bitmap_fb ()
 
int vid_get_viewport_display_xoffset_proper ()
 
int vid_get_viewport_display_yoffset_proper ()
 
int vid_get_viewport_byte_width ()
 
int vid_get_viewport_fullscreen_width ()
 
int vid_get_viewport_fullscreen_height ()
 
int vid_get_viewport_buffer_width_proper ()
 
int vid_get_viewport_type ()
 
void * vid_get_bitmap_active_buffer ()
 
void * vid_get_opacity_active_buffer ()
 
char * camera_jpeg_count_str ()
 

Variablen

static char * frame_buffer [2]
 
int displaytype
 
int active_bitmap_buffer
 
void * bitmap_buffer []
 
char * raw_buffers_canon_raw []
 
char * raw_buffers_jpeg []
 
int active_raw_buffer
 
char * current_raw_addr
 
void * viewport_buffers []
 
void * current_viewport_buffer
 
static long vp_xo [5] = { 0, 0, 0, 80, 128 }
 
static long vp_yo [5] = {0, 60, 28, 0, 0}
 
volatile char * opacity_buffer [2] = {(char*)0x4163b400, (void*)0x416b9d00}
 

Makro-Dokumentation

#define LED_PR   0xd20b0994

Definiert in Zeile 39 der Datei lib.c.

Dokumentation der Funktionen

void _LogCameraEvent ( int  id,
const char *  fmt,
  ... 
)
char* camera_jpeg_count_str ( )

Definiert in Zeile 279 der Datei lib.c.

280 {
281  extern char jpeg_count_str[];
282  return jpeg_count_str;
283 }
void camera_set_led ( int  led,
int  state,
int  bright 
)

Definiert in Zeile 48 der Datei lib.c.

48  {
49  static char led_table[2]={0,4};
50  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
51 }
void debug_led ( int  state)

Definiert in Zeile 41 der Datei lib.c.

41  {
42  volatile long *p = (void*)LED_PR;
43  *p = ((state) ? 0x4d0002 : 0x4c0003);
44 }
int get_flash_params_count ( void  )

Definiert in Zeile 57 der Datei lib.c.

57  {
58  return 0xde; // @0xfc0afeb8
59 }
char* hook_raw_image_addr ( void  )

Definiert in Zeile 72 der Datei lib.c.

73 {
74  if (current_raw_addr) {
75  return current_raw_addr;
76  }
77 // fall back to old code which will be wrong in many cases.....
78  // observed values 0-2, 3 would index something that doesn't look like a raw fb in the jpeg case
79  int i=active_raw_buffer&3;
80 /*
81  _LogCameraEvent(0x20,"lc: hria: %i %i %08x %i",i, camera_info.state.mode_shooting,
82  camera_info.state.mode_shooting,
83  shooting_get_prop(PROPCASE_IMAGE_FORMAT));
84 */
85  if(i>2) {
86  i=0;
87  }
89  // AUTO mode (canon raw can't be enabled in AUTO)
90  return (char *)0x435ee300; // TODO unclear if this is only buffer, or if used in all AUTO sub modes
92  // canon raw disabled - uses up to 3 raw buffers
93  return raw_buffers_jpeg[i];
94  } else {
95  // canon raw enabled - different address, not clear if it ever uses multiple buffers
96  return raw_buffers_canon_raw[i];
97  }
98  // TODO most scene modes seem to use different addresse(s)
99 }
void JogDial_CCW ( void  )

Definiert in Zeile 65 der Datei lib.c.

65  {
66  _PostLogicalEventToUI(0x8ae, 1); //RotateJogDialLeft
67 }
void JogDial_CW ( void  )

Definiert in Zeile 61 der Datei lib.c.

61  {
62  _PostLogicalEventToUI(0x8ad, 1); //RotateJogDialRight
63 }
void shutdown ( )

Definiert in Zeile 22 der Datei lib.c.

22  {
23 /*
24  volatile long *p = (void*)0xC022001C;
25 
26  asm(
27  "MRS R1, CPSR\n"
28  "AND R0, R1, #0x80\n"
29  "ORR R1, R1, #0x80\n"
30  "MSR CPSR_cf, R1\n"
31  :::"r1","r0"
32  );
33 
34  *p = 0x44; // power off.
35 */
36  while(1);
37 }
void shutdown_soft ( )

Definiert in Zeile 53 der Datei lib.c.

53  {
54  _PostLogicalEventForNotPowerType(0x1005,0); // PressOffButton
55 }
void vid_bitmap_refresh ( )

Definiert in Zeile 14 der Datei lib.c.

14  {
15 
16  extern int active_bitmap_buffer;
17  extern void _transfer_src_overlay(int);
18  _transfer_src_overlay(0);
19  _transfer_src_overlay(1);
20 }
void* vid_get_bitmap_active_buffer ( )

Definiert in Zeile 265 der Datei lib.c.

265  {
267 }
void* vid_get_bitmap_fb ( )

OSD screen

Definiert in Zeile 247 der Datei lib.c.

247  {
248 // return (void *)0x41441000; // from sub_fc0f8804, alt 4153e200
249  return bitmap_buffer[0];
250 }
void* vid_get_opacity_active_buffer ( )

Definiert in Zeile 272 der Datei lib.c.

272  {
273  return (void *)opacity_buffer[active_bitmap_buffer&1];
274 }
int vid_get_viewport_buffer_width_proper ( )

Definiert in Zeile 262 der Datei lib.c.

262 { return camera_screen.buffer_width; } // may not be always ok
int vid_get_viewport_byte_width ( )

Definiert in Zeile 256 der Datei lib.c.

256  {
257 // digic 6 uYvY 2 pixels per 4 bytes
258  return (640 * 2);
259 }
int vid_get_viewport_display_xoffset ( )

Definiert in Zeile 216 der Datei lib.c.

216  {
217 
219  return 0;
220  }
221  // video, ignore still res propcase
223  return 0; //all video modes for now
224  }
226 
227 }
int vid_get_viewport_display_xoffset_proper ( )

Definiert in Zeile 254 der Datei lib.c.

int vid_get_viewport_display_yoffset ( )

Definiert in Zeile 229 der Datei lib.c.

229  {
231  return 0;
232  }
233  else {
235  return 0; //all video modes
236  }
237  }
239 
240 }
int vid_get_viewport_display_yoffset_proper ( )

Definiert in Zeile 255 der Datei lib.c.

void* vid_get_viewport_fb ( )

IMG viewport in 'rec' mode

Definiert in Zeile 117 der Datei lib.c.

117  {
118  return (void*)0x43334300; // same as g7x "first" viewport adr, "VRAM Address : %p", contains d6 uyvy
119 // TODO sx280 values
120  // Return first viewport buffer - for case when vid_get_viewport_live_fb not defined
121  //return (void*)0x43115100; // uyvy buffers with signed(?) chroma components
122  // return (void*)0x4b25fc00; // uyvy buffers (more than 4), pixel format compatible with earlier DIGIC uyvy
123 }
void* vid_get_viewport_fb_d ( )

IMG viewport in 'play' mode

Definiert in Zeile 126 der Datei lib.c.

126  {
127  extern void *current_fb_d;
128  return current_fb_d;
129  }
int vid_get_viewport_fullscreen_height ( )

Definiert in Zeile 261 der Datei lib.c.

261 { return camera_screen.height; }
int vid_get_viewport_fullscreen_width ( )

Definiert in Zeile 260 der Datei lib.c.

260 { return camera_screen.width; }
long vid_get_viewport_height ( )

Definiert in Zeile 173 der Datei lib.c.

173  {
174 /*
175 loc_fc134988: ; 3 refs (GetVRAMVPixelsSize)
176 fc134988: 487b ldr r0, [pc, #492] ; 0xfc134b78: (0002ca18)
177 fc13498a: f8d0 00b0 ldr.w r0, [r0, #176] ; 0xb0
178 fc13498e: 4770 bx lr
179 */
180 /*
181  int m = mode_get();
182  int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);
183 
184  if (MODE_IS_VIDEO(m) || is_video_recording())
185  return 480;
186 
187  if ((m & MODE_MASK) != MODE_PLAY)
188  {
189  // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1
190  if (aspect_ratio==1 || aspect_ratio==2)
191  return 480;
192  }
193 
194  extern int _GetVRAMVPixelsSize();
195  return ((m & MODE_MASK) == MODE_PLAY)?480:_GetVRAMVPixelsSize();
196 */
197  extern int _GetVRAMVPixelsSize();
198 // return half height
201  return _GetVRAMVPixelsSize();
202 }
void* vid_get_viewport_live_fb ( )

Definiert in Zeile 144 der Datei lib.c.

145 {
146 // current_viewport_buffer doesn't seem to be most recent
147  int i;
148  for(i=0;i<4;i++) {
149  if(current_viewport_buffer == viewport_buffers[i]) {
150  return viewport_buffers[(i+1)&3];
151  }
152  }
153  return 0;
154 }
int vid_get_viewport_type ( )

Definiert in Zeile 263 der Datei lib.c.

263 { return LV_FB_YUV8B; }
int vid_get_viewport_width ( )

Definiert in Zeile 157 der Datei lib.c.

157  {
158 /*
159 loc_fc134980: ; 4 refs (GetVRAMHPixelsSize)
160 fc134980: 487d ldr r0, [pc, #500] ; 0xfc134b78: (0002ca18)
161 fc134982: f8d0 00ac ldr.w r0, [r0, #172] ; 0xac
162 fc134986: 4770 bx lr
163 */
165  {
167 // return 360; //todo
168  }
169  extern int _GetVRAMHPixelsSize();
170  return _GetVRAMHPixelsSize();
171 }
int vid_get_viewport_yoffset ( )

Definiert in Zeile 209 der Datei lib.c.

209  {
210  int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);
211 
212  return 0;
213 }

Variablen-Dokumentation

int active_bitmap_buffer
int active_raw_buffer
void* bitmap_buffer[]

Definiert in Zeile 84 der Datei lib.c.

char* current_raw_addr

Definiert in Zeile 13 der Datei capt_seq.c.

void* current_viewport_buffer
int displaytype
char* frame_buffer[2]
static

Definiert in Zeile 5 der Datei lib.c.

volatile char* opacity_buffer[2] = {(char*)0x4163b400, (void*)0x416b9d00}

Definiert in Zeile 271 der Datei lib.c.

char* raw_buffers_canon_raw[]
char* raw_buffers_jpeg[]
void* viewport_buffers[]
long vp_xo[5] = { 0, 0, 0, 80, 128 }
static

Definiert in Zeile 206 der Datei lib.c.

long vp_yo[5] = {0, 60, 28, 0, 0}
static

Definiert in Zeile 207 der Datei lib.c.