CHDK_DE Vorschauversion  Trunk Rev. 5579
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
remotecap_core.h-Dateireferenz
#include "remotecap.h"
+ Include-Abhängigkeitsdiagramm für remotecap_core.h:
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define REMOTECAP_CHUNK_STATUS_ERROR   0
 
#define REMOTECAP_CHUNK_STATUS_MORE   1
 
#define REMOTECAP_CHUNK_STATUS_LAST   2
 
#define REMOTECAP_FWT_CHUNK_STATUS_MORE   1
 
#define REMOTECAP_FWT_CHUNK_STATUS_LAST   2
 
#define REMOTECAP_FWT_CHUNK_STATUS_SESS_LAST   3
 

Funktionen

void remotecap_is_ready (int *available_type, int *image_num)
 
void remotecap_raw_available (char *rawadr)
 
void remotecap_fwt_jpeg_available (void)
 
void remotecap_fwt_craw_available (void)
 
int remotecap_get_data_chunk (int fmt, char **addr, unsigned int *size, int *pos)
 
int remotecap_send_complete (int rcgd_status, int type)
 
void remotecap_fwt_chunks_done (void)
 
void remotecap_fwt_file_complete (void)
 

Makro-Dokumentation

#define REMOTECAP_CHUNK_STATUS_ERROR   0

Definiert in Zeile 24 der Datei remotecap_core.h.

#define REMOTECAP_CHUNK_STATUS_LAST   2

Definiert in Zeile 26 der Datei remotecap_core.h.

#define REMOTECAP_CHUNK_STATUS_MORE   1

Definiert in Zeile 25 der Datei remotecap_core.h.

#define REMOTECAP_FWT_CHUNK_STATUS_LAST   2

Definiert in Zeile 30 der Datei remotecap_core.h.

#define REMOTECAP_FWT_CHUNK_STATUS_MORE   1

Definiert in Zeile 29 der Datei remotecap_core.h.

#define REMOTECAP_FWT_CHUNK_STATUS_SESS_LAST   3

Definiert in Zeile 31 der Datei remotecap_core.h.

Dokumentation der Funktionen

void remotecap_fwt_chunks_done ( void  )
void remotecap_fwt_craw_available ( void  )
void remotecap_fwt_file_complete ( void  )
void remotecap_fwt_jpeg_available ( void  )
int remotecap_get_data_chunk ( int  fmt,
char **  addr,
unsigned int *  size,
int *  pos 
)

Definiert in Zeile 293 der Datei remotecap.c.

294 {
295  int status = REMOTECAP_CHUNK_STATUS_LAST; // default = no more chunks
296  *pos = -1; // default = sequential
297 
298  switch (fmt & remotecap_get_target() & available_image_data)
299  {
300  case PTP_CHDK_CAPTURE_RAW: //raw
301  *addr=(char*)raw_chunk.address;
302  *size=raw_chunk.length;
303  break;
305  case PTP_CHDK_CAPTURE_CRAW: //canon raw
306  case PTP_CHDK_CAPTURE_JPG: //jpeg
307  fwt_last_status = filewrite_get_file_chunk(addr,size,fwt_curr_chunk,pos);
308  fwt_curr_chunk+=1;
309  if(fwt_last_status != REMOTECAP_FWT_CHUNK_STATUS_LAST) {
311  }
312 #ifdef CAM_HAS_CANON_RAW
313  else {
314  fwt_curr_chunk=0;
315  }
316 #endif
317  break;
318 #endif
319  case PTP_CHDK_CAPTURE_DNGHDR: // dng header
320  *addr=(char*)dng_hdr_chunk.address;
321  *size=dng_hdr_chunk.length;
322  break;
323  default:
324  /*
325  * attempting to get an unsupported, unavailable or not requested format
326  * will free all hooks, deactiveate remotecap, and return error status
327  */
328  *addr=NULL;
329  *size=0;
330  }
331  if(*addr == NULL) {
332  remotecap_reset();
334  }
335 
336  return status;
337 }
void remotecap_is_ready ( int *  available_type,
int *  image_num 
)

Definiert in Zeile 67 der Datei remotecap.c.

67  {
68  if ( remotecap_get_target() ) {
69  *available_type = available_image_data;
71  *file_num = target_file_num;
72  } else {
73  *file_num = 0;
74  }
75  }
76  else {
77  *available_type = PTP_CHDK_CAPTURE_NOTSET;
78  *file_num = 0;
79  }
80 }
void remotecap_raw_available ( char *  rawadr)

Definiert in Zeile 169 der Datei remotecap.c.

169  {
170  // get file number as early as possible, before blocking
171  // but don't set until after so it doesn't change value for remotecap_is_ready
172  int next_file_num = get_target_file_num();
173 /*
174 ensure raw hook is blocked until any prevous remotecap shot is finished or times out
175 if prevous times out, remotecap settings will be cleared due to the time out, so no
176 remotecap will be done, although writes will still be skipped
177 wait == 0 timeout shouldn't get hit here unless the script is fiddling with the
178 timeout value, but it ensures that we don't block indefinitely.
179 */
180  int wait = hook_wait_max;
181  while (wait && pending_image_data) {
182  msleep(10);
183  wait--;
184  }
185  if(wait == 0) {
186  remotecap_reset();
187  }
189  target_file_num = next_file_num;
190 // TODO technically this could probably wait until after the raw stuff is done,
191 // provided the actual chunks are transmitted
192 // TODO this should probably just be noop if hook doesn't exist
193 #ifdef CAM_HAS_FILEWRITETASK_HOOK
195  fwt_curr_chunk=0; //needs to be done here
196 #ifdef CAM_HAS_CANON_RAW
198  fwt_expect_file_count = 2;
199  } else {
200  fwt_expect_file_count = 1;
201  }
202 #else
203  fwt_expect_file_count = 1;
204 #endif
205 #endif //CAM_HAS_FILEWRITETASK_HOOK
207  started();
209 
210  if(!remotecap_wait(PTP_CHDK_CAPTURE_DNGHDR)) {
211  remotecap_reset();
212  }
214  remotecap_type_complete(PTP_CHDK_CAPTURE_DNGHDR);
215  finished();
216  }
217 
219  return;
220  }
221 
222  started();
223 
226 
227  if(!remotecap_wait(PTP_CHDK_CAPTURE_RAW)) {
228  remotecap_reset();
229  }
230  remotecap_type_complete(PTP_CHDK_CAPTURE_RAW);
231 
232  finished();
233 }
int remotecap_send_complete ( int  rcgd_status,
int  type 
)

Definiert in Zeile 339 der Datei remotecap.c.

339  {
340  // timeout or canceled: the data type we were sending is no longer available
341  int timeout_flag = (available_image_data != type);
342  if(rcgd_status == REMOTECAP_CHUNK_STATUS_LAST) {
343  // currently only one data type can be available at a time
345  }
346 #ifdef CAM_FILEWRITETASK_MULTIPASS
347  else if(type == PTP_CHDK_CAPTURE_JPG && fwt_last_status == REMOTECAP_FWT_CHUNK_STATUS_SESS_LAST) {
348  remotecap_fwt_chunks_done(); // make file_chunks NULL, immediately
349  fwt_session_wait = 0;
350  }
351 #endif
352  if((rcgd_status == REMOTECAP_CHUNK_STATUS_ERROR) || timeout_flag) {
353  return 0;
354  }
355  // else more chunks of current type, no action needed
356  return 1;
357 }