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 :)
Re: How To Build A Camera Program On Maemo
[QUOTE=pta0007;702821]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 :)[/QUOTE]
You can use Qt Mobility Multimedia library
[url]http://labs.trolltech.com/blogs/2009/09/03/multimedia/[/url]
or use Maemo multimedia libraries directly
[url]http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Using_Multimedia_Components/Introduction[/url]
Re: How To Build A Camera Program On Maemo
[QUOTE=divanov;702831]You can use Qt Mobility Multimedia library
[url]http://labs.trolltech.com/blogs/2009/09/03/multimedia/[/url]
or use Maemo multimedia libraries directly
[url]http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Using_Multimedia_Components/Introduction[/url][/QUOTE]
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.
Re: How To Build A Camera Program On Maemo
[QUOTE=pta0007;705614]Every time I "make" the project, the libraries such as "gtk/gtk.h,gst/gst.h,hildon/hildon-program.h..." can't be found.[/QUOTE]
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
}
[/CODE]
Re: How To Build A Camera Program On Maemo
[QUOTE=divanov;705630]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
}
[/CODE][/QUOTE]
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.
Re: How To Build A Camera Program On Maemo
[QUOTE=pta0007;705704]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.[/QUOTE]
In MADDE the command should be "mad pkg-config" as you can see from your second comment.
Re: How To Build A Camera Program On Maemo
[QUOTE=divanov;705727]In MADDE the command should be "mad pkg-config" as you can see from your second comment.[/QUOTE]
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?
Re: How To Build A Camera Program On Maemo
[QUOTE=pta0007;705734]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?[/QUOTE]
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.
Re: How To Build A Camera Program On Maemo
so, what should I do then to fix it?
Re: How To Build A Camera Program On Maemo
[QUOTE=pta0007;705743]so, what should I do then to fix it?[/QUOTE]
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.
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!
Re: How To Build A Camera Program On Maemo
The example works perfectly for me.
Re: How To Build A Camera Program On Maemo
[QUOTE=divanov;706703]The example works perfectly for me.[/QUOTE]
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
Re: How To Build A Camera Program On Maemo
[QUOTE=pta0007;706922]Did you use the same code as described, or you changed something?[/QUOTE]
I didn't touch the code after checkout.
[url]https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/maemo-examples/[/url]
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.