Replies: 5 comments 3 replies
-
Here is the rogugh (unfinished) version if you are interested in taking a peek: |
Beta Was this translation helpful? Give feedback.
-
Hi, I think this sounds interesting. A few questions, and perhaps things I haven't understood...
Thanks! |
Beta Was this translation helpful? Give feedback.
-
A few of other things:
Thanks again! |
Beta Was this translation helpful? Give feedback.
-
I should note that we are explicitly interested in this so we can get a few things from picamera2 that would really help us:
This is a common use-case for sky/science observing: #343 |
Beta Was this translation helpful? Give feedback.
-
Hi, we've been doing quite a lot of work in this area. It's obviously dependent on what happens down in libcamera but we've made some proposals and implemented a prototype for the Raspberry Pi platform. Of course, the final implementation may be along the lines that we have proposed, or it could be something completely different, we can't make any assumptions yet! We also have a version of Picamera2 that uses our prototype demo version of libcamera. It allows you to do things like send a set of controls and wait for them to take effect, something like this:
and also to pass in a list of "control lists" and wait for each to be applied in turn, a bit like this:
So I guess the message for the moment is to watch this space! |
Beta Was this translation helpful? Give feedback.
-
This weekend I undertook an experimental refactor of the
picamera2
API, and I wanted to field a suggestion. Right now there are a group of methods, specifically:switch_mode()
capture_file()
switch_mode_and_capture_file()
capture_request()
switch_mode_capture_request_and_stop()
capture_buffer()
switch_mode_and_capture_buffer()
capture_metadata()
capture_array()
switch_mode_and_capture_array()
capture_image()
switch_mode_and_capture_image()
That have a set of shared behaviors that can be pretty easily factored out:
wait
flag. Ifwait=True
, it returns the requested resources, ifwait=False
it returns aNone
signal_function
that gets called on completion of the request (as far as I can tell, this is only used internally).It is very simple to refactor all of these methods to the following structure:
concurrent.futures.Future
wait=True
behavior callfuture.result()
on the returned future, which blocks until completion and returns the result in question.signal_function
associated features, would callfuture.add_done_callback(func)
There are a few other benefits to this as well:
wait=True
no longer have a way to hang. Presently, this can happen if something inprocess_requests()
errors out.Future
objects give some elegant way to bubble up exceptions/cancellations.Future
objects can be polled, grouped, or canceled on a mode change/shutdown for exampleAnother option is that all of these calls could return the current structures, unless
wait=False
in which case it returns the future instead. Open to suggestions, the refactor is honestly pretty easyBeta Was this translation helpful? Give feedback.
All reactions