CHDK_DE Vorschauversion  Trunk Rev. 5327
 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_JPEG_CHUNK_STATUS_MORE   1
 
#define REMOTECAP_JPEG_CHUNK_STATUS_LAST   2
 
#define REMOTECAP_JPEG_CHUNK_STATUS_SESS_LAST   3
 

Funktionen

void remotecap_is_ready (int *available_type, int *image_num)
 
void remotecap_raw_available (char *rawadr)
 
void remotecap_jpeg_available (void)
 
void remotecap_type_complete (int type)
 
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_jpeg_chunks_done (void)
 

Makro-Dokumentation

#define REMOTECAP_CHUNK_STATUS_ERROR   0

Definiert in Zeile 22 der Datei remotecap_core.h.

#define REMOTECAP_CHUNK_STATUS_LAST   2

Definiert in Zeile 24 der Datei remotecap_core.h.

#define REMOTECAP_CHUNK_STATUS_MORE   1

Definiert in Zeile 23 der Datei remotecap_core.h.

#define REMOTECAP_JPEG_CHUNK_STATUS_LAST   2

Definiert in Zeile 28 der Datei remotecap_core.h.

#define REMOTECAP_JPEG_CHUNK_STATUS_MORE   1

Definiert in Zeile 27 der Datei remotecap_core.h.

#define REMOTECAP_JPEG_CHUNK_STATUS_SESS_LAST   3

Definiert in Zeile 29 der Datei remotecap_core.h.

Dokumentation der Funktionen

int remotecap_get_data_chunk ( int  fmt,
char **  addr,
unsigned int *  size,
int *  pos 
)

Definiert in Zeile 250 der Datei remotecap.c.

251 {
252  int status = REMOTECAP_CHUNK_STATUS_LAST; // default = no more chunks
253  *pos = -1; // default = sequential
254 
255  switch (fmt & remotecap_get_target() & available_image_data)
256  {
257  case PTP_CHDK_CAPTURE_RAW: //raw
258  *addr=(char*)raw_chunk.address;
259  *size=raw_chunk.length;
260  break;
262  case PTP_CHDK_CAPTURE_JPG: //jpeg
263  jpeg_last_status = filewrite_get_jpeg_chunk(addr,size,jpeg_curr_chunk,pos);
264  jpeg_curr_chunk+=1;
265  if(jpeg_last_status != REMOTECAP_JPEG_CHUNK_STATUS_LAST) {
267  }
268  break;
269 #endif
270  case PTP_CHDK_CAPTURE_DNGHDR: // dng header
271  *addr=(char*)dng_hdr_chunk.address;
272  *size=dng_hdr_chunk.length;
273  break;
274  default:
275  /*
276  * attempting to get an unsupported, unavailable or not requested format
277  * will free all hooks, deactiveate remotecap, and return error status
278  */
279  *addr=NULL;
280  *size=0;
281  }
282  if(*addr == NULL) {
283  remotecap_reset();
285  }
286 
287  return status;
288 }
void remotecap_is_ready ( int *  available_type,
int *  image_num 
)

Definiert in Zeile 62 der Datei remotecap.c.

62  {
63  if ( remotecap_get_target() ) {
64  *available_type = available_image_data;
66  *file_num = target_file_num;
67  } else {
68  *file_num = 0;
69  }
70  }
71  else {
72  *available_type = PTP_CHDK_CAPTURE_NOTSET;
73  *file_num = 0;
74  }
75 }
void remotecap_jpeg_available ( void  )
void remotecap_jpeg_chunks_done ( void  )
void remotecap_raw_available ( char *  rawadr)

Definiert in Zeile 160 der Datei remotecap.c.

160  {
161  // get file number as early as possible, before blocking
162  // but don't set until after so it doesn't change value for remotecap_is_ready
163  int next_file_num = get_target_file_num();
164 /*
165 ensure raw hook is blocked until any prevous remotecap shot is finished or times out
166 if prevous times out, remotecap settings will be cleared due to the time out, so no
167 remotecap will be done, althouth writes will still be skipped
168 wait == 0 timeout shouldn't get hit here unless the script is fiddling with the
169 timeout value, but it ensures that we don't block indefinitely.
170 */
171  int wait = hook_wait_max;
172  while (wait && pending_image_data) {
173  msleep(10);
174  wait--;
175  }
176  if(wait == 0) {
177  remotecap_reset();
178  }
180  target_file_num = next_file_num;
181 // TODO technically this could probably wait until after the raw stuff is done,
182 // provided the actual chunks are transmitted
183 // TODO this should probably just be noop if hook doesn't exist
184 #ifdef CAM_HAS_FILEWRITETASK_HOOK
186  jpeg_curr_chunk=0; //needs to be done here
187 #endif //CAM_HAS_FILEWRITETASK_HOOK
189  started();
191 
192  if(!remotecap_wait(PTP_CHDK_CAPTURE_DNGHDR)) {
193  remotecap_reset();
194  }
196  remotecap_type_complete(PTP_CHDK_CAPTURE_DNGHDR);
197  finished();
198  }
199 
201  return;
202  }
203 
204  started();
205 
208 
209  if(!remotecap_wait(PTP_CHDK_CAPTURE_RAW)) {
210  remotecap_reset();
211  }
212  remotecap_type_complete(PTP_CHDK_CAPTURE_RAW);
213 
214  finished();
215 }
int remotecap_send_complete ( int  rcgd_status,
int  type 
)

Definiert in Zeile 290 der Datei remotecap.c.

290  {
291  // timeout or canceled: the data type we were sending is no longer available
292  int timeout_flag = (available_image_data != type);
293  if(rcgd_status == REMOTECAP_CHUNK_STATUS_LAST) {
294  // currently only one data type can be available at a time
296  }
297 #ifdef CAM_FILEWRITETASK_MULTIPASS
298  else if(type == PTP_CHDK_CAPTURE_JPG && jpeg_last_status == REMOTECAP_JPEG_CHUNK_STATUS_SESS_LAST) {
299  remotecap_jpeg_chunks_done(); // make jpeg_chunks NULL, immediately
300  jpeg_session_wait = 0;
301  }
302 #endif
303  if((rcgd_status == REMOTECAP_CHUNK_STATUS_ERROR) || timeout_flag) {
304  return 0;
305  }
306  // else more chunks of current type, no action needed
307  return 1;
308 }
void remotecap_type_complete ( int  type)

Definiert in Zeile 153 der Datei remotecap.c.

153  {
155 }