This code should work with android-11 and if we disable checking preferred preview size it's good for android-9 (where camera was introduced).<br><br>We don't share? (-: I published it as an answer at some topic about camera issue. Is there any special place for this?<br>
<br>Cheers,<br clear="all">Michał<br>
<br><br><div class="gmail_quote">2012/5/6 BogDan <span dir="ltr"><<a href="mailto:bog_dan_ro@yahoo.com" target="_blank">bog_dan_ro@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span>Hi,</span></div><div><br><span></span></div><div><span>Nice article !</span></div><div><br></div><div>At least for android-14+ I think it is possible to use another approach, I wrote another mail about about it, any comments will be highly appreciate ! :)<br>
</div><div><br><span></span></div><div><span>Cheers,</span></div><div><span>BogDan.</span></div><div><span><br></span></div><div><span>P.S. Folks if you have solutions why don't you share them with us ?</span></div><div>
<span><br></span></div><div><br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;margin-top:5px;padding-left:5px"> <div style="font-family:times new roman,new york,times,serif;font-size:12pt"> <div style="font-family:times new roman,new york,times,serif;font-size:12pt">
<div dir="ltr"> <font face="Arial"> <hr size="1"> <b><span style="font-weight:bold">From:</span></b> Michał Kowalczyk <<a href="mailto:mkk@ekk.pl" target="_blank">mkk@ekk.pl</a>><br> <b><span style="font-weight:bold">To:</span></b> BogDan <<a href="mailto:bog_dan_ro@yahoo.com" target="_blank">bog_dan_ro@yahoo.com</a>> <br>
<b><span style="font-weight:bold">Cc:</span></b> George Tavares <<a href="mailto:tavares.george@gmail.com" target="_blank">tavares.george@gmail.com</a>>; "<a href="mailto:necessitas-devel@kde.org" target="_blank">necessitas-devel@kde.org</a>" <<a href="mailto:necessitas-devel@kde.org" target="_blank">necessitas-devel@kde.org</a>> <br>
<b><span style="font-weight:bold">Sent:</span></b> Friday, May 4, 2012 8:23 PM<div><div class="h5"><br> <b><span style="font-weight:bold">Subject:</span></b> Re: Qt Multimedia status on Android<br> </div></div></font> </div>
<div><div class="h5"> <br>
<div>Couple weeks ago I published solution which is similar to yours, George:<br><a href="http://mkk.ekk.pl/?wpis=4" target="_blank">http://mkk.ekk.pl/?wpis=4</a><br>I use OpenGL only for acceleration of displaying frames (it takes lot of time, what is really strange). I provided decoding YUV into RGB, try to do some optimization and use all accessible CPU cores. Maybe it is possible to make it better. I hope it will be useful for you.<br>
<br>Cheers,<br clear="all">Michał<br>
<br><br><div>2012/5/4 BogDan <span dir="ltr"><<a rel="nofollow" href="mailto:bog_dan_ro@yahoo.com" target="_blank">bog_dan_ro@yahoo.com</a>></span><br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello George,<br>
<br>
>________________________________<br>
> From: George Tavares <<a rel="nofollow" href="mailto:tavares.george@gmail.com" target="_blank">tavares.george@gmail.com</a>><br>
>To: <a rel="nofollow" href="mailto:necessitas-devel@kde.org" target="_blank">necessitas-devel@kde.org</a><br>
>Sent: Thursday, May 3, 2012 11:13 PM<br>
>Subject: Re: Qt Multimedia status on Android<br>
<div>><br>
><br>
>Hello BogDan<br>
><br>
>I am making some work with android multimedia too, but in Camera support and I make some progress that I can share with you.<br>
><br>
<br>
</div>Maybe we should join forces ?:)<br>
<div><br>
<br>
><br>
>I started with QtCamera.java/androidcamjni.cpp available in your sdk, and tried direct render the image previews received in androidcamjni.cpp to a QDeclarativeItem. The performance was not good.<br>
><br>
>I look in QtCamera.java and saw that frames are encoded to jpeg , and later loaded to QImage, I decided elimate this step, sending the bytearrey of preview direct to CPP side and use a Method from Ketai project! (decodeYUV420SP) to decode frame. After running, it continue slow.<br>
><br>
<br>
</div>:)<br>
<div><br>
><br>
>However, I am running qt with opengl enabled, then I decided upload YUV frame like a texture and make de YUV decode in a shader. It now it is fast. I can't see differences in my camera support (800x600) and the camera from Android application.<br>
><br>
>I have only one problem implementing the shader. the YUV format appears like that:<br>
>YYYYYYYYY<br>
>UVUV<br>
><br>
>When I tried to load this like textures, I choose first load in two textures, one with Y component of type GL_LUMINANCE and other with UV component with a type GL_LUMINANCE_ALPHA . In fragment shader I tried load these components but the GL_LUMINANCE_ALPHA has some kind of bug that the components are not load correctly. Then I decided to unscramble the image in this format:<br>
>YYYYYYYYY<br>
>UUVV<br>
><br>
>Then I load the U and V texture separately.<br>
><br>
<br>
</div>Great, can you please share with us the shader sources ?<br>
<br>
As I sad I already have the texture, the problem is how to display it on a non-gl widget ...<br>
Using OpenGL for rendering everything it can be a solution but sadly on android we<br>
<br>
are limited to a single windowsurface, so the UI is (extremely) limited to a single<br>
<br>
Top Level Widget, this means you can't use controls which needs another TLW<br>
(e.g. dialog, combobox, etc.).<br>
<br>
Check <a href="http://code.google.com/p/android-lighthouse/issues/detail?id=4#c24" target="_blank">http://code.google.com/p/android-lighthouse/issues/detail?id=4#c24</a> for<br>
<br>
more informations.<br>
<br>
<br>
<br>
Thanks,<br>
<br>
<br>
Cheers,<br>
BogDan.<br>
<br>
P.S. Please join the mailing list to <a rel="nofollow" href="https://mail.kde.org/mailman/listinfo/necessitas-devel" target="_blank">https://mail.kde.org/mailman/listinfo/necessitas-devel</a> <br>
<div><div>_______________________________________________<br>
Necessitas-devel mailing list<br>
<a rel="nofollow" href="mailto:Necessitas-devel@kde.org" target="_blank">Necessitas-devel@kde.org</a><br>
<a rel="nofollow" href="https://mail.kde.org/mailman/listinfo/necessitas-devel" target="_blank">https://mail.kde.org/mailman/listinfo/necessitas-devel</a><br>
</div></div></blockquote></div><br>
</div><br><br> </div></div></div> </div> </blockquote></div> </div></div></blockquote></div><br>