Test digital zoom with ipu for camera preview.
Board :sarbre-sd (imx6dq)BSP : android 13.4ga
In the above flow, one frame buffer is processed in four steps at camera preview.
Add the step to change the frame buffer before step 4 , the added step which zoom one preview frame.
The figure below shows the crop function of ipu lib, we use this function scale the frame.
preview zoom levle 0:
preview zoom level max:
When taking pictures with 5M pixels and the zoom is over level 1, the picture size is not 2592x1944 but 2016x1512.
The underlying reason for it is that ipu crop function only supports the 2048x2048 maximum output .
Thumbnails of test result :
I am doing the work of digital zoom on the imx6q board using ov5640 , can you give me some help?
The IPU driver should changed?How to modify to implent the digital zoom function?
I have attached patch, it's for older version android. You could see it to learn the way of zooming.
thank you very much!
you mean i should deal the zoom function before the frame data
transfer to the display framebuffer?
hi weiping liu：
We now use the imx6q-sabresd board（android4.4.2, the kernel version 3.0.35）。
have you implemented digital zoom on this?
Hello Weiping Liu,
I am also implementing the same on the Sabresd board on the android lollipop , I am able to port changes as suggested , but have a issue with the 5MP i.e 2592*1944 frame , As you suggested I changed the frame size of the the output at the IPU cropping level , but when the same comes to the JPEG , the Image is not storing properly, it is saved as a green color frame(picture). I Think that the code is failing at the encoding section , ya here too I implemented the changes, with that too it fails. Wondering waht more changes may be required to implement the digital zoom correctly, can you help me on this ? . With other resolutions the zoom works fine.
All the changes I have mde is at the HAL level.
The camera That I am using is ov5640_mipi.
Karan, Is the frame of 5Mp normal in preview after IPU cropping? If the copped frame is ok when in preview , i think the issue may be caused by error format or length input for encoding function.
Yes the length was in correct. I have resolved it . But I have another question, does the same implementation work with respect to video ? for me the buffers are missing and recording is like 1 frame without zoom and another frame with zoom , its not proper.
Can you please suggest ?
Hello karan bhagoji：
Do you have realization
Do you have realization digital zoom on android5.0? Would you like to share your changes on source code。
Did you make changes only in the Hal layer？I refer to code_only_preview.zip to modify，but it does‘t work。