CHDK_DE Vorschauversion  Trunk Rev. 5830
 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 292 der Datei remotecap.c.

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

Definiert in Zeile 66 der Datei remotecap.c.

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

Definiert in Zeile 168 der Datei remotecap.c.

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

Definiert in Zeile 338 der Datei remotecap.c.

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