×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    How To Build A Camera Program On Maemo

    Hi, guys,

    I am new to Maemo/Qt for Maemo. I want to write a program that could realise the basic viewfinder function of the camera on device N900. On Symbian platform, Qt Mobile extention could be used for XQCamera. What about on maemo 5? Any idea about what I should do?

    Cheers

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by pta0007 View Post
    Hi, guys,

    I am new to Maemo/Qt for Maemo. I want to write a program that could realise the basic viewfinder function of the camera on device N900. On Symbian platform, Qt Mobile extention could be used for XQCamera. What about on maemo 5? Any idea about what I should do?

    Cheers
    You can use Qt Mobility Multimedia library
    http://labs.trolltech.com/blogs/2009/09/03/multimedia/
    or use Maemo multimedia libraries directly
    http://wiki.maemo.org/Documentation/...s/Introduction

  3. #3
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by divanov View Post
    You can use Qt Mobility Multimedia library
    http://labs.trolltech.com/blogs/2009/09/03/multimedia/
    or use Maemo multimedia libraries directly
    http://wiki.maemo.org/Documentation/...s/Introduction
    Could you give me some more details about how to use maemo libraries in Qt program? Every time I "make" the project, the libraries such as "gtk/gtk.h,gst/gst.h,hildon/hildon-program.h..." can't be found.

    I am using MADDE to build the project. MADDE itself includes "gtk+-2.0,hildon-1..." for pkg-config. But I don't understand how to use it. Following the instruction from "http://wiki.maemo.org/MADDE/FAQ",--How well does MADDE work for GTK+ development (in C)? If I try the command: mad gcc -o foo foo.c `mad pkg-config --cflags --libs gtk+-2.0' , the qt library can't be found, which makes me think that I can't use qt and gtk+ at the same time. What's the solution then? Any help?

    Cheers.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by pta0007 View Post
    Every time I "make" the project, the libraries such as "gtk/gtk.h,gst/gst.h,hildon/hildon-program.h..." can't be found.
    Those are header files, not a libraries.

    pkg-config is integrated within qmake. In order to inform qmake that you are using Gtk2, Hildon and GStreamer libraries add those lines to your .pro file:
    Code:
    unix {
        CONFIG += link_pkgconfig
        PKGCONFIG += gtk+-2.0 hildon-1 gstreamer-0.10
    }

  5. #5
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by divanov View Post
    Those are header files, not a libraries.

    pkg-config is integrated within qmake. In order to inform qmake that you are using Gtk2, Hildon and GStreamer libraries add those lines to your .pro file:
    Code:
    unix {
        CONFIG += link_pkgconfig
        PKGCONFIG += gtk+-2.0 hildon-1 gstreamer-0.10
    }
    THX so much. But I met another problem. After adding the code to the .pro file, I run qmake, had "'pkg-config' is not recognized as an internal or external command,operable program or batch file.".

    I checked my disk, there was a file named pkg-config in madde dir. I tried to add the directory into $PATH, but unfortunatly, it didn't help. Do I need to intall something to make it work? How?

    Cheers.

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by pta0007 View Post
    THX so much. But I met another problem. After adding the code to the .pro file, I run qmake, had "'pkg-config' is not recognized as an internal or external command,operable program or batch file.".

    I checked my disk, there was a file named pkg-config in madde dir. I tried to add the directory into $PATH, but unfortunatly, it didn't help. Do I need to intall something to make it work? How?

    Cheers.
    In MADDE the command should be "mad pkg-config" as you can see from your second comment.

  7. #7
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by divanov View Post
    In MADDE the command should be "mad pkg-config" as you can see from your second comment.
    sorry, I don't understand what you mean. After adding the code to the .pro, I just cd to the project and "mad qmake", then "mad make" to run the project. Do you mean I need to "mad pkg-config..." before "mad qmake"? but it doesn't work.

    "'pkg-config' is not recognized as an internal or external command, operable program or batch file." just come when i "mad qmake".

    Sorry for my stupid. would explain to me furhter?

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by pta0007 View Post
    sorry, I don't understand what you mean. After adding the code to the .pro, I just cd to the project and "mad qmake", then "mad make" to run the project. Do you mean I need to "mad pkg-config..." before "mad qmake"? but it doesn't work.

    "'pkg-config' is not recognized as an internal or external command, operable program or batch file." just come when i "mad qmake".

    Sorry for my stupid. would explain to me furhter?
    qmake, make and pkg-config are just some Linux commands. In MADDE you call them through wrapper mad. The actual problem is that qmake use some commands inside and it seems to fail, when it calls pkg-config directly.

  9. #9
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: How To Build A Camera Program On Maemo

    so, what should I do then to fix it?

  10. #10
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by pta0007 View Post
    so, what should I do then to fix it?
    You have three options:
    1) file a bug to MADDE, as it should actually work;
    2) try to fix it yourself replacing all calls of "pkg-config" to "mad pkg-config".
    3) install Ubuntu and develop in natural environment.

  11. #11
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: How To Build A Camera Program On Maemo

    I have a problem when trying to run the example_camera.c on n900.

    I could compile the program correctly, but when I tried to run it on device, it showed "Failed to initialize pipeline ". The following is part of the code:

    #ifdef __arm__
    #define VIDEO_SRC "v4l2camsrc"
    #define VIDEO_SINK "xvimagesink"
    #else
    #define VIDEO_SRC "videotestsrc"
    #define VIDEO_SINK "ximagesink"
    #endif

    who can figure out what is the problem? Thx!

  12. #12
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How To Build A Camera Program On Maemo

    The example works perfectly for me.

  13. #13
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by divanov View Post
    The example works perfectly for me.
    Did you use the same code as described, or you changed something?

    the code:
    #ifdef __arm__
    #define VIDEO_SRC "v4l2camsrc"
    #define VIDEO_SINK "xvimagesink"
    #else
    #define VIDEO_SRC "videotestsrc"
    #define VIDEO_SINK "ximagesink"
    #endif

  14. #14
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How To Build A Camera Program On Maemo

    Quote Originally Posted by pta0007 View Post
    Did you use the same code as described, or you changed something?
    I didn't touch the code after checkout.
    https://vcs.maemo.org/svn/maemoexamp...aemo-examples/

  15. #15
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: How To Build A Camera Program On Maemo

    I fixed the "static gboolean initialize_pipeline(AppData *appdata,int *argc, char ***argv){}" part, to be the same as the orignal code.

    But the problem now is everytime I run the app, the window just opened and then disappeared immediately. It seems that in main(), the pipeline could be initialized through "initialize_pipeline(&appdata, &argc, &argv)", since no "Failed to initialize ..." appeared again. However, I think the initialize_pipeline also made the window to shut down, cause I found that if I delete "initialize_pipeline" part in main() function, everything works fine--the window opens and the button shows up. Of course, the window is black without the camera.

    So what is the problem now? Since you can run the app corretly, I don't think it's the problem of the code.

Similar Threads

  1. Exiting camera in a flash lite program
    By mfadjuko in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2009-04-21, 12:43
  2. Problem in resolving Build error prj0019
    By psandhu in forum Symbian
    Replies: 2
    Last Post: 2008-10-07, 14:30
  3. Forum Nokia Supports maemo
    By Nokia Ron in forum News and Announcements
    Replies: 3
    Last Post: 2007-10-23, 09:33
  4. Replies: 1
    Last Post: 2004-04-02, 08:47
  5. armi build not working
    By lemody in forum Symbian
    Replies: 0
    Last Post: 2003-06-14, 15:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×