-rw-r--r-- | noncore/multimedia/camera/imageio.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/camera/mainwindow.cpp | 46 | ||||
-rw-r--r-- | noncore/multimedia/camera/opie-camera.control | 2 |
3 files changed, 40 insertions, 12 deletions
diff --git a/noncore/multimedia/camera/imageio.cpp b/noncore/multimedia/camera/imageio.cpp index f8f5dd0..ed0d39f 100644 --- a/noncore/multimedia/camera/imageio.cpp +++ b/noncore/multimedia/camera/imageio.cpp | |||
@@ -47,5 +47,5 @@ void imageToFile( QImage* i, const QString& name, const QString& format, int qua | |||
47 | if ( !result ) | 47 | if ( !result ) |
48 | { | 48 | { |
49 | oerr << "imageio-Problem while writing." << oendl; | 49 | oerr << "imageio-Problem while writing to " << name << oendl; |
50 | } | 50 | } |
51 | else | 51 | else |
@@ -53,3 +53,3 @@ void imageToFile( QImage* i, const QString& name, const QString& format, int qua | |||
53 | odebug << format << "-image has been successfully captured" << oendl; | 53 | odebug << format << "-image has been successfully captured" << oendl; |
54 | } | 54 | } |
55 | } \ No newline at end of file | 55 | } |
diff --git a/noncore/multimedia/camera/mainwindow.cpp b/noncore/multimedia/camera/mainwindow.cpp index 16ee8bc..49c7cbf 100644 --- a/noncore/multimedia/camera/mainwindow.cpp +++ b/noncore/multimedia/camera/mainwindow.cpp | |||
@@ -159,7 +159,7 @@ void CameraMainWindow::init() | |||
159 | outputTog = new QActionGroup( 0, "output", true ); | 159 | outputTog = new QActionGroup( 0, "output", true ); |
160 | outputTog->setToggleAction( true ); | 160 | outputTog->setToggleAction( true ); |
161 | new QAction( "/tmp", 0, 0, outputTog, 0, true ); | 161 | new QAction( "/tmp/", 0, 0, outputTog, 0, true ); |
162 | new QAction( "/mnt/card/", 0, 0, outputTog, 0, true ); | 162 | new QAction( "/mnt/card/", 0, 0, outputTog, 0, true ); |
163 | new QAction( "/mnt/sd/", 0, 0, outputTog, 0, true ); | 163 | new QAction( "/mnt/cf/", 0, 0, outputTog, 0, true ); |
164 | docfolder = new QAction( "Documents Folder", 0, 0, outputTog, 0, true ); | 164 | docfolder = new QAction( "Documents Folder", 0, 0, outputTog, 0, true ); |
165 | docfolder->setOn( true ); | 165 | docfolder->setOn( true ); |
@@ -423,5 +423,13 @@ void CameraMainWindow::performCapture( const QString& format ) | |||
423 | 423 | ||
424 | if ( outputTo == "Documents Folder" ) | 424 | if ( outputTo == "Documents Folder" ) |
425 | name.sprintf( "%s/Documents/image/%s/", (const char*) QDir::homeDirPath(), (const char*) captureFormat.lower() ); | 425 | { |
426 | name.sprintf( "%s/Documents/image/%s/", (const char*) QDir::homeDirPath(), (const char*) captureFormat.lower() ); | ||
427 | if ( !QDir( name ).exists() ) | ||
428 | { | ||
429 | odebug << "creating directory " << name << oendl; | ||
430 | QString msg = "mkdir -p " + name; | ||
431 | system( msg.latin1() ); | ||
432 | } | ||
433 | } | ||
426 | else | 434 | else |
427 | name = outputTo; | 435 | name = outputTo; |
@@ -502,6 +510,20 @@ void CameraMainWindow::stopVideoCapture() | |||
502 | _framerate = 1000.0 / (_time.elapsed()/_videopics); | 510 | _framerate = 1000.0 / (_time.elapsed()/_videopics); |
503 | 511 | ||
504 | QString name( outputTo ); | 512 | QString name; |
505 | name.append( "/prefix" ); | 513 | if ( outputTo == "Documents Folder" ) |
514 | { | ||
515 | name.sprintf( "%s/Documents/video/%s/", (const char*) QDir::homeDirPath(), (const char*) captureFormat.lower() ); | ||
516 | if ( !QDir( name ).exists() ) | ||
517 | { | ||
518 | odebug << "creating directory " << name << oendl; | ||
519 | QString msg = "mkdir -p " + name; | ||
520 | system( msg.latin1() ); | ||
521 | } | ||
522 | } | ||
523 | else | ||
524 | name = outputTo; | ||
525 | |||
526 | name.append( "/" ); // sure is sure and safe is safe ;-) | ||
527 | name.append( prefix ); | ||
506 | if ( appendSettings ) | 528 | if ( appendSettings ) |
507 | name.append( QString().sprintf( "_%d_%d_q%d_%dfps", captureX, captureY, quality, _framerate ) ); | 529 | name.append( QString().sprintf( "_%d_%d_q%d_%dfps", captureX, captureY, quality, _framerate ) ); |
@@ -520,4 +542,6 @@ void CameraMainWindow::stopVideoCapture() | |||
520 | void CameraMainWindow::postProcessVideo( const QString& infile, const QString& outfile ) | 542 | void CameraMainWindow::postProcessVideo( const QString& infile, const QString& outfile ) |
521 | { | 543 | { |
544 | odebug << "post processing " << infile << " --> " << outfile << oendl; | ||
545 | |||
522 | preview->setRefreshingRate( 0 ); | 546 | preview->setRefreshingRate( 0 ); |
523 | 547 | ||
@@ -597,5 +621,5 @@ void CameraMainWindow::postProcessVideo( const QString& infile, const QString& o | |||
597 | qApp->processEvents(); | 621 | qApp->processEvents(); |
598 | 622 | ||
599 | #ifndef QT_NO_DEBUG | 623 | #ifdef CAMERA_EXTRA_DEBUG |
600 | QString tmpfilename; | 624 | QString tmpfilename; |
601 | tmpfilename.sprintf( "/tmp/test/%04d.jpg", i ); | 625 | tmpfilename.sprintf( "/tmp/test/%04d.jpg", i ); |
@@ -622,11 +646,14 @@ void CameraMainWindow::postProcessVideo( const QString& infile, const QString& o | |||
622 | framefile.close(); | 646 | framefile.close(); |
623 | 647 | ||
624 | odebug << "deleting temporary capturefile " << infile << oendl; | ||
625 | ::close( infd ); | ||
626 | QFile::remove( infile ); | ||
627 | } | 648 | } |
628 | 649 | ||
629 | avi_end( outfd, captureX, captureY, _framerate ); | 650 | avi_end( outfd, captureX, captureY, _framerate ); |
630 | ::close( outfd ); | 651 | ::close( outfd ); |
652 | ::close( infd ); | ||
653 | |||
654 | label->setText( "deleting temp files..." ); | ||
655 | qApp->processEvents(); | ||
656 | odebug << "deleting temporary capturefile " << infile << oendl; | ||
657 | QFile::remove( infile ); | ||
631 | 658 | ||
632 | fr->hide(); | 659 | fr->hide(); |
@@ -644,4 +671,5 @@ void CameraMainWindow::updateCaption() | |||
644 | else | 671 | else |
645 | setCaption( "Opie-Camera: => CAPTURING <=" ); | 672 | setCaption( "Opie-Camera: => CAPTURING <=" ); |
673 | qApp->processEvents(); | ||
646 | } | 674 | } |
647 | 675 | ||
diff --git a/noncore/multimedia/camera/opie-camera.control b/noncore/multimedia/camera/opie-camera.control index a33de38..1731ad2 100644 --- a/noncore/multimedia/camera/opie-camera.control +++ b/noncore/multimedia/camera/opie-camera.control | |||
@@ -5,5 +5,5 @@ Section: opie/applications | |||
5 | Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> | 5 | Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | 7 | Version: 1.0 |
8 | Depends: task-opie-minimal, libopie2 (1.8.1) | 8 | Depends: task-opie-minimal, libopie2 (1.8.1) |
9 | Description: A Camera Application | 9 | Description: A Camera Application |