From gambas at ...1... Sun Feb 1 18:37:25 2009 From: gambas at ...1... (Benoit Minisini) Date: Sun, 1 Feb 2009 18:37:25 +0100 Subject: [Gambas-devel] Error in dialog class In-Reply-To: <393452.4438.qm@...582...> References: <174670.41058.qm@...556...> <200901311653.27726.gambas@...1...> <393452.4438.qm@...582...> Message-ID: <200902011837.25827.gambas@...1...> On samedi 31 janvier 2009, David Villalobos Cambronero wrote: > Hi, sure, here it is: > > type = 'R' parent_type = 'P' > > Regards > > > -- > David > I don't have a 64 bits linux under the hand. Is it possible for you to grant me an ssh access to your machine so that I can debug the interpreter directly on it? -- Benoit Minisini From gambas at ...1... Mon Feb 2 02:16:54 2009 From: gambas at ...1... (Benoit Minisini) Date: Mon, 2 Feb 2009 02:16:54 +0100 Subject: [Gambas-devel] Error in dialog class In-Reply-To: <200902011837.25827.gambas@...1...> References: <174670.41058.qm@...556...> <393452.4438.qm@...582...> <200902011837.25827.gambas@...1...> Message-ID: <200902020216.55048.gambas@...1...> On dimanche 1 f?vrier 2009, Benoit Minisini wrote: > On samedi 31 janvier 2009, David Villalobos Cambronero wrote: > > Hi, sure, here it is: > > > > type = 'R' parent_type = 'P' > > > > Regards > > > > > > -- > > David > > I don't have a 64 bits linux under the hand. Is it possible for you to > grant me an ssh access to your machine so that I can debug the interpreter > directly on it? Hey! I discovered that VirtualBox now can run 64 bits guest on 32 bits host! I'm currently installing Ubuntu 8.10 64 bits. Once the 244 updates are installed, I will try to compile Gambas on it. Do the Ubuntu development packages have the same names between 64 bits and 32 bits version? -- Benoit Minisini From david_villalobos_c at ...7... Mon Feb 2 14:37:49 2009 From: david_villalobos_c at ...7... (David Villalobos Cambronero) Date: Mon, 2 Feb 2009 05:37:49 -0800 (PST) Subject: [Gambas-devel] Error in dialog class References: <174670.41058.qm@...556...> <393452.4438.qm@...582...> <200902011837.25827.gambas@...1...> <200902020216.55048.gambas@...1...> Message-ID: <798849.9443.qm@...582...> Well, I don't use Ubuntu, but here in my office some coworkers do, and the use the list of packs listed in the wiki. And of course, I can gave you access to my pc. Just let me know when. Regards -- David ----- Original Message ---- From: Benoit Minisini To: gambas-devel at lists.sourceforge.net Sent: Sunday, February 1, 2009 7:16:54 PM Subject: Re: [Gambas-devel] Error in dialog class On dimanche 1 f?vrier 2009, Benoit Minisini wrote: > On samedi 31 janvier 2009, David Villalobos Cambronero wrote: > > Hi, sure, here it is: > > > > type = 'R' parent_type = 'P' > > > > Regards > > > > > > -- > > David > > I don't have a 64 bits linux under the hand. Is it possible for you to > grant me an ssh access to your machine so that I can debug the interpreter > directly on it? Hey! I discovered that VirtualBox now can run 64 bits guest on 32 bits host! I'm currently installing Ubuntu 8.10 64 bits. Once the 244 updates are installed, I will try to compile Gambas on it. Do the Ubuntu development packages have the same names between 64 bits and 32 bits version? -- Benoit Minisini ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel From gambas at ...1... Mon Feb 2 15:54:05 2009 From: gambas at ...1... (Benoit Minisini) Date: Mon, 2 Feb 2009 15:54:05 +0100 Subject: [Gambas-devel] Error in dialog class In-Reply-To: <798849.9443.qm@...582...> References: <174670.41058.qm@...556...> <200902020216.55048.gambas@...1...> <798849.9443.qm@...582...> Message-ID: <200902021554.05512.gambas@...1...> On lundi 2 f?vrier 2009, David Villalobos Cambronero wrote: > Well, I don't use Ubuntu, but here in my office some coworkers do, and the > use the list of packs listed in the wiki. > > And of course, I can gave you access to my pc. Just let me know when. > > Regards > > > -- > David > Pfouh. The bug is finally fixed in revision #1847. Regards, -- Benoit Minisini From david_villalobos_c at ...7... Mon Feb 2 16:22:18 2009 From: david_villalobos_c at ...7... (David Villalobos Cambronero) Date: Mon, 2 Feb 2009 07:22:18 -0800 (PST) Subject: [Gambas-devel] Error in dialog class References: <174670.41058.qm@...556...> <200902020216.55048.gambas@...1...> <798849.9443.qm@...582...> <200902021554.05512.gambas@...1...> Message-ID: <500863.97442.qm@...588...> Ok, I'll try and tell you. Regards -- David ----- Original Message ---- From: Benoit Minisini To: mailing list for gambas developers Sent: Monday, February 2, 2009 8:54:05 AM Subject: Re: [Gambas-devel] Error in dialog class On lundi 2 f?vrier 2009, David Villalobos Cambronero wrote: > Well, I don't use Ubuntu, but here in my office some coworkers do, and the > use the list of packs listed in the wiki. > > And of course, I can gave you access to my pc. Just let me know when. > > Regards > > > -- > David > Pfouh. The bug is finally fixed in revision #1847. Regards, -- Benoit Minisini ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel From david_villalobos_c at ...7... Mon Feb 2 16:54:14 2009 From: david_villalobos_c at ...7... (David Villalobos Cambronero) Date: Mon, 2 Feb 2009 07:54:14 -0800 (PST) Subject: [Gambas-devel] Error in dialog class References: <174670.41058.qm@...556...> <200902020216.55048.gambas@...1...> <798849.9443.qm@...582...> <200902021554.05512.gambas@...1...> <500863.97442.qm@...588...> Message-ID: <175639.14349.qm@...591...> Great!! I works as spected. Regards -- David ----- Original Message ---- From: David Villalobos Cambronero To: mailing list for gambas developers Sent: Monday, February 2, 2009 9:22:18 AM Subject: Re: [Gambas-devel] Error in dialog class Ok, I'll try and tell you. Regards -- David ----- Original Message ---- From: Benoit Minisini To: mailing list for gambas developers Sent: Monday, February 2, 2009 8:54:05 AM Subject: Re: [Gambas-devel] Error in dialog class On lundi 2 f?vrier 2009, David Villalobos Cambronero wrote: > Well, I don't use Ubuntu, but here in my office some coworkers do, and the > use the list of packs listed in the wiki. > > And of course, I can gave you access to my pc. Just let me know when. > > Regards > > > -- > David > Pfouh. The bug is finally fixed in revision #1847. Regards, -- Benoit Minisini ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel From gambas at ...1... Thu Feb 5 16:39:46 2009 From: gambas at ...1... (=?iso-8859-1?q?Beno=EEt_Minisini?=) Date: Thu, 5 Feb 2009 16:39:46 +0100 Subject: [Gambas-devel] Just a test Message-ID: <200902051639.46303.gambas@...1...> -- Beno?t From gareth at ...623... Fri Feb 6 11:34:18 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 6 Feb 2009 10:34:18 +0000 (GMT) Subject: [Gambas-devel] Gambas as a web server ... In-Reply-To: <30392548.432261233916454097.JavaMail.root@...616...> Message-ID: <14915408.432281233916458381.JavaMail.root@...616...> Hi, Expanding on the question I asked on Gambas-user yesterday .. what I'd like to do it to write an application server that is able to use Gambas as it's scripting Language. Given it doesn't look practical to do this directly given the threading issue, does anyone have any views / ideas about how well it would work in reverse? i.e. if I were to write a multi-threaded http-daemon in "C", is it likely to be practical to call Gambas within given threads to run code fragments which service web requests? I'm wondering whether I can use one thread which can be used to store and compile code with Eval.Compile .. then run the resulting objects in threads with Eval.Value ... ?? Does this sound doable / practical ? tia Gareth. -- Gareth Bult (Gareth at ...624...) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ron at ...572... Fri Feb 6 11:59:00 2009 From: ron at ...572... (Ron) Date: Fri, 06 Feb 2009 11:59:00 +0100 Subject: [Gambas-devel] Gambas as a web server ... In-Reply-To: <14915408.432281233916458381.JavaMail.root@...616...> References: <14915408.432281233916458381.JavaMail.root@...616...> Message-ID: <498C17F4.3090300@...572...> Gareth Bult schreef: > Hi, > > Expanding on the question I asked on Gambas-user yesterday .. what I'd > like to do it to write an application server that is able to use > Gambas as it's scripting Language. Given it doesn't look practical to > do this directly given the threading issue, does anyone have any views > / ideas about how well it would work in reverse? > > i.e. if I were to write a multi-threaded http-daemon in "C", is it > likely to be practical to call Gambas within given threads to run code > fragments which service web requests? I'm wondering whether I can use > one thread which can be used to store and compile code with > Eval.Compile .. then run the resulting objects in threads with > Eval.Value ... ?? > > Does this sound doable / practical ? > > tia > > Gareth. > > -- > Gareth Bult (Gareth at ...624...) Gareth, I'm have also interested in this topic, since this kind of scripting is on the todolist of my own project. Eval is very limited I guess. I know of misterhouse which has it's own webserver in perl which supports threads (unix) or no threads (windows) param controlled by a variable called fork. Maybe it's usable, I have ported other parts of misterhouse's perl code to gambas, which was quite easy to do, and runs very nice. This is the code which makes up the webserver: http://misterhouse.svn.sourceforge.net/viewvc/misterhouse/trunk/lib/http_server.pl?view=markup Regards, Ron_2nd From gareth at ...623... Fri Feb 6 12:47:35 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 6 Feb 2009 11:47:35 +0000 (GMT) Subject: [Gambas-devel] Gambas as a web server ... In-Reply-To: <498C17F4.3090300@...572...> Message-ID: <20664530.432441233920855001.JavaMail.root@...616...> Hi, The "C" / threading side of things is not a problem .. I can code this in my sleep and indeed have a couple of working examples I've written for other projects .. the real questions are; a. Can Gambas be efficiently called from "C" b. Can Eval (which I've not played with) compile and run code fragments efficiently c. Is there an alternative to "Eval" for compiling / running code fragments that I should use instead Just wondered if anyone had any advance knowledge of this before I started experimenting ... ? Gareth. ----- Original Message ----- From: "Ron" To: "mailing list for gambas developers" Sent: Friday, 6 February, 2009 10:59:00 AM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] Gambas as a web server ... Gareth Bult schreef: > Hi, > > Expanding on the question I asked on Gambas-user yesterday .. what I'd > like to do it to write an application server that is able to use > Gambas as it's scripting Language. Given it doesn't look practical to > do this directly given the threading issue, does anyone have any views > / ideas about how well it would work in reverse? > > i.e. if I were to write a multi-threaded http-daemon in "C", is it > likely to be practical to call Gambas within given threads to run code > fragments which service web requests? I'm wondering whether I can use > one thread which can be used to store and compile code with > Eval.Compile .. then run the resulting objects in threads with > Eval.Value ... ?? > > Does this sound doable / practical ? > > tia > > Gareth. > > -- > Gareth Bult (Gareth at ...624...) Gareth, I'm have also interested in this topic, since this kind of scripting is on the todolist of my own project. Eval is very limited I guess. I know of misterhouse which has it's own webserver in perl which supports threads (unix) or no threads (windows) param controlled by a variable called fork. Maybe it's usable, I have ported other parts of misterhouse's perl code to gambas, which was quite easy to do, and runs very nice. This is the code which makes up the webserver: http://misterhouse.svn.sourceforge.net/viewvc/misterhouse/trunk/lib/http_server.pl?view=markup Regards, Ron_2nd ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From gambas at ...1... Fri Feb 6 13:34:00 2009 From: gambas at ...1... (=?iso-8859-1?q?Beno=EEt_Minisini?=) Date: Fri, 6 Feb 2009 13:34:00 +0100 Subject: [Gambas-devel] Gambas as a web server ... In-Reply-To: <20664530.432441233920855001.JavaMail.root@...616...> References: <20664530.432441233920855001.JavaMail.root@...616...> Message-ID: <200902061334.00921.gambas@...1...> > Hi, > > The "C" / threading side of things is not a problem .. I can code this in > my sleep and indeed have a couple of working examples I've written for > other projects .. the real questions are; > > a. Can Gambas be efficiently called from "C" > b. Can Eval (which I've not played with) compile and run code fragments > efficiently c. Is there an alternative to "Eval" for compiling / running > code fragments that I should use instead > > Just wondered if anyone had any advance knowledge of this before I started > experimenting ... ? > > Gareth. > Hi, Gareth. I'm writing for my job a Web application in Gambas. It is "just" a CGI script plugged into a light web server. I use a patched thttpd, but lighttpd is well- known too. thttpd does not use thread to dispatch request. Apparently threaded server seems to always be slower than non-threaded ones. It is very fast, and I'm sure that my CGI script written in Gambas beats in speed many other web application. :-) Try that, and if you find it too slow, of course writing a HTTP server in the same process as the gambas interpreter would be interesting. You will win the process launch time (even if launching a process on Linux is very fast). But then, just take the thttpd source code and merge it in a gambas component. I can't imagine writing a faster HTTP server. P.S.: I don't receive my own post on the mailing-list anymore, since I installed KDE 4.2. But this should not be related, unless there is an hidden change in KMail. Hopefully, I receive posts from other people. If somebody has a clue... Regards, -- Beno?t From gareth at ...623... Fri Feb 6 13:49:49 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 6 Feb 2009 12:49:49 +0000 (GMT) Subject: [Gambas-devel] Gambas as a web server ... In-Reply-To: <3126745.432751233924463834.JavaMail.root@...616...> Message-ID: <24801768.432791233924589261.JavaMail.root@...616...> Hi, As the script needs to access a database and the database open / connect time is significant, the script needs to be "resident" or live within a "resident" wrapped .. so CGI doesn't really do it for me. I guess Fast CGI might, but I've tried to use this in the past and been disappointed. I think the bottom line is, I need to find "some" way to make Gambas work with threads, even if I write in "C" and call Gambas from a thread .. so .. is there an interface that would be useful to call Gambas from "C" which would be efficient with regards to calling different Gambas code snippets very quickly .. (EXEC is not an option! ;-) ) tia Gareth. ----- Original Message ----- From: "Beno?t Minisini" To: "mailing list for gambas developers" Sent: Friday, 6 February, 2009 12:34:00 PM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] Gambas as a web server ... > Hi, > > The "C" / threading side of things is not a problem .. I can code this in > my sleep and indeed have a couple of working examples I've written for > other projects .. the real questions are; > > a. Can Gambas be efficiently called from "C" > b. Can Eval (which I've not played with) compile and run code fragments > efficiently c. Is there an alternative to "Eval" for compiling / running > code fragments that I should use instead > > Just wondered if anyone had any advance knowledge of this before I started > experimenting ... ? > > Gareth. > Hi, Gareth. I'm writing for my job a Web application in Gambas. It is "just" a CGI script plugged into a light web server. I use a patched thttpd, but lighttpd is well- known too. thttpd does not use thread to dispatch request. Apparently threaded server seems to always be slower than non-threaded ones. It is very fast, and I'm sure that my CGI script written in Gambas beats in speed many other web application. :-) Try that, and if you find it too slow, of course writing a HTTP server in the same process as the gambas interpreter would be interesting. You will win the process launch time (even if launching a process on Linux is very fast). But then, just take the thttpd source code and merge it in a gambas component. I can't imagine writing a faster HTTP server. P.S.: I don't receive my own post on the mailing-list anymore, since I installed KDE 4.2. But this should not be related, unless there is an hidden change in KMail. Hopefully, I receive posts from other people. If somebody has a clue... Regards, -- Beno?t ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From gambas at ...1... Fri Feb 6 15:31:32 2009 From: gambas at ...1... (=?iso-8859-1?q?Beno=EEt_Minisini?=) Date: Fri, 6 Feb 2009 15:31:32 +0100 Subject: [Gambas-devel] Gambas as a web server ... In-Reply-To: <24801768.432791233924589261.JavaMail.root@...616...> References: <24801768.432791233924589261.JavaMail.root@...616...> Message-ID: <200902061531.32148.gambas@...1...> > Hi, > > As the script needs to access a database and the database open / connect > time is significant, the script needs to be "resident" or live within a > "resident" wrapped .. so CGI doesn't really do it for me. I guess Fast CGI > might, but I've tried to use this in the past and been disappointed. > > I think the bottom line is, I need to find "some" way to make Gambas work > with threads, even if I write in "C" and call Gambas from a thread The gambas interpreter cannot be called from two threads simultaneousely. If you want to run two bunch of Gambas code at the same time, you need two different processes. Regards, -- Beno?t From gareth at ...623... Fri Feb 6 16:16:20 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 6 Feb 2009 15:16:20 +0000 (GMT) Subject: [Gambas-devel] Gambas as a web server ... In-Reply-To: <200902061531.32148.gambas@...1...> Message-ID: <15916255.433541233933380541.JavaMail.root@...616...> Ok, That's saved me some time .. :-) Might be do-able as separate processes .. I just need a persistent IPC mechanism for sharing sessions, which I would need anyway to load-balance across servers. Gambas has a fairly small footprint so it might be practical - will think some more .. :) Gareth. ----- Original Message ----- From: "Beno?t Minisini" To: "mailing list for gambas developers" Sent: Friday, 6 February, 2009 2:31:32 PM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] Gambas as a web server ... > Hi, > > As the script needs to access a database and the database open / connect > time is significant, the script needs to be "resident" or live within a > "resident" wrapped .. so CGI doesn't really do it for me. I guess Fast CGI > might, but I've tried to use this in the past and been disappointed. > > I think the bottom line is, I need to find "some" way to make Gambas work > with threads, even if I write in "C" and call Gambas from a thread The gambas interpreter cannot be called from two threads simultaneousely. If you want to run two bunch of Gambas code at the same time, you need two different processes. Regards, -- Beno?t ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From ozgur at ...625... Sun Feb 8 21:48:20 2009 From: ozgur at ...625... (=?utf-8?q?=C3=96zg=C3=BCr_Kuru?=) Date: Sun, 8 Feb 2009 22:48:20 +0200 Subject: [Gambas-devel] Gambas Turkish Users & Translation Message-ID: <200902082248.20173.ozgur@...625...> Hello, I am writing from Turkey. I am Pardus[1] user. I started to translate gambas help doc to Turkish. Now we are working two people for that. We want found Turkish Gambas User Group.I wrote some articels in Ozgurlukicin.com[2] e-magazin. If possible, you can add turkish page to your web pages. We can manage it. Thanks a lot.. ?zg?r Kuru ozgur at ...625... From ozgur at ...625... Sun Feb 8 22:12:17 2009 From: ozgur at ...625... (=?utf-8?q?=C3=96zg=C3=BCr_Kuru?=) Date: Sun, 8 Feb 2009 23:12:17 +0200 Subject: [Gambas-devel] Gambas Turkish Translation Message-ID: <200902082312.17256.ozgur@...625...> Hello, I am writing from Turkey. I am Pardus[1] user. I started to translate gambas help doc to Turkish. Now we are working two people for that. We want found Turkish Gambas User Group.I wrote some articels in Ozgurlukicin.com[2] e-magazin. If possible, you can add turkish page to your web pages. We can manage it. Thanks a lot.. ?zg?r Kuru ozgur at ...625... From david_villalobos_c at ...7... Wed Feb 18 16:34:09 2009 From: david_villalobos_c at ...7... (David Villalobos Cambronero) Date: Wed, 18 Feb 2009 07:34:09 -0800 (PST) Subject: [Gambas-devel] Gambas 3 r1878 Message-ID: <134990.88734.qm@...582...> I got the following error when running Gambas 3 in my Mandriva 2008.1 64Bits (see pic too) FMain.$load.2123: #2: Cannot load class 'ToolBar': Unable to load class file 0: FMain.$load.2123 1: FMain.FMain.0 2: Project.Main.163 Here is the debug Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) set args -p (gdb) run Starting program: /usr/local/bin/gbx3 -p [Thread debugging using libthread_db enabled] [New process 13735] [New Thread 47884624064912 (LWP 13735)] FMain.$load.2123: #2: Cannot load class 'ToolBar': Unable to load class file 0: FMain.$load.2123 1: FMain.FMain.0 2: Project.Main.163 Program exited with code 01. (gdb) bt No stack. Best regards -- David -------------- next part -------------- A non-text attachment was scrubbed... Name: ErrorGambas.png Type: image/png Size: 12542 bytes Desc: not available URL: From silvan.calarco at ...531... Fri Feb 20 04:32:01 2009 From: silvan.calarco at ...531... (Silvan Calarco) Date: Fri, 20 Feb 2009 04:32:01 +0100 Subject: [Gambas-devel] v4l2 patch for gb.v4l Message-ID: <200902200432.02619.silvan.calarco@...531...> Hello. attached is a patch I wrote for a customer who needs support for a v4l2 webcam (it's a Logitech QuickCam 9000 Pro) in gambas. The patch integrates the example code from v4l2 api documentation (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that should be backwards compatibile (v4l1). The patch is at a basic and ugly level and only supports YUYV to BGR24 pixel format conversion (the function is taken from libv4l though the library could be used for most pixel formats support), but with some work it might be of wider interest so I'm posting it here. Silvan -- mambaSoft di Calarco Silvan Web: http://www.mambasoft.it mambaSoft Store @ http://shop.mambasoft.it openmamba GNU/Linux development @ http://www.openmamba.org -------------- next part -------------- A non-text attachment was scrubbed... Name: gambas2-2.10.0-v4l2.patch Type: text/x-patch Size: 24760 bytes Desc: not available URL: From gareth at ...623... Fri Feb 20 10:31:38 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 20 Feb 2009 09:31:38 +0000 (GMT) Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <31148659.477941235122253524.JavaMail.root@...616...> Message-ID: <7911701.477961235122298004.JavaMail.root@...616...> Erm, which version of Gambas is the patch against? (SVN already has full V4L2 support ... ????) ----- Original Message ----- From: "Silvan Calarco" To: "Gambas-devel" Sent: Friday, 20 February, 2009 3:32:01 AM GMT +00:00 GMT Britain, Ireland, Portugal Subject: [Gambas-devel] v4l2 patch for gb.v4l Hello. attached is a patch I wrote for a customer who needs support for a v4l2 webcam (it's a Logitech QuickCam 9000 Pro) in gambas. The patch integrates the example code from v4l2 api documentation (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that should be backwards compatibile (v4l1). The patch is at a basic and ugly level and only supports YUYV to BGR24 pixel format conversion (the function is taken from libv4l though the library could be used for most pixel formats support), but with some work it might be of wider interest so I'm posting it here. Silvan -- mambaSoft di Calarco Silvan Web: http://www.mambasoft.it mambaSoft Store @ http://shop.mambasoft.it openmamba GNU/Linux development @ http://www.openmamba.org ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From silvan.calarco at ...531... Fri Feb 20 10:51:57 2009 From: silvan.calarco at ...531... (Silvan Calarco) Date: Fri, 20 Feb 2009 10:51:57 +0100 Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <7911701.477961235122298004.JavaMail.root@...616...> References: <7911701.477961235122298004.JavaMail.root@...616...> Message-ID: <200902201051.57568.silvan.calarco@...531...> In data venerd? 20 febbraio 2009 10:31:38, Gareth Bult ha scritto: : > Erm, which version of Gambas is the patch against? > (SVN already has full V4L2 support ... ????) Really? :( I've tried this patch against gambas 2.10.0 and 2.11.1. Silvan > > ----- Original Message ----- > From: "Silvan Calarco" > To: "Gambas-devel" > Sent: Friday, 20 February, 2009 3:32:01 AM GMT +00:00 GMT Britain, Ireland, > Portugal Subject: [Gambas-devel] v4l2 patch for gb.v4l > > Hello. > attached is a patch I wrote for a customer who needs support for a v4l2 > webcam (it's a Logitech QuickCam 9000 Pro) in gambas. > The patch integrates the example code from v4l2 api documentation > (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that > should be backwards compatibile (v4l1). The patch is at a basic and ugly > level and only supports YUYV to BGR24 pixel format conversion (the function > is taken from libv4l though the library could be used for most pixel > formats support), but with some work it might be of wider interest so I'm > posting it here. > > Silvan > > -- > mambaSoft di Calarco Silvan > Web: http://www.mambasoft.it > > mambaSoft Store @ http://shop.mambasoft.it > openmamba GNU/Linux development @ http://www.openmamba.org > > --------------------------------------------------------------------------- >--- Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing > the Enterprise -Strategies to boost innovation and cut costs with open > source participation -Receive a $600 discount off the registration fee with > the source code: SFAD http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel -- mambaSoft di Calarco Silvan Web: http://www.mambasoft.it mambaSoft Store @ http://shop.mambasoft.it openmamba GNU/Linux development @ http://www.openmamba.org From ronstk at ...124... Fri Feb 20 11:01:03 2009 From: ronstk at ...124... (Ron_1st) Date: Fri, 20 Feb 2009 11:01:03 +0100 Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <7911701.477961235122298004.JavaMail.root@...616...> References: <7911701.477961235122298004.JavaMail.root@...616...> Message-ID: <200902201101.03468.ronstk@...124...> On Friday 20 February 2009, Gareth Bult wrote: > Erm, which version of Gambas is the patch against? > (SVN already has full V4L2 support ... ????) > > ----- Original Message ----- > From: "Silvan Calarco" > To: "Gambas-devel" > Sent: Friday, 20 February, 2009 3:32:01 AM GMT +00:00 GMT Britain, Ireland, Portugal > Subject: [Gambas-devel] v4l2 patch for gb.v4l > > Hello. > attached is a patch I wrote for a customer who needs support for a v4l2 webcam > (it's a Logitech QuickCam 9000 Pro) in gambas. > The patch integrates the example code from v4l2 api documentation > (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that should > be backwards compatibile (v4l1). The patch is at a basic and ugly level and > only supports YUYV to BGR24 pixel format conversion (the function is taken > from libv4l though the library could be used for most pixel formats support), > but with some work it might be of wider interest so I'm posting it here. > > Silvan > > -- > mambaSoft di Calarco Silvan > Web: http://www.mambasoft.it > > mambaSoft Store @ http://shop.mambasoft.it > openmamba GNU/Linux development @ http://www.openmamba.org > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Still the problems with unknown v4l2 formats. The include for the inserted videodev.h should be in the C source that needs it, not the gambas component that uses the C code generated object. This way the gambas commponent can't replaced by some other component code because the .c is more or less corrupt IMHO. The best would be not to check fantasy formats not supported and tell the value used in the case into the error message. Best regards, Ron_1st -- A: Delete the text you reply on. Q: What to do to get my post on top? --- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --- A: Top-posting. Q: What is the most annoying thing in e-mail? From gareth at ...623... Fri Feb 20 11:07:49 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 20 Feb 2009 10:07:49 +0000 (GMT) Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <200902201051.57568.silvan.calarco@...531...> Message-ID: <5602181.478241235124469419.JavaMail.root@...616...> Ah .. there have been lots of changes relatively recently in SVN to the Image infrastructure including full support for V4L2. (so I'm guessing your patch is superfluous) On the Plus side, I've tested with Logitech QuickCam 3500 Pro and Logitech QuickCam 4000 so I'd be relatively confident that SVN is going to work on your camera. If not, the only reason is going to be output format and there is now a framework in place for easily adding output filters .. There's a little bit of documentation at http://components.gambasrad.org/ ... hth Gareth. ----- Original Message ----- From: "Silvan Calarco" To: "mailing list for gambas developers" Sent: Friday, 20 February, 2009 9:51:57 AM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] v4l2 patch for gb.v4l In data venerd? 20 febbraio 2009 10:31:38, Gareth Bult ha scritto: : > Erm, which version of Gambas is the patch against? > (SVN already has full V4L2 support ... ????) Really? :( I've tried this patch against gambas 2.10.0 and 2.11.1. Silvan > > ----- Original Message ----- > From: "Silvan Calarco" > To: "Gambas-devel" > Sent: Friday, 20 February, 2009 3:32:01 AM GMT +00:00 GMT Britain, Ireland, > Portugal Subject: [Gambas-devel] v4l2 patch for gb.v4l > > Hello. > attached is a patch I wrote for a customer who needs support for a v4l2 > webcam (it's a Logitech QuickCam 9000 Pro) in gambas. > The patch integrates the example code from v4l2 api documentation > (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that > should be backwards compatibile (v4l1). The patch is at a basic and ugly > level and only supports YUYV to BGR24 pixel format conversion (the function > is taken from libv4l though the library could be used for most pixel > formats support), but with some work it might be of wider interest so I'm > posting it here. > > Silvan > > -- > mambaSoft di Calarco Silvan > Web: http://www.mambasoft.it > > mambaSoft Store @ http://shop.mambasoft.it > openmamba GNU/Linux development @ http://www.openmamba.org > > --------------------------------------------------------------------------- >--- Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing > the Enterprise -Strategies to boost innovation and cut costs with open > source participation -Receive a $600 discount off the registration fee with > the source code: SFAD http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel -- mambaSoft di Calarco Silvan Web: http://www.mambasoft.it ? mambaSoft Store @ http://shop.mambasoft.it openmamba GNU/Linux development @ http://www.openmamba.org ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From gareth at ...623... Fri Feb 20 11:50:07 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 20 Feb 2009 10:50:07 +0000 (GMT) Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <24685536.478431235126285669.JavaMail.root@...616...> Message-ID: <3827437.478591235127007826.JavaMail.root@...616...> >Still the problems with unknown v4l2 formats. What is the problem? >The include for the inserted videodev.h should be in the C source that needs it, >not the gambas component that uses the C code generated object. Feel free to modify the location of the "#include" if you think it could be better placed (!) >This way the gambas commponent can't replaced by some other component code >because the .c is more or less corrupt IMHO. The v4l2 code is in gv4l2.c , the code is CWebCam.* is pre-existing code that was modified to cope with v4l2. I have commented a couple of times that it would be nice to re-factor all the v4l code out into (for example) gv4l.c and leave CWebCam.c purely as a Gambas component container rather than something that contains v4l[2] specific code. Please can you specify whether your problem is with gv4l2.c, in which case I can look at "uncorrupting" it .. or with "CWebCam.*" in which case I need some agreement before I completely rip apart someone else's code. >The best would be not to check fantasy formats not supported and >tell the value used in the case into the error message. Yes, I know, I have a habit of inventing completely non-existent video formats all on my own(!) Not! We have three choices as I see it; a. Support the author's camera only, as with the pre-existing v4l code b. Support all camera's on the V4L2 spec c. Support all camera's that Linux supports (which is a super-set of (b) I have opted for (c), you are telling me this is wrong - I'm open to comments, however as a Linux user, IMHO (c) is a better option. All the video formats listed in the code exist as far as the Linux kernel is concerned. Technically we could have some #ifdef's in the source to look at the kernel version at compile time .. however given the videodev2.h file should be backwards compatible, including it in SVN does make a certain degree of sense. Another alternative would be to remove videodev2.h from SVN and get developers to upgrade to current kernel releases (!) >tell the value used in the case into the error message. This is strange, you've obviously looked at the code... you will see in gv4l2_process_image some code that looks like this; switch(format) { case V4L2_PIX_FMT_RGB332: gv4l2_debug("RGB332"); break; case V4L2_PIX_FMT_RGB444: gv4l2_debug("RGB444"); break; ... and a routine that looks like this; void gv4l2_debug( char *s ) { if( ! gv4l2_debug_mode ) return; printf("gambas v4l2: %s [%d]\n",s,errno); fflush(stdout); } So assuming you have debug turned on .. it "should" tell you what format the camera is supplying if it can't handle it ... Feel free to enhance the text of the message if you wish .. does this not work for you ? Gareth. ----- Original Message ----- From: "Ron_1st" To: gambas-devel at lists.sourceforge.net Sent: Friday, 20 February, 2009 10:01:03 AM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] v4l2 patch for gb.v4l On Friday 20 February 2009, Gareth Bult wrote: > Erm, which version of Gambas is the patch against? > (SVN already has full V4L2 support ... ????) > > ----- Original Message ----- > From: "Silvan Calarco" > To: "Gambas-devel" > Sent: Friday, 20 February, 2009 3:32:01 AM GMT +00:00 GMT Britain, Ireland, Portugal > Subject: [Gambas-devel] v4l2 patch for gb.v4l > > Hello. > attached is a patch I wrote for a customer who needs support for a v4l2 webcam > (it's a Logitech QuickCam 9000 Pro) in gambas. > The patch integrates the example code from v4l2 api documentation > (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that should > be backwards compatibile (v4l1). The patch is at a basic and ugly level and > only supports YUYV to BGR24 pixel format conversion (the function is taken > from libv4l though the library could be used for most pixel formats support), > but with some work it might be of wider interest so I'm posting it here. > > Silvan > > -- > mambaSoft di Calarco Silvan > Web: http://www.mambasoft.it > > mambaSoft Store @ http://shop.mambasoft.it > openmamba GNU/Linux development @ http://www.openmamba.org > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Still the problems with unknown v4l2 formats. The include for the inserted videodev.h should be in the C source that needs it, not the gambas component that uses the C code generated object. This way the gambas commponent can't replaced by some other component code because the .c is more or less corrupt IMHO. The best would be not to check fantasy formats not supported and tell the value used in the case into the error message. Best regards, Ron_1st -- A: Delete the text you reply on. Q: What to do to get my post on top? --- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --- A: Top-posting. Q: What is the most annoying thing in e-mail? ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From gambas at ...1... Fri Feb 20 12:08:14 2009 From: gambas at ...1... (=?iso-8859-1?q?Beno=EEt_Minisini?=) Date: Fri, 20 Feb 2009 12:08:14 +0100 Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <7911701.477961235122298004.JavaMail.root@...616...> References: <7911701.477961235122298004.JavaMail.root@...616...> Message-ID: <200902201208.14614.gambas@...1...> > Erm, which version of Gambas is the patch against? > (SVN already has full V4L2 support ... ????) > Hi, Gareth. I didn't know about these libraries: libv4l1 and libv4l2. The guy who did them apparently decided to face the same problems as you, but in a definitive way. :-) Maybe it would be a good idea to use them directly in gb.v4l for Gambas 3? As for Gambas 2, if the patch works, why not including it? But heavy modifications should stay in Gambas 3. Regards, -- Beno?t From gareth at ...623... Fri Feb 20 12:37:44 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 20 Feb 2009 11:37:44 +0000 (GMT) Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <24845957.478841235129685270.JavaMail.root@...616...> Message-ID: <8841705.478881235129864077.JavaMail.root@...616...> Hi, IMHO the v4l code in G2 won't actually work on many cameras, I would consider it more of a "demo" than the finished article .. certainly the Logitec camera's I've bought recently "all" only work on v4l2. (I only have one camera for V4l testing which is ~ 5 years old) If the patch works on G2, great, however v4l->v4l2 is significant and the chances of it introducing "issues" into what should be the "release" code might be "high". I recall we did have a number of issues relating to memory leaks while getting this code going - I don't know how many of these were down to G3 development and how many were exposed / inherent issues .. (if v4l2 is required in G2, it "might" be a better idea to back-port the new v4l2 code ??) Gareth. ----- Original Message ----- From: "Beno?t Minisini" To: "mailing list for gambas developers" Sent: Friday, 20 February, 2009 11:08:14 AM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] v4l2 patch for gb.v4l > Erm, which version of Gambas is the patch against? > (SVN already has full V4L2 support ... ????) > Hi, Gareth. I didn't know about these libraries: libv4l1 and libv4l2. The guy who did them apparently decided to face the same problems as you, but in a definitive way. :-) Maybe it would be a good idea to use them directly in gb.v4l for Gambas 3? As for Gambas 2, if the patch works, why not including it? But heavy modifications should stay in Gambas 3. Regards, -- Beno?t ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From silvan.calarco at ...531... Fri Feb 20 14:43:20 2009 From: silvan.calarco at ...531... (Silvan Calarco) Date: Fri, 20 Feb 2009 14:43:20 +0100 Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <5602181.478241235124469419.JavaMail.root@...616...> References: <5602181.478241235124469419.JavaMail.root@...616...> Message-ID: <200902201443.21072.silvan.calarco@...531...> In data venerd? 20 febbraio 2009 11:07:49, Gareth Bult ha scritto: : > Ah .. there have been lots of changes relatively recently in SVN to the > Image infrastructure including full support for V4L2. (so I'm guessing your > patch is superfluous) > > On the Plus side, I've tested with Logitech QuickCam 3500 Pro and Logitech > QuickCam 4000 so I'd be relatively confident that SVN is going to work on > your camera. If not, the only reason is going to be output format and there > is now a framework in place for easily adding output filters .. > > There's a little bit of documentation at http://components.gambasrad.org/ > ... Nice, I suppose this will be in version 3 but I needed the implementation in a current stable release. If I checked svn before maybe it was easier for me to do a backport... BTW thanks for your reply. Regards, Silvan > > hth > > Gareth. > > > ----- Original Message ----- > From: "Silvan Calarco" > To: "mailing list for gambas developers" > Sent: Friday, 20 February, 2009 > 9:51:57 AM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: > [Gambas-devel] v4l2 patch for gb.v4l > > In data venerd? 20 febbraio 2009 10:31:38, Gareth Bult ha scritto: > : > Erm, which version of Gambas is the patch against? > > > > (SVN already has full V4L2 support ... ????) > > Really? :( > I've tried this patch against gambas 2.10.0 and 2.11.1. > > Silvan > > > ----- Original Message ----- > > From: "Silvan Calarco" > > To: "Gambas-devel" > > Sent: Friday, 20 February, 2009 3:32:01 AM GMT +00:00 GMT Britain, > > Ireland, Portugal Subject: [Gambas-devel] v4l2 patch for gb.v4l > > > > Hello. > > attached is a patch I wrote for a customer who needs support for a v4l2 > > webcam (it's a Logitech QuickCam 9000 Pro) in gambas. > > The patch integrates the example code from v4l2 api documentation > > (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that > > should be backwards compatibile (v4l1). The patch is at a basic and ugly > > level and only supports YUYV to BGR24 pixel format conversion (the > > function is taken from libv4l though the library could be used for most > > pixel formats support), but with some work it might be of wider interest > > so I'm posting it here. > > > > Silvan > > > > -- > > mambaSoft di Calarco Silvan > > Web: http://www.mambasoft.it > > > > mambaSoft Store @ http://shop.mambasoft.it > > openmamba GNU/Linux development @ http://www.openmamba.org > > > > ------------------------------------------------------------------------- > >-- --- Open Source Business Conference (OSBC), March 24-25, 2009, San > > Francisco, CA -OSBC tackles the biggest issue in open source: Open > > Sourcing the Enterprise -Strategies to boost innovation and cut costs > > with open source participation -Receive a $600 discount off the > > registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H > > _______________________________________________ > > Gambas-devel mailing list > > Gambas-devel at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-devel > > -- > mambaSoft di Calarco Silvan > Web: http://www.mambasoft.it > ? > mambaSoft Store @ http://shop.mambasoft.it > openmamba GNU/Linux development @ http://www.openmamba.org > > --------------------------------------------------------------------------- >--- Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing > the Enterprise -Strategies to boost innovation and cut costs with open > source participation -Receive a $600 discount off the registration fee with > the source code: SFAD http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel -- mambaSoft di Calarco Silvan Web: http://www.mambasoft.it mambaSoft Store @ http://shop.mambasoft.it openmamba GNU/Linux development @ http://www.openmamba.org From gareth at ...623... Fri Feb 20 15:36:40 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 20 Feb 2009 14:36:40 +0000 (GMT) Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <23658410.479601235140497817.JavaMail.root@...616...> Message-ID: <14477683.479621235140600659.JavaMail.root@...616...> Hi, The v4l2 code should work in G2, however a number of changes were made to cope with some G3 changes in image manipulation and memory management which would need to be backed out of .. I wouldn't have thought a backport would be too difficult .. Incidentally, if you have SVN running, I'd be interested to hear if your camera works (!) :) Gareth. ----- Original Message ----- From: "Silvan Calarco" To: "mailing list for gambas developers" Sent: Friday, 20 February, 2009 1:43:20 PM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] v4l2 patch for gb.v4l In data venerd? 20 febbraio 2009 11:07:49, Gareth Bult ha scritto: : > Ah .. there have been lots of changes relatively recently in SVN to the > Image infrastructure including full support for V4L2. (so I'm guessing your > patch is superfluous) > > On the Plus side, I've tested with Logitech QuickCam 3500 Pro and Logitech > QuickCam 4000 so I'd be relatively confident that SVN is going to work on > your camera. If not, the only reason is going to be output format and there > is now a framework in place for easily adding output filters .. > > There's a little bit of documentation at http://components.gambasrad.org/ > ... Nice, I suppose this will be in version 3 but I needed the implementation in a current stable release. If I checked svn before maybe it was easier for me to do a backport... BTW thanks for your reply. Regards, Silvan > > hth > > Gareth. > > > ----- Original Message ----- > From: "Silvan Calarco" > To: "mailing list for gambas developers" > Sent: Friday, 20 February, 2009 > 9:51:57 AM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: > [Gambas-devel] v4l2 patch for gb.v4l > > In data venerd? 20 febbraio 2009 10:31:38, Gareth Bult ha scritto: > : > Erm, which version of Gambas is the patch against? > > > > (SVN already has full V4L2 support ... ????) > > Really? :( > I've tried this patch against gambas 2.10.0 and 2.11.1. > > Silvan > > > ----- Original Message ----- > > From: "Silvan Calarco" > > To: "Gambas-devel" > > Sent: Friday, 20 February, 2009 3:32:01 AM GMT +00:00 GMT Britain, > > Ireland, Portugal Subject: [Gambas-devel] v4l2 patch for gb.v4l > > > > Hello. > > attached is a patch I wrote for a customer who needs support for a v4l2 > > webcam (it's a Logitech QuickCam 9000 Pro) in gambas. > > The patch integrates the example code from v4l2 api documentation > > (http://v4l2spec.bytesex.org/spec/capture-example.html) in a way that > > should be backwards compatibile (v4l1). The patch is at a basic and ugly > > level and only supports YUYV to BGR24 pixel format conversion (the > > function is taken from libv4l though the library could be used for most > > pixel formats support), but with some work it might be of wider interest > > so I'm posting it here. > > > > Silvan > > > > -- > > mambaSoft di Calarco Silvan > > Web: http://www.mambasoft.it > > > > mambaSoft Store @ http://shop.mambasoft.it > > openmamba GNU/Linux development @ http://www.openmamba.org > > > > ------------------------------------------------------------------------- > >-- --- Open Source Business Conference (OSBC), March 24-25, 2009, San > > Francisco, CA -OSBC tackles the biggest issue in open source: Open > > Sourcing the Enterprise -Strategies to boost innovation and cut costs > > with open source participation -Receive a $600 discount off the > > registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H > > _______________________________________________ > > Gambas-devel mailing list > > Gambas-devel at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-devel > > -- > mambaSoft di Calarco Silvan > Web: http://www.mambasoft.it > ? > mambaSoft Store @ http://shop.mambasoft.it > openmamba GNU/Linux development @ http://www.openmamba.org > > --------------------------------------------------------------------------- >--- Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing > the Enterprise -Strategies to boost innovation and cut costs with open > source participation -Receive a $600 discount off the registration fee with > the source code: SFAD http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel -- mambaSoft di Calarco Silvan Web: http://www.mambasoft.it mambaSoft Store @ http://shop.mambasoft.it openmamba GNU/Linux development @ http://www.openmamba.org ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From ronstk at ...124... Fri Feb 20 18:17:58 2009 From: ronstk at ...124... (Ron_1st) Date: Fri, 20 Feb 2009 18:17:58 +0100 Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <3827437.478591235127007826.JavaMail.root@...616...> References: <3827437.478591235127007826.JavaMail.root@...616...> Message-ID: <200902201817.58739.ronstk@...124...> On Friday 20 February 2009, Gareth Bult wrote: > >Still the problems with unknown v4l2 formats. > > What is the problem? This is the problem!! switch(format) { case V4L2_PIX_FMT_RGB332: gv4l2_debug("RGB332"); break; case V4L2_PIX_FMT_RGB444: gv4l2_debug("RGB444"); break; case V4L2_PIX_FMT_RGB555: gv4l2_debug("RGB555"); break; case V4L2_PIX_FMT_RGB565: gv4l2_debug("YRGB565"); break; case V4L2_PIX_FMT_RGB555X: gv4l2_debug("YRGB555X");break; case V4L2_PIX_FMT_RGB565X: gv4l2_debug("RGB565X"); break; case V4L2_PIX_FMT_BGR24: gv4l2_debug("BGR24"); break; case V4L2_PIX_FMT_RGB24: gv4l2_debug("RGB24"); break; case V4L2_PIX_FMT_BGR32: gv4l2_debug("BGR32"); break; case V4L2_PIX_FMT_RGB32: /* DEFAULT - NO CONV */ break; case V4L2_PIX_FMT_GREY: gv4l2_debug("GREY"); break; case V4L2_PIX_FMT_Y16: gv4l2_debug("Y16"); break; <--- not in all videodev.h case V4L2_PIX_FMT_PAL8: gv4l2_debug("PAL8"); break; case V4L2_PIX_FMT_YVU410: gv4l2_debug("YVU410"); break; case V4L2_PIX_FMT_YVU420: gv4l2_debug("YVU420"); break; case V4L2_PIX_FMT_YUV420: //gv4l2_debug("YUV420"); yuv420p_to_rgb (start,THIS->frame,w,h,3); return; case V4L2_PIX_FMT_YUYV: //gv4l2_debug("YUYV"); convert_yuv_to_rgb_buffer(start,THIS->frame,w,h); return; case V4L2_PIX_FMT_UYVY: gv4l2_debug("UYVY"); break; case V4L2_PIX_FMT_YUV422P: gv4l2_debug("YUV422P"); break; case V4L2_PIX_FMT_YUV411P: gv4l2_debug("YUV411P"); break; case V4L2_PIX_FMT_Y41P: gv4l2_debug("Y41P"); break; case V4L2_PIX_FMT_YUV444: gv4l2_debug("YUV444"); break; case V4L2_PIX_FMT_YUV555: gv4l2_debug("YUV555"); break; case V4L2_PIX_FMT_YUV565: gv4l2_debug("YUV565"); break; case V4L2_PIX_FMT_YUV32: gv4l2_debug("YUV32"); break; case V4L2_PIX_FMT_NV12: gv4l2_debug("NV12"); break; case V4L2_PIX_FMT_NV21: gv4l2_debug("NV21"); break; case V4L2_PIX_FMT_YUV410: gv4l2_debug("YUV410"); break; case V4L2_PIX_FMT_YYUV: gv4l2_debug("YYUV"); break; case V4L2_PIX_FMT_HI240: gv4l2_debug("HI240"); break; case V4L2_PIX_FMT_HM12: gv4l2_debug("HM12"); break; case V4L2_PIX_FMT_SBGGR8: gv4l2_debug("SBGGR8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SGBRG8: gv4l2_debug("SBGRG8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SBGGR16: gv4l2_debug("SBGGR16"); break; <--- not in all videodev.h case V4L2_PIX_FMT_MJPEG: gv4l2_debug("MJPEG"); break; case V4L2_PIX_FMT_JPEG: gv4l2_debug("JPEG"); break; case V4L2_PIX_FMT_DV: gv4l2_debug("DV"); break; case V4L2_PIX_FMT_MPEG: gv4l2_debug("MPEG"); break; case V4L2_PIX_FMT_WNVA: gv4l2_debug("WNVA"); break; case V4L2_PIX_FMT_SN9C10X: gv4l2_debug("SN9C10X"); break; <--- not in all videodev.h case V4L2_PIX_FMT_PWC1: gv4l2_debug("PWC1"); break; case V4L2_PIX_FMT_PWC2: gv4l2_debug("PWC2"); break; case V4L2_PIX_FMT_ET61X251: gv4l2_debug("ET61X251");break; case V4L2_PIX_FMT_SPCA501: gv4l2_debug("SPCA501"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SPCA505: gv4l2_debug("SPCA505"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SPCA508: gv4l2_debug("SPCA508"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SPCA561: gv4l2_debug("SPCA561"); break; <--- not in all videodev.h case V4L2_PIX_FMT_PAC207: gv4l2_debug("PAC207"); break; case V4L2_PIX_FMT_PJPG: gv4l2_debug("PJPG"); break; case V4L2_PIX_FMT_YVYU: gv4l2_debug("YVYU"); break; default: gv4l2_debug("Frame in unknown format"); break; } memcpy(THIS->frame,start,size); } To make those formats available for your switch() you put _your_ videodev.h as videodev2.h in the gambas component instead of the gv4l2.h where it belongs IMHO or gv4l2.c code. > > >The include for the inserted videodev.h should be in the C source that needs it, > >not the gambas component that uses the C code generated object. > > Feel free to modify the location of the "#include" if you think it could be better placed (!) > > >This way the gambas commponent can't replaced by some other component code > >because the .c is more or less corrupt IMHO. > > The v4l2 code is in gv4l2.c , Yes and related *.h files should they not be included in the gv4l2.h file when values or anything else from videodev(2).h is used in gv4l2 and not in code that depends on the ressult of gbv4l2, or do I miss something? To be able to compile gbv4l2 I do not need CWebCam component? > the code is CWebCam.* is pre-existing code that was modified to cope with v4l2. Yes I know and appriciate your work/time spend you did with it. > I have commented a couple of times that it would be nice to re-factor all the v4l code out into (for example) gv4l.c and leave CWebCam.c purely as a Gambas component container rather than something that contains v4l[2] specific code. Good idea but why include a *.h file you need in v4l2 code in the component where it is never is used? Does not sound logic for me. > > Please can you specify whether your problem is with gv4l2.c, in which case I can look at "uncorrupting" it .. or with "CWebCam.*" in which case I need some agreement before I completely rip apart someone else's code. I do not have problems in the CWebCam code, its more or less perfect. > > >The best would be not to check fantasy formats not supported and > >tell the value used in the case into the error message. > > Yes, I know, I have a habit of inventing completely non-existent video formats all on my own(!) > Not! You did missunderstand this. I do not say _you_ create the fantasy formats. The fancy formats are the not actual supported formats but are in your videodev.h as i.e. the V4L2_PIX_FMT_SPCA501, V4L2_PIX_FMT_SPCA505 and V4L2_PIX_FMT_SPCA508 The are put by the ubuntu8.10 team and not the ubunto8.04 or suse team. If you did support these formats I could understand you did add them. > > We have three choices as I see it; > a. Support the author's camera only, as with the pre-existing v4l code > b. Support all camera's on the V4L2 spec > c. Support all camera's that Linux supports (which is a super-set of (b) > > I have opted for (c), I agree This is good > you are telling me this is wrong No I do not!! But be carefull not all distributions support more then the V4L2 spec. > - I'm open to comments, however as a Linux user, IMHO (c) is a better option. Yes but a side note is as "ubuntu8.10 linux" user. Other users using ubuntu8.04 LTS does just that because the LongTermSupport. > All the video formats listed in the code exist as far as the Linux kernel is concerned. Technically we could have some #ifdef's in the source to look at the kernel version at compile time .. however given the videodev2.h file should be backwards compatible, including it in SVN does make a certain degree of sense. Another alternative would be to remove videodev2.h from SVN and get developers to upgrade to current kernel releases (!) > > >tell the value used in the case into the error message. > > This is strange, you've obviously looked at the code... you will see in gv4l2_process_image some code that looks like this; Yes I did :) > > switch(format) > { > case V4L2_PIX_FMT_RGB332: gv4l2_debug("RGB332"); break; > case V4L2_PIX_FMT_RGB444: gv4l2_debug("RGB444"); break; > ... and these case V4L2_PIX_FMT_SBGGR8: gv4l2_debug("SBGGR8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SGBRG8: gv4l2_debug("SBGRG8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SBGGR16: gv4l2_debug("SBGGR16"); break; <--- not in all videodev.h > > and a routine that looks like this; > > void gv4l2_debug( char *s ) > { > if( ! gv4l2_debug_mode ) return; > printf("gambas v4l2: %s [%d]\n",s,errno); > fflush(stdout); > } Good but does not work here in all cases. > > So assuming you have debug turned on .. it "should" tell you what format the camera is supplying if it can't handle it ... > Feel free to enhance the text of the message if you wish .. does this not work for you ? > The point is "case V4L2_PIX_FMT_SBGGR8:" is tested by the compiler before "gv4l2_debug("SBGGR8"); break;" It is the case where the error occurs not the code to run if the case matches, that is proven by the existing formats declared in videodev.h file. (I assume the compiler checks the whole line and find undeclared value for the case and trigger the error before the real translating to object(assembly) code.) You do only support: case V4L2_PIX_FMT_YUV420: //gv4l2_debug("YUV420"); yuv420p_to_rgb (start,THIS->frame,w,h,3); return; case V4L2_PIX_FMT_YUYV: //gv4l2_debug("YUYV"); convert_yuv_to_rgb_buffer(start,THIS->frame,w,h); return; default: gv4l2_debug("Frame in unknown format"); break; My suggestion is simple switch(format) { case V4L2_PIX_FMT_YUV420: //gv4l2_debug("YUV420"); yuv420p_to_rgb (start,THIS->frame,w,h,3); return; case V4L2_PIX_FMT_YUYV: //gv4l2_debug("YUYV"); convert_yuv_to_rgb_buffer(start,THIS->frame,w,h); return; default: gv4l2_debug("Frame in unknown format" & format); /* concat the string with the format used in switch() */ break; } This wil do the same as you do now for the unsupported formats. The formats that are not supported in videodev.h (old or new versions) do not raise compile time errors. Proof CWebcam is OK is given by the fact that remove or remark the lines with unknown case values do not give compile errors. I do understand you did include all formats in the case for testing and may be as hints to support these formats in future but now these case lines are active with wrong values on some other boxes (distribution(versions)) as yours. switch (car) { case car_opel : print "opel" :break case car_ford : print "ford" :break case Car_honda : paint_the_car_blue(honda) :return; case car_bently : print "bently" break default print "unknown car" break; } What does happen if car_ford is not definied in the .h file? Here the compiler gives a valid error no matter what should be done as print or paint. IMHO gv4l2.c should compile without CWebCam and then gv4l2.c it need the reference to videodev(2).h And now I want to drop CWebCam and go greate CWebCam3 CWebCam3 only need gbv4l2. The way your videodev2.h is included now force me to include CWebCam and this result in conflicting functions. double declared. BTW the only correct videodev.h should be the one supplied by the distribution. If you _did_ support the extra formats in your version I can understand when you a include 'private'(ubuntu8.10) version, but just those extra formats are not supported. The intention was just a friendly question to correct the include place and a suggestion to prevent compile time errors. If you think it is a attack from me? Not! I know I can learn a lot from Benoit and yes also from you but here I think I'm not totaly wrong. I hope Benoit will take a look if I'm possible wrong. > Gareth. > Best regards, Ron_1st -- P.S. Flash supports only v4l and not v4l2 cams ATM :( I need and have a v4l2 to v4l converter to get my v4l2 devices working. Convertor is Flashcam with vloopback as support. From gareth at ...623... Fri Feb 20 19:20:03 2009 From: gareth at ...623... (Gareth Bult) Date: Fri, 20 Feb 2009 18:20:03 +0000 (GMT) Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <1769903.480991235153930595.JavaMail.root@...616...> Message-ID: <24671477.481011235154003881.JavaMail.root@...616...> >To make those formats available for your switch() you put _your_ videodev.h as >videodev2.h in the gambas component instead of the gv4l2.h where it belongs IMHO >or gv4l2.c code. Ok, I do hope you're joking ?! (a) it's not "my" videodev.h, it's a copy from the current Linux source tree (b) kernel headers belong in /usr/include/linux/* Are you seriously suggesting I hard-code kernel #define's into Gambas ?? >To be able to compile gbv4l2 I do not need CWebCam component? Please read my earlier posts. The code was written to work "with" the v4l code. I would "like" to re-factor all the v4l code and split it down as you describe. Until this happens, the v4l2 code must share the v4l code's structures, which is why it is the way it is. It is true that there are some function headers in CWebcam.h which could be moved to gv4l2.h, but the real issue is the CWEBCAM structure. >Good idea but why include a *.h file you need in v4l2 code in the component where it is never is used? >Does not sound logic for me. I don't follow ?? >I do not have problems in the CWebCam code, its more or less perfect. Mmm, sure. >The are put by the ubuntu8.10 team and not the ubunto8.04 or suse team. Are you telling me that these formats have been inserted into the Ubuntu 8.10 version of the kernel source tree and are not a standard part of the Linux Kernel ? .. as opposed them having been added to the kernel more recently than the kernel distributed with Ubuntu 8.04 ? >Yes but a side note is as "ubuntu8.10 linux" user. >Other users using ubuntu8.04 LTS does just that because the LongTermSupport. Having additional options in the switch statement is going to have Zero effect on Ubuntu 8.04 users. *not* having them is going to mean users of more recent kernels will have cameras fail silently. -- nothing worse than dealing with a user who says "it's not working - don't know why - no error messages!" -- > case V4L2_PIX_FMT_SBGGR8: gv4l2_debug("SBGGR8"); break; <--- not in all videodev.h But it IS In videodev2.h which IS in the current SVN tree and it has been for a while. Are you telling me you have the current SVN and it's failing to compile as a result of this ?? >My suggestion is simple Yes, this is fine, it just means someone then has to go digging through a header file to try to work out the actual format - which is encoded. It seemed easier to print out the code so the user could actually report the problem and someone could see immediately which format was being used. To be honest, if someone reported a binary format to me - I probably wouldn't look. (which is why I put the code in) >switch (car) >{ I little patronising - I've been coding in 'C' for about 25 years, I do know how a switch statement works (!) Had this been written from scratch not having to work / integrate with existing code, it would look a little different. All I can say is - if you don't like it, feel free to change it. The "best" solution would be to use #ifdef's on the V4L_PIX_FMT_**** 's that are not in your header file. As I don't know specifically which ones you don't have, nor do I have am 8.04 system to test any changes on, you would be better placed to make the changes. Once the offending formats are ifdef'd , you can safely remove videodev2.h from SVN and things should compile smoothly. i.e; #ifdef V4L2_PIX_FMT_SBGGR8 case V4L2_PIX_FMT_SBGGR8: gv4l2_debug("SBGGR8"); break; #endif Would you care to have a crack at this ? Gareth. ----- Original Message ----- From: "Ron_1st" To: "mailing list for gambas developers" Sent: Friday, 20 February, 2009 5:17:58 PM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] v4l2 patch for gb.v4l On Friday 20 February 2009, Gareth Bult wrote: > >Still the problems with unknown v4l2 formats. > > What is the problem? This is the problem!! switch(format) { case V4L2_PIX_FMT_RGB332: gv4l2_debug("RGB332"); break; case V4L2_PIX_FMT_RGB444: gv4l2_debug("RGB444"); break; case V4L2_PIX_FMT_RGB555: gv4l2_debug("RGB555"); break; case V4L2_PIX_FMT_RGB565: gv4l2_debug("YRGB565"); break; case V4L2_PIX_FMT_RGB555X: gv4l2_debug("YRGB555X");break; case V4L2_PIX_FMT_RGB565X: gv4l2_debug("RGB565X"); break; case V4L2_PIX_FMT_BGR24: gv4l2_debug("BGR24"); break; case V4L2_PIX_FMT_RGB24: gv4l2_debug("RGB24"); break; case V4L2_PIX_FMT_BGR32: gv4l2_debug("BGR32"); break; case V4L2_PIX_FMT_RGB32: /* DEFAULT - NO CONV */ break; case V4L2_PIX_FMT_GREY: gv4l2_debug("GREY"); break; case V4L2_PIX_FMT_Y16: gv4l2_debug("Y16"); break; <--- not in all videodev.h case V4L2_PIX_FMT_PAL8: gv4l2_debug("PAL8"); break; case V4L2_PIX_FMT_YVU410: gv4l2_debug("YVU410"); break; case V4L2_PIX_FMT_YVU420: gv4l2_debug("YVU420"); break; case V4L2_PIX_FMT_YUV420: //gv4l2_debug("YUV420"); yuv420p_to_rgb (start,THIS->frame,w,h,3); return; case V4L2_PIX_FMT_YUYV: //gv4l2_debug("YUYV"); convert_yuv_to_rgb_buffer(start,THIS->frame,w,h); return; case V4L2_PIX_FMT_UYVY: gv4l2_debug("UYVY"); break; case V4L2_PIX_FMT_YUV422P: gv4l2_debug("YUV422P"); break; case V4L2_PIX_FMT_YUV411P: gv4l2_debug("YUV411P"); break; case V4L2_PIX_FMT_Y41P: gv4l2_debug("Y41P"); break; case V4L2_PIX_FMT_YUV444: gv4l2_debug("YUV444"); break; case V4L2_PIX_FMT_YUV555: gv4l2_debug("YUV555"); break; case V4L2_PIX_FMT_YUV565: gv4l2_debug("YUV565"); break; case V4L2_PIX_FMT_YUV32: gv4l2_debug("YUV32"); break; case V4L2_PIX_FMT_NV12: gv4l2_debug("NV12"); break; case V4L2_PIX_FMT_NV21: gv4l2_debug("NV21"); break; case V4L2_PIX_FMT_YUV410: gv4l2_debug("YUV410"); break; case V4L2_PIX_FMT_YYUV: gv4l2_debug("YYUV"); break; case V4L2_PIX_FMT_HI240: gv4l2_debug("HI240"); break; case V4L2_PIX_FMT_HM12: gv4l2_debug("HM12"); break; case V4L2_PIX_FMT_SBGGR8: gv4l2_debug("SBGGR8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SGBRG8: gv4l2_debug("SBGRG8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SBGGR16: gv4l2_debug("SBGGR16"); break; <--- not in all videodev.h case V4L2_PIX_FMT_MJPEG: gv4l2_debug("MJPEG"); break; case V4L2_PIX_FMT_JPEG: gv4l2_debug("JPEG"); break; case V4L2_PIX_FMT_DV: gv4l2_debug("DV"); break; case V4L2_PIX_FMT_MPEG: gv4l2_debug("MPEG"); break; case V4L2_PIX_FMT_WNVA: gv4l2_debug("WNVA"); break; case V4L2_PIX_FMT_SN9C10X: gv4l2_debug("SN9C10X"); break; <--- not in all videodev.h case V4L2_PIX_FMT_PWC1: gv4l2_debug("PWC1"); break; case V4L2_PIX_FMT_PWC2: gv4l2_debug("PWC2"); break; case V4L2_PIX_FMT_ET61X251: gv4l2_debug("ET61X251");break; case V4L2_PIX_FMT_SPCA501: gv4l2_debug("SPCA501"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SPCA505: gv4l2_debug("SPCA505"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SPCA508: gv4l2_debug("SPCA508"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SPCA561: gv4l2_debug("SPCA561"); break; <--- not in all videodev.h case V4L2_PIX_FMT_PAC207: gv4l2_debug("PAC207"); break; case V4L2_PIX_FMT_PJPG: gv4l2_debug("PJPG"); break; case V4L2_PIX_FMT_YVYU: gv4l2_debug("YVYU"); break; default: gv4l2_debug("Frame in unknown format"); break; } memcpy(THIS->frame,start,size); } To make those formats available for your switch() you put _your_ videodev.h as videodev2.h in the gambas component instead of the gv4l2.h where it belongs IMHO or gv4l2.c code. > > >The include for the inserted videodev.h should be in the C source that needs it, > >not the gambas component that uses the C code generated object. > > Feel free to modify the location of the "#include" if you think it could be better placed (!) > > >This way the gambas commponent can't replaced by some other component code > >because the .c is more or less corrupt IMHO. > > The v4l2 code is in gv4l2.c , Yes and related *.h files should they not be included in the gv4l2.h file when values or anything else from videodev(2).h is used in gv4l2 and not in code that depends on the ressult of gbv4l2, or do I miss something? To be able to compile gbv4l2 I do not need CWebCam component? > the code is CWebCam.* is pre-existing code that was modified to cope with v4l2. Yes I know and appriciate your work/time spend you did with it. > I have commented a couple of times that it would be nice to re-factor all the v4l code out into (for example) gv4l.c and leave CWebCam.c purely as a Gambas component container rather than something that contains v4l[2] specific code. Good idea but why include a *.h file you need in v4l2 code in the component where it is never is used? Does not sound logic for me. > > Please can you specify whether your problem is with gv4l2.c, in which case I can look at "uncorrupting" it .. or with "CWebCam.*" in which case I need some agreement before I completely rip apart someone else's code. I do not have problems in the CWebCam code, its more or less perfect. > > >The best would be not to check fantasy formats not supported and > >tell the value used in the case into the error message. > > Yes, I know, I have a habit of inventing completely non-existent video formats all on my own(!) > Not! You did missunderstand this. I do not say _you_ create the fantasy formats. The fancy formats are the not actual supported formats but are in your videodev.h as i.e. the V4L2_PIX_FMT_SPCA501, V4L2_PIX_FMT_SPCA505 and V4L2_PIX_FMT_SPCA508 The are put by the ubuntu8.10 team and not the ubunto8.04 or suse team. If you did support these formats I could understand you did add them. > > We have three choices as I see it; > a. Support the author's camera only, as with the pre-existing v4l code > b. Support all camera's on the V4L2 spec > c. Support all camera's that Linux supports (which is a super-set of (b) > > I have opted for (c), I agree This is good > you are telling me this is wrong No I do not!! But be carefull not all distributions support more then the V4L2 spec. > - I'm open to comments, however as a Linux user, IMHO (c) is a better option. Yes but a side note is as "ubuntu8.10 linux" user. Other users using ubuntu8.04 LTS does just that because the LongTermSupport. > All the video formats listed in the code exist as far as the Linux kernel is concerned. Technically we could have some #ifdef's in the source to look at the kernel version at compile time .. however given the videodev2.h file should be backwards compatible, including it in SVN does make a certain degree of sense. Another alternative would be to remove videodev2.h from SVN and get developers to upgrade to current kernel releases (!) > > >tell the value used in the case into the error message. > > This is strange, you've obviously looked at the code... you will see in gv4l2_process_image some code that looks like this; Yes I did :) > > switch(format) > { > case V4L2_PIX_FMT_RGB332: gv4l2_debug("RGB332"); break; > case V4L2_PIX_FMT_RGB444: gv4l2_debug("RGB444"); break; > ... and these case V4L2_PIX_FMT_SBGGR8: gv4l2_debug("SBGGR8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SGBRG8: gv4l2_debug("SBGRG8"); break; <--- not in all videodev.h case V4L2_PIX_FMT_SBGGR16: gv4l2_debug("SBGGR16"); break; <--- not in all videodev.h > > and a routine that looks like this; > > void gv4l2_debug( char *s ) > { > if( ! gv4l2_debug_mode ) return; > printf("gambas v4l2: %s [%d]\n",s,errno); > fflush(stdout); > } Good but does not work here in all cases. > > So assuming you have debug turned on .. it "should" tell you what format the camera is supplying if it can't handle it ... > Feel free to enhance the text of the message if you wish .. does this not work for you ? > The point is "case V4L2_PIX_FMT_SBGGR8:" is tested by the compiler before "gv4l2_debug("SBGGR8"); break;" It is the case where the error occurs not the code to run if the case matches, that is proven by the existing formats declared in videodev.h file. (I assume the compiler checks the whole line and find undeclared value for the case and trigger the error before the real translating to object(assembly) code.) You do only support: case V4L2_PIX_FMT_YUV420: //gv4l2_debug("YUV420"); yuv420p_to_rgb (start,THIS->frame,w,h,3); return; case V4L2_PIX_FMT_YUYV: //gv4l2_debug("YUYV"); convert_yuv_to_rgb_buffer(start,THIS->frame,w,h); return; default: gv4l2_debug("Frame in unknown format"); break; My suggestion is simple switch(format) { case V4L2_PIX_FMT_YUV420: //gv4l2_debug("YUV420"); yuv420p_to_rgb (start,THIS->frame,w,h,3); return; case V4L2_PIX_FMT_YUYV: //gv4l2_debug("YUYV"); convert_yuv_to_rgb_buffer(start,THIS->frame,w,h); return; default: gv4l2_debug("Frame in unknown format" & format); /* concat the string with the format used in switch() */ break; } This wil do the same as you do now for the unsupported formats. The formats that are not supported in videodev.h (old or new versions) do not raise compile time errors. Proof CWebcam is OK is given by the fact that remove or remark the lines with unknown case values do not give compile errors. I do understand you did include all formats in the case for testing and may be as hints to support these formats in future but now these case lines are active with wrong values on some other boxes (distribution(versions)) as yours. switch (car) { case car_opel : print "opel" :break case car_ford : print "ford" :break case Car_honda : paint_the_car_blue(honda) :return; case car_bently : print "bently" break default print "unknown car" break; } What does happen if car_ford is not definied in the .h file? Here the compiler gives a valid error no matter what should be done as print or paint. IMHO gv4l2.c should compile without CWebCam and then gv4l2.c it need the reference to videodev(2).h And now I want to drop CWebCam and go greate CWebCam3 CWebCam3 only need gbv4l2. The way your videodev2.h is included now force me to include CWebCam and this result in conflicting functions. double declared. BTW the only correct videodev.h should be the one supplied by the distribution. If you _did_ support the extra formats in your version I can understand when you a include 'private'(ubuntu8.10) version, but just those extra formats are not supported. The intention was just a friendly question to correct the include place and a suggestion to prevent compile time errors. If you think it is a attack from me? Not! I know I can learn a lot from Benoit and yes also from you but here I think I'm not totaly wrong. I hope Benoit will take a look if I'm possible wrong. > Gareth. > Best regards, Ron_1st -- P.S. Flash supports only v4l and not v4l2 cams ATM :( I need and have a v4l2 to v4l converter to get my v4l2 devices working. Convertor is Flashcam with vloopback as support. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From gambas at ...1... Fri Feb 20 23:27:29 2009 From: gambas at ...1... (=?iso-8859-1?q?Beno=EEt_Minisini?=) Date: Fri, 20 Feb 2009 23:27:29 +0100 Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <8841705.478881235129864077.JavaMail.root@...616...> References: <8841705.478881235129864077.JavaMail.root@...616...> Message-ID: <200902202327.30103.gambas@...1...> > Hi, > > IMHO the v4l code in G2 won't actually work on many cameras, I would > consider it more of a "demo" than the finished article .. certainly the > Logitec camera's I've bought recently "all" only work on v4l2. (I only have > one camera for V4l testing which is ~ 5 years old) > > If the patch works on G2, great, however v4l->v4l2 is significant and the > chances of it introducing "issues" into what should be the "release" code > might be "high". > > I recall we did have a number of issues relating to memory leaks while > getting this code going - I don't know how many of these were down to G3 > development and how many were exposed / inherent issues .. > > (if v4l2 is required in G2, it "might" be a better idea to back-port the > new v4l2 code ??) > > Gareth. > The memory leaks were just bugs in the new gb.image component. They should all be gone now. I think the better way of dealing with v4l is using the libv4l library Silvan talked about: http://hansdegoede.livejournal.com/3636.html. This library seems to be able to use v4l1 and v4l2 indifferently: it provides a v4l1-like API to v4l2 device, so you can use the same code for both. You have an API for v4l2- only devices too, and a library that converts between different device image formats. What do you think about that? -- Beno?t From gareth at ...623... Sat Feb 21 05:09:55 2009 From: gareth at ...623... (Gareth Bult) Date: Sat, 21 Feb 2009 04:09:55 +0000 (GMT) Subject: [Gambas-devel] v4l2 patch for gb.v4l In-Reply-To: <30431794.482221235189193467.JavaMail.root@...616...> Message-ID: <27433576.482241235189395639.JavaMail.root@...616...> .. In principle it sounds great .. .. If the implementation does what it says on the tin it would certainly simplify things .. Pro's: If the library is going to be actively developed and maintained, then effectively the hard work is being handed off to another developer who seems to have a particular interest in v4l?. Assuming the library does what the spec says, all formats will already be handled and issues such as reporting unhandled formats simply goes away. Con's: I would "guess" that it will mean rewriting the current v4l code from scratch. I very much doubt it will be a plug and play with the current code. (albeit most of the re-write will involve removing redundant code) The library "may" contain bugs / leaks which are not currently present. .. I guess it comes down to the quality of the library and whether someone has the time to evaluate it and re-write the module again, but in principle it would be a great idea. As with all things re-using someone else's code always a good head start .. I've recently started to use qdbm and thought it was fantastic .. only to find it's been replace by "tokyo cabinet", which looks to be even better (!) Knowing which libraries are available and which are the best to use always seems to be a major part of the problem .. :( Gareth. ----- Original Message ----- From: "Beno?t Minisini" To: "mailing list for gambas developers" Sent: Friday, 20 February, 2009 10:27:29 PM GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [Gambas-devel] v4l2 patch for gb.v4l > Hi, > > IMHO the v4l code in G2 won't actually work on many cameras, I would > consider it more of a "demo" than the finished article .. certainly the > Logitec camera's I've bought recently "all" only work on v4l2. (I only have > one camera for V4l testing which is ~ 5 years old) > > If the patch works on G2, great, however v4l->v4l2 is significant and the > chances of it introducing "issues" into what should be the "release" code > might be "high". > > I recall we did have a number of issues relating to memory leaks while > getting this code going - I don't know how many of these were down to G3 > development and how many were exposed / inherent issues .. > > (if v4l2 is required in G2, it "might" be a better idea to back-port the > new v4l2 code ??) > > Gareth. > The memory leaks were just bugs in the new gb.image component. They should all be gone now. I think the better way of dealing with v4l is using the libv4l library Silvan talked about: http://hansdegoede.livejournal.com/3636.html. This library seems to be able to use v4l1 and v4l2 indifferently: it provides a v4l1-like API to v4l2 device, so you can use the same code for both. You have an API for v4l2- only devices too, and a library that converts between different device image formats. What do you think about that? -- Beno?t ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-devel mailing list Gambas-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Gareth Bult (Gareth at ...624...) From ronstk at ...124... Sun Feb 22 17:51:14 2009 From: ronstk at ...124... (Ron_1st) Date: Sun, 22 Feb 2009 17:51:14 +0100 Subject: [Gambas-devel] gb.v4l rework the gv4l2.c Message-ID: <200902221751.15124.ronstk@...124...> Garret wrote: > > >switch (car) > >{ > > I little patronising - I've been coding in 'C' for about 25 years, I do know how a switch statement works (!) I did not add the car example to explain how switch statement works. You miss the point and now I know you don't know how it works. Just add next line between the other case lines. ????????case GARRET_25Y_PROGRAMMER : ???gv4l2_debug("InowHowItWorks"); ?break; What happens on the case line where a constant is given ?and is unknown? ????????case V4L2_PIX_FMT_SBGGR8: ??????gv4l2_debug("SBGGR8"); ?break; ? ?<--- not in all videodev.h The compiler thinks "What the f***k does he mean with GARRET_25Y_PROGRAMMER" ??? Followed by undeclared value GARRET_25Y_PROGRAMMER and trow a error and start play with his.... The part after the : (colon) will never be executed in runtime. Even if you give compiler flags to continue during compile time. if posible, as MS does, then in runtime the value of GARRET_25Y_PROGRAMMER" is still unknown and an error, halt or crash happens. Or when you are lucky it walk all those bad cases and may be use the case default: Your current says ????????default: ????????????????gv4l2_debug("Frame in unknown format"); ????????????????break; I prefer "Frame in unknown format. Found 0x1234" more then "Frame in unknown format" anyway. Now I have something to search for. The real error: ? gv4l2.c:588: error: 'V4L2_PIX_FMT_Y16' undeclared (first use in this function) ? make[4]: *** [gv4l2.lo] Error 1 and here the compile stops on my box. > > Had this been written from scratch not having to work / integrate with existing code, it would look a little different. As I told before I apriciate your work done, realy no kidding. I do understand having some basic working code is a easy then from scratch. > All I can say is - if you don't like it, feel free to change it. Yeah I know. Forgive me I did try to help your development from scratch by giving a small bug report and a possible solution for you to investigate for usefull idea. > > The "best" solution would be to use #ifdef's on the V4L_PIX_FMT_**** 's that are not in your header file. > As I don't know specifically which ones you don't have, nor do I have am 8.04 system to test any changes > on, you would be better placed to make the changes. > Once the offending formats are ifdef'd , you can safely remove videodev2.h from SVN and things should > compile smoothly. ? > > i.e; > > #ifdef V4L2_PIX_FMT_SBGGR8 > ??????????????case V4L2_PIX_FMT_SBGGR8: ??????gv4l2_debug("SBGGR8"); ?break; > #endif Done see below. > Would you care to have a crack at this ? > > Gareth. Oh and little patronising? A 33 year programming learning time in Assembly for 4040 8080 8085 Z80 8031 8048 6502 INS8060 with macro's, includes, MCS80 PL/M , CP/M, ZCPR and working on equipment to make it possible for you to start learn C does not count :) I know I still can learn from everyone, even a script kiddy with a age of 12, so you can. So 25 year or 33 years do not say anything, I don't care about it. Read next link special the end. http://devexpress.com/Support/Center/p/Q180012.aspx ================================================================= I did add #ifdef #endif around the missing pixel_formats. #ifdef V4L2_PIX_FMT_SBGGR8 ??case V4L2_PIX_FMT_SBGGR8: ??????gv4l2_debug("SBGGR8"); ?break; #endif I add to the default case message the format number. default: gv4l2_debug("Frame in unknown format. Format:0x" + format); break; It is save to remark/remove the added include in CWebcam.h now The added file in gb.v4l/src/videodev2.h can stay but is not used. Best regards, Ron_1st -- A: Delete the text you reply on. Q: What to do to get my post on top? --- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --- A: Top-posting. Q: What is the most annoying thing in e-mail? From ronstk at ...124... Sun Feb 22 17:53:44 2009 From: ronstk at ...124... (Ron_1st) Date: Sun, 22 Feb 2009 17:53:44 +0100 Subject: [Gambas-devel] gb.v4l rework the gv4l2.c In-Reply-To: <200902221751.15124.ronstk@...124...> References: <200902221751.15124.ronstk@...124...> Message-ID: <200902221753.45126.ronstk@...124...> On Sunday 22 February 2009, Ron_1st wrote: ----8<--- forgotten attachment to add > > Best regards, > > Ron_1st > Best regards, Ron_1st -- A: Delete the text you reply on. Q: What to do to get my post on top? --- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --- A: Top-posting. Q: What is the most annoying thing in e-mail? -------------- next part -------------- A non-text attachment was scrubbed... Name: gv4l2.c.zip Type: application/x-zip Size: 6025 bytes Desc: not available URL: