[Elphel-support] elphel php api / documentation update?

Michael Aschauer m at ash.to
Wed Nov 3 08:49:22 PDT 2010


I just noticed why my camera behaved so unpredictable and unstable 
recently. It's likely it has nothing to do with heat or hardware 
problems but a simple (and very stupid) error in the php script I used 
to change parameters that (could) result in wait_frame calls that never 
finished.

That's most likely my own fault, but there are two problems I see here:

* a simple error or example script like below waiting endlessly for a 
frame that does not arrive soon, renders all webinterfaces or 
php-scripts via http unusable (until you reboot or kill php)
<? elphel_wait_frame_abs(123909090); ?>

* the elphel php documentation 
(http://wiki.elphel.com/index.php?title=PHP_in_Elphel_cameras) is not 
exactly up to date.
at least I found the changes mentioned below...

best,
m,-


####################################

from the wiki:

<snip>
elphel_set_P_arr

long elphel_set_P_arr (array $input)

Write multiple camera parameters, provided as an associative array, 
where keys are parameter names same as defined Elphel_PHP_constants, but 
without "ELPHEL_" prefix. Values should be numeric and integer, all 
other types are ignored.

Return value - number of successfully processed elements.
</snip>


whereas according to the source it should be:


<snip>
long elphel_set_P_arr (array $input, long $frame, long $flag)

...

optional arguments:
   frame - frame number to write these parameters to - if not specified 
default framedelay (current frame + 3) is applied)
   flag - possible flags?

Return value - frame number to which parameters were written
</snip>


and here's the matching call from parsedit.php:

<snip>
elphel_set_P_arr ($pgmpars, 
$frame_zero+$since,ELPHEL_CONST_FRAMEPAIR_FORCE_NEWPROC); /// Are these 
flags needed?
</snip>


####################################

Also there are at least two undocumented functions:

elphel_wait_frame_abs(long frame)

wait for absolute frame number (includes those that are not compressed)

elphel_skip_frames(long frames)

skip some frames (includes those that are not compressed) - will work 
even if no frames are compressed




More information about the Support-list mailing list