summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/camera/cmd/capture.cpp3
-rw-r--r--noncore/multimedia/camera/gui/mainwindow.cpp2
-rw-r--r--noncore/multimedia/camera/lib/avi.c1
3 files changed, 5 insertions, 1 deletions
diff --git a/noncore/multimedia/camera/cmd/capture.cpp b/noncore/multimedia/camera/cmd/capture.cpp
index 688622b..6b8c63c 100644
--- a/noncore/multimedia/camera/cmd/capture.cpp
+++ b/noncore/multimedia/camera/cmd/capture.cpp
@@ -174,19 +174,22 @@ int main( int argc, char** argv )
174 default: usage(); return -1; 174 default: usage(); return -1;
175 } 175 }
176 i++; 176 i++;
177 } 177 }
178 178
179 #undef I_HATE_WRITING_HARDCODED_PARSES 179 #undef I_HATE_WRITING_HARDCODED_PARSES
180 } 180 }
181 181
182 if ( !ZCameraIO::instance()->isOpen() ) 182 if ( !ZCameraIO::instance()->isOpen() )
183 { 183 {
184 printf( "Error: Can't detect your camera. Exiting.\n" ); 184 printf( "Error: Can't detect your camera. Exiting.\n" );
185 return -1; 185 return -1;
186 } 186 }
187 187
188 c->checkSettings(); 188 c->checkSettings();
189 c->capture(); 189 c->capture();
190
191 delete c;
192 delete a;
190 return 0; 193 return 0;
191} 194}
192 195
diff --git a/noncore/multimedia/camera/gui/mainwindow.cpp b/noncore/multimedia/camera/gui/mainwindow.cpp
index 7f2a9bd..bde448d 100644
--- a/noncore/multimedia/camera/gui/mainwindow.cpp
+++ b/noncore/multimedia/camera/gui/mainwindow.cpp
@@ -533,33 +533,33 @@ void CameraMainWindow::timerEvent( QTimerEvent* )
533 ZCameraIO::instance()->captureFrame( captureX, captureY, zoom, _capturebuf ); 533 ZCameraIO::instance()->captureFrame( captureX, captureY, zoom, _capturebuf );
534 _videopics++; 534 _videopics++;
535 ::write( _capturefd, _capturebuf, captureX*captureY*2 ); 535 ::write( _capturefd, _capturebuf, captureX*captureY*2 );
536 setCaption( QString().sprintf( "Capturing %dx%d @ %.2f fps %d", 536 setCaption( QString().sprintf( "Capturing %dx%d @ %.2f fps %d",
537 captureX, captureY, 1000.0 / (_time.elapsed()/_videopics), _videopics ) ); 537 captureX, captureY, 1000.0 / (_time.elapsed()/_videopics), _videopics ) );
538} 538}
539 539
540 540
541void CameraMainWindow::stopVideoCapture() 541void CameraMainWindow::stopVideoCapture()
542{ 542{
543 killTimers(); 543 killTimers();
544 ODevice::inst()->playTouchSound(); 544 ODevice::inst()->playTouchSound();
545 ODevice::inst()->setLedState( Led_Mail, Led_Off ); 545 ODevice::inst()->setLedState( Led_Mail, Led_Off );
546 _capturing = false; 546 _capturing = false;
547 updateCaption(); 547 updateCaption();
548 ::close( _capturefd ); 548 ::close( _capturefd );
549 _framerate = 1000.0 / (_time.elapsed()/_videopics); 549 _framerate = static_cast<int>( 1000.0 / (_time.elapsed()/_videopics) );
550 550
551 QString name; 551 QString name;
552 if ( outputTo == "Documents Folder" ) 552 if ( outputTo == "Documents Folder" )
553 { 553 {
554 name.sprintf( "%s/Documents/video/%s/", (const char*) QDir::homeDirPath(), (const char*) captureFormat.lower() ); 554 name.sprintf( "%s/Documents/video/%s/", (const char*) QDir::homeDirPath(), (const char*) captureFormat.lower() );
555 if ( !QDir( name ).exists() ) 555 if ( !QDir( name ).exists() )
556 { 556 {
557 odebug << "creating directory " << name << oendl; 557 odebug << "creating directory " << name << oendl;
558 QString msg = "mkdir -p " + name; 558 QString msg = "mkdir -p " + name;
559 system( msg.latin1() ); 559 system( msg.latin1() );
560 } 560 }
561 } 561 }
562 else 562 else
563 name = outputTo; 563 name = outputTo;
564 564
565 name.append( "/" ); // sure is sure and safe is safe ;-) 565 name.append( "/" ); // sure is sure and safe is safe ;-)
diff --git a/noncore/multimedia/camera/lib/avi.c b/noncore/multimedia/camera/lib/avi.c
index 77aba33..d99c016 100644
--- a/noncore/multimedia/camera/lib/avi.c
+++ b/noncore/multimedia/camera/lib/avi.c
@@ -5,32 +5,33 @@
5** This file is part of Opie Environment. 5** This file is part of Opie Environment.
6** 6**
7** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14** 14**
15**********************************************************************/ 15**********************************************************************/
16 16
17#include "avi.h" 17#include "avi.h"
18 18
19#include <string.h> 19#include <string.h>
20#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
21 22
22int nframes; 23int nframes;
23int totalsize; 24int totalsize;
24unsigned int* sizes; 25unsigned int* sizes;
25 26
26void fprint_quartet(int fd, unsigned int i) 27void fprint_quartet(int fd, unsigned int i)
27{ 28{
28 char data[4]; 29 char data[4];
29 30
30 data[0] = (char) i%0x100; 31 data[0] = (char) i%0x100;
31 i /= 0x100; 32 i /= 0x100;
32 data[1] = (char) i%0x100; 33 data[1] = (char) i%0x100;
33 i /= 0x100; 34 i /= 0x100;
34 data[2] = (char) i%0x100; 35 data[2] = (char) i%0x100;
35 i /= 0x100; 36 i /= 0x100;
36 data[3] = (char) i%0x100; 37 data[3] = (char) i%0x100;