HTCCamera v.1.0

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

19 Responses to “HTCCamera v.1.0”

  1. 1
    hypest Says:

    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

  2. 2
    admin Says:

    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

  3. 3
    hypest Says:

    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.

  4. 4
    admin Says:

    sure you need sources to add traces… also i can add it by my self and upload on site but not earlier than tonight

  5. 5
    luis Says:

    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.

  6. 6
    admin Says:

    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

  7. 7
    hypest Says:

    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

  8. 8
    admin Says:

    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 :(

  9. 9
    hypest Says:

    Alex,

    ok, I understand. Thank you anyway :)

  10. 10
    Sander Says:

    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

  11. 11
    giorgos Says:

    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

  12. 12
    admin Says:

    i did not finish it yet… vocation, maybe next week

  13. 13
    Abito Says:

    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

  14. 14
    admin Says:

    i`ve uploaded version with traces on server, i writes logs to trace.txt in root if it has any problems in init method

  15. 15
    Abito Says:

    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&current=VIDEO_099.flv

  16. 16
    admin Says:

    2Abito, on some devices init does not work, so this is version was for them to define what exactly wrong…

  17. 17
    Luis Says:

    Hi Alex,

    Any improvements with HTC Camera project?
    Could you fix the colour issue?

    Thank you.

  18. 18
    admin Says:

    i work on it when have free time

  19. 19
    Bakka Says:

    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

Leave a Reply