HTCCamera v.1.0
Posted on February 14th, 2010 by admin
HTC provides the simpliest DirectShow driver, that does not allow to chose resolution of frame that we want to grab… does not allow to control flash or autofocus and other available settings that default application allows…
Here is first version of HTCCamera class that works directly with driver as result we can choose resolution of grabbing frame, we can grab frames to memory without saving to storage. also it allows to control flash and autofocus!
In future it will allow to control brightness, saturation, hue, whiteballance so on…
First vesion you can download here
Filed under: Uncategorized
February 16th, 2010 at 1:35 am
Hello!
Thank you for releasing such a library!
Unfortunately, trying the example code on my HTC Kaiser (WM6.6 Pro), the Camera.Init() function returns false. Is there any way to debug it further? (I have tried with resolutions: 240×320, 320×240, 640×480, 1024×768)
hypest
February 16th, 2010 at 8:49 am
there only one way to debug it. its add traces in native part and check where exactly we got
problem, as i know some HTC devices use HTCCamera1.dll for exporting driver methods,
some other devices use HTCCamera.dll
i`m checking only HTCCamera1.dll so may be this is the problem
February 16th, 2010 at 11:28 am
hm, I suppose I need the source code to add the traces you refer to? Or there is a way to add traces without the source code?
On my device, there is htccamera1.dll in the \Windows directory and is the one that I use in Barcorama to use the autofocus triggering.
February 16th, 2010 at 12:40 pm
sure you need sources to add traces… also i can add it by my self and upload on site but not earlier than tonight
February 16th, 2010 at 12:51 pm
Hi Alex,
Thank you for releasing the library!
I’m using an HTC Touch 2. The HTCCameraDemo works but I have an issue. I get a mirrored grayscale image.
I could fix the mirrored thing with sth like this:
// right to left
byte[] amirror = new byte[buff.Length];
int stride = buff.Length / e.Heigth;
for (int i = 0; i < e.Heigth; i++)
{
for (int j = 0; j < stride; j = j + 2)
{
amirror[(i * stride) + j] = buff[((i + 1) * stride) - j - 2];
amirror[(i * stride) + j + 1] = buff[((i + 1) * stride) - j - 1];
}
}
I can’t fix the color issue. Is this a limitation of this release?
Thank you.
February 16th, 2010 at 1:07 pm
this is only first version i cannot understand some driver issues yet so i`m working on this i just decided to release this version to show progress.
anyway i already found how to fix mirrored and color issues, so i think i will upload new version today
February 16th, 2010 at 1:17 pm
Alex,
thank you for looking into the issue and offer to add debugging to the library.
Let me ask this though: What is the license of the library DLL? The source code is non-free, but what about the DLL itself? Can it be used in a free and open-source application like my Barcorama?
thank you again,
hypest
February 16th, 2010 at 1:37 pm
Hypest,
the problem that i dont think that you need dll that will show message box every time you grab frame for example! so you need at least version that do not show it, but the problem that you will distribute your application as open-source so everybody who use sources of your app will use my library for free… so i think its not an option fot you and me
February 16th, 2010 at 2:19 pm
Alex,
ok, I understand. Thank you anyway
February 21st, 2010 at 2:45 pm
Hi Alex,
I wanted to write some code to grab video from the camera of my HTC HD2 Windows Mobile phone. Before starting the journey i myself i thought i would test your demos/example. Unfortunatly none of them seem to work on my phone. I suspect it has to do with my phone running on a WM6.5 ROM. This as I’ve read a comment from somebody else which was able to get it to succesfully run on his HD2.
When clicking “start” on “HTCCamera v1.0″ it displays the error: “Cannot init camera”. If you want me to run some debug-code to investigate the issue, get into contact via mail.
Just wanted to inform you of this. Keep up the good work.
greetz, Sander
February 22nd, 2010 at 8:24 pm
Hi Alex, great work!
Can you please upload a version which
detects the right dll present on the device..
HTCCamera1.dll or HTCCamera.dll
thanks,
Giorgos
February 24th, 2010 at 9:35 am
i did not finish it yet… vocation, maybe next week
March 6th, 2010 at 6:15 am
Hi Alex, Great work!
I’m facing one issue with this app. The camera preview doesn’t work at all and I see junk frames. However, when I click on ‘grab frame’, then I get correct image. Some problem with the way preview is implemented.
I’m using HTC Touch Pro 2 with Windows Mobile 6.5
March 7th, 2010 at 11:24 pm
i`ve uploaded version with traces on server, i writes logs to trace.txt in root if it has any problems in init method
March 9th, 2010 at 9:27 am
I don’t see any log file generated which means there is no bug in init method. However, the problem still persists. To give you an idea of what I’m talking about, please see this 20 second screen capture video.
http://s975.photobucket.com/albums/ae237/tumbal1/?action=view¤t=VIDEO_099.flv
March 9th, 2010 at 9:35 am
2Abito, on some devices init does not work, so this is version was for them to define what exactly wrong…
April 7th, 2010 at 6:20 pm
Hi Alex,
Any improvements with HTC Camera project?
Could you fix the colour issue?
Thank you.
April 7th, 2010 at 11:03 pm
i work on it when have free time
August 4th, 2010 at 3:59 pm
Hi!
I have still the problem that HTCCamera.native.dll coudn’t be found while debugging test project. The dll file is in bin/debug directory as you said.
Where ist the problem? Maybe the dll-File is broken? as i cant open with any tool.
Greetz
Bakka