CHDK_DE Vorschauversion  Trunk Rev. 5214
 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 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 ()
 
char * hook_alt_raw_image_addr ()
 
void * vid_get_viewport_fb_d ()
 
void * vid_get_viewport_fb ()
 
void * vid_get_viewport_live_fb ()
 
int vid_get_viewport_width ()
 
long vid_get_viewport_height ()
 
int vid_get_viewport_yscale ()
 
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_width_proper ()
 
int vid_get_viewport_height_proper ()
 
int vid_get_viewport_fullscreen_height ()
 
int vid_get_viewport_buffer_width_proper ()
 
int vid_get_viewport_byte_width ()
 
int vid_get_viewport_type ()
 
void * vid_get_bitmap_active_buffer ()
 
void * vid_get_opacity_active_buffer ()
 

Variablen

int active_raw_buffer
 
char * raw_buffers []
 
void * viewport_buffers []
 
void * current_viewport_buffer
 
int active_bitmap_buffer
 
char * bitmap_buffer []
 
volatile char * opacity_buffer [2] = {(char*)0x41718600, (char*)0x41796f00}
 

Makro-Dokumentation

#define LED_PR   0xd20b0994

Definiert in Zeile 29 der Datei lib.c.

Dokumentation der Funktionen

void camera_set_led ( int  led,
int  state,
int  bright 
)

Definiert in Zeile 38 der Datei lib.c.

38  {
39  static char led_table[2]={0,4};
40  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
41 }
void debug_led ( int  state)

Definiert in Zeile 31 der Datei lib.c.

31  {
32  volatile long *p = (void*)LED_PR;
33  *p = ((state) ? 0x4d0002 : 0x4c0003);
34 }
int get_flash_params_count ( void  )

Definiert in Zeile 47 der Datei lib.c.

47  {
48  return 0x91;
49 }
char* hook_alt_raw_image_addr ( )

Definiert in Zeile 67 der Datei lib.c.

68 {
69  return raw_buffers[((active_raw_buffer&1)^1)];
70 }
char* hook_raw_image_addr ( void  )

Definiert in Zeile 62 der Datei lib.c.

63 {
64  return raw_buffers[(active_raw_buffer&1)];
65 }
void JogDial_CCW ( void  )

Definiert in Zeile 55 der Datei lib.c.

55  {
56  _PostLogicalEventToUI(0x873, 1); //RotateJogDialLeft
57 }
void JogDial_CW ( void  )

Definiert in Zeile 51 der Datei lib.c.

51  {
52  _PostLogicalEventToUI(0x872, 1); //RotateJogDialRight
53 }
void shutdown ( )

Definiert in Zeile 11 der Datei lib.c.

11  {
12 //***TODO***
13 /*
14  volatile long *p = (void*)0xC022001C;
15 
16  asm(
17  "MRS R1, CPSR\n"
18  "AND R0, R1, #0x80\n"
19  "ORR R1, R1, #0x80\n"
20  "MSR CPSR_cf, R1\n"
21  :::"r1","r0"
22  );
23 
24  *p = 0x44; // power off.
25 */
26  while(1);
27 }
void shutdown_soft ( )

Definiert in Zeile 43 der Datei lib.c.

43  {
45 }
void vid_bitmap_refresh ( )

Definiert in Zeile 5 der Datei lib.c.

5  {
6  extern void _transfer_src_overlay(int);
7  _transfer_src_overlay(0);
8  _transfer_src_overlay(1);
9 }
void* vid_get_bitmap_active_buffer ( )

Definiert in Zeile 190 der Datei lib.c.

190  {
192 }
void* vid_get_bitmap_fb ( )

OSD screen

Definiert in Zeile 167 der Datei lib.c.

167  {
168  // Return first bitmap buffer address
169  return bitmap_buffer[0];
170 }
void* vid_get_opacity_active_buffer ( )

Definiert in Zeile 197 der Datei lib.c.

197  {
198  return (void *)opacity_buffer[active_bitmap_buffer&1];
199 }
int vid_get_viewport_buffer_width_proper ( )

Definiert in Zeile 178 der Datei lib.c.

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

Definiert in Zeile 179 der Datei lib.c.

179 { return camera_screen.buffer_width * 2; } // may not be always ok
int vid_get_viewport_display_xoffset ( )

Definiert in Zeile 156 der Datei lib.c.

156  {
157  return 0;
158 }
int vid_get_viewport_display_xoffset_proper ( )

Definiert in Zeile 173 der Datei lib.c.

int vid_get_viewport_display_yoffset ( )

Definiert in Zeile 160 der Datei lib.c.

160  {
161  return 0;
162 }
int vid_get_viewport_display_yoffset_proper ( )

Definiert in Zeile 174 der Datei lib.c.

void* vid_get_viewport_fb ( )

IMG viewport in 'rec' mode

Definiert in Zeile 87 der Datei lib.c.

87  {
88  // Return first viewport buffer - for case when vid_get_viewport_live_fb not defined
89  return viewport_buffers[0]; // 1st of 4 uyvy_d6 buffers
90  //return (void*)0x4b25fc00; // uyvy buffers (more than 4), pixel format compatible with earlier DIGIC uyvy
91 }
void* vid_get_viewport_fb_d ( )

IMG viewport in 'play' mode

Definiert in Zeile 79 der Datei lib.c.

79  {
80  extern void *current_fb_d;
81  return current_fb_d; // method from the sx60 and g7x ports
82 }
int vid_get_viewport_fullscreen_height ( )

Definiert in Zeile 177 der Datei lib.c.

177 { return camera_screen.height; } // may not be always ok
long vid_get_viewport_height ( )

Definiert in Zeile 132 der Datei lib.c.

132  {
133 /*
134 loc_fc134988: ; 3 refs (GetVRAMVPixelsSize)
135 fc134988: 487b ldr r0, [pc, #492] ; 0xfc134b78: (0002ca18)
136 fc13498a: f8d0 00b0 ldr.w r0, [r0, #176] ; 0xb0
137 fc13498e: 4770 bx lr
138 */
139  extern int _GetVRAMVPixelsSize();
140 // return half height
143  return _GetVRAMVPixelsSize();
144 }
int vid_get_viewport_height_proper ( )

2

Definiert in Zeile 176 der Datei lib.c.

176 { return vid_get_viewport_height() ; }
void* vid_get_viewport_live_fb ( )

Definiert in Zeile 93 der Datei lib.c.

93  {
94  /*
95  1) 4 live buffers starting @ 0x43115100, change dimensions when changing output device, uyvy_d6
96  size of 1 buffer is 0xae800 bytes (not enough for HDMI 960x540, but there's no live view through HDMI anyway)
97  address list @ 0xfc4d3568 (102b)
98  2) 8 live buffers starting @ 0x4B25FC00, fixed 640x480, old uyvy
99  size of 1 buffer is 0x96000 bytes (640*480*2)
100  address list @ 0xfc4d3578, listed in reverse order (102b)
101  3) 3 live buffers (probably only active when half shooting) starting @ 0x4B70FC00, 1280x960, old uyvy
102  size of 1 buffer is 0x26ac00 bytes (1280x990)
103  address list @ 0xfc4d35d8, listed in reverse order (102b)
104  */
105 
106  // implementation is from the g7x port, including the comment
107 
108  // current_viewport_buffer doesn't seem to be most recent
109  int i;
110  for(i=0;i<4;i++) {
111  if(current_viewport_buffer == viewport_buffers[i]) {
112  return viewport_buffers[(i+1)&3];
113  }
114  }
115  return 0;
116 }
int vid_get_viewport_type ( )

Definiert in Zeile 181 der Datei lib.c.

181  {
182  /*
183  // no longer needed, other viewports are used instead
184  if (camera_info.state.mode_play)
185  return LV_FB_YUV8B;
186  */
187  return LV_FB_YUV8B;
188 }
int vid_get_viewport_width ( )

Definiert in Zeile 118 der Datei lib.c.

118  {
119 /*
120 loc_fc134980: ; 4 refs (GetVRAMHPixelsSize)
121 fc134980: 487d ldr r0, [pc, #500] ; 0xfc134b78: (0002ca18)
122 fc134982: f8d0 00ac ldr.w r0, [r0, #172] ; 0xac
123 fc134986: 4770 bx lr
124 */
125  extern int _GetVRAMHPixelsSize();
126 // TODO: this is the actual width, pixel format is uyvy (16bpp)
129  return _GetVRAMHPixelsSize();
130 }
int vid_get_viewport_width_proper ( )

Definiert in Zeile 175 der Datei lib.c.

175 { return vid_get_viewport_width(); }
int vid_get_viewport_yoffset ( )

Definiert in Zeile 151 der Datei lib.c.

151  {
152  // this seems to be always 0, buffer always begins with actual display data (widescreen or not)
153  return 0;
154 }
int vid_get_viewport_yscale ( )

Definiert in Zeile 147 der Datei lib.c.

147  {
148  return 1;
149 }

Variablen-Dokumentation

int active_bitmap_buffer
int active_raw_buffer
char* bitmap_buffer[]

Definiert in Zeile 84 der Datei lib.c.

void* current_viewport_buffer
volatile char* opacity_buffer[2] = {(char*)0x41718600, (char*)0x41796f00}

Definiert in Zeile 195 der Datei lib.c.

char* raw_buffers[]
void* viewport_buffers[]