Re: Changing frame size on the fly in SOC module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Adam

On Thu, 28 Oct 2010, Adam Sutton wrote:

> Hi,
> 
> Sometime ago I developed an SOC based camera driver for my platform
> (ov7675 on iMX25), for the most part it seems to be working well however
> at the time I couldn't manage to change the frame size on the fly
> (without closing / re-opening the device).
> 
> The current problem I have is that my application needs to display a
> 320x240 preview image on screen, but to capture a static image at
> 640x480. I can do this as long as I close the device in between,
> unfortunately for power consumption reasons the camera device is put
> into a low power state whenever the device is released. This means that
> the image capture takes approx 1.5s (the requirement I have to meet is
> 1s).
> 
> Now I could cheat and simply subsample (in software) the 640x480 image,
> but that puts additional burden on an already overworked MCU.
> 
> Having been through the soc_camera and videobuf code and as far as I can
> tell this inability to change the frame size without closing the camera
> device appears to be a design decision.

Yes, it is.

> What I'm really after is confirmation one way of the other. If it's not,
> what is the correct process to achieve the frame change without closing
> the device. And if it is, does anybody have any suggestions of possible
> workarounds?

It has been decided that way, because we didn't have a good use-case for 
changing the frame format on-the-fly to develop for and to test with. You 
seem to have one now, so, go ahead;)

There are a couple of issues to address though - videobuffer configuration 
is one of them, host reconfiguration is the other one, possible multiple 
simultaneous users is the third one (ok, only one of them will be actually 
streaming).

This use case - different size preview and single shot capture has come up 
a couple of times before, but noone has brought it to a proper mainstream 
solution.

One thing you'd still want to do, I think, is to stop streaming before 
reconfiguring, and restart it afterwards.

So, maybe a viable solution would be:

in soc_camera_s_fmt_vid_cap() check not just for "icf->vb_vidq.bufs[0] != 
NULL", but rather for if streaming is not running, and then someone will 
certainly have to check for large enough buffers. So, you'd have to 
request max size buffers from the beginning even for preview.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux