diff options
55 files changed, 1530 insertions, 938 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 6edcd73..748111e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,9 +28,10 @@ miav_SOURCES = $(shell if [ $QT_CXXFLAGS ] ; then ../tools/MocList cc; fi ) \ mov_encoder.cc \ img_encoder.cc \ server.cc \ - error.cc \ dv1394.cc \ - server_status.cc + server_status.cc \ + info_gui.cc \ + info_console.cc EXTRA_DIST = \ miav.conf \ @@ -40,7 +41,6 @@ EXTRA_DIST = \ cprquerydialog.h \ decoder.h \ encoder.h \ - error.h \ frame.h \ img_encoder.h \ mainwindow.h \ @@ -59,8 +59,11 @@ EXTRA_DIST = \ videowidget.h \ debug.h \ dv.h \ - dv1394.cc \ - server_status.h + dv1394.h \ + server_status.h \ + info.h \ + info_gui.h \ + info_console.h miav_LDADD := $(shell if [ $QT_CXXFLAGS ] ; then ../tools/MocList o; fi ) \ -lavcodec -lavformat diff --git a/src/aboutwindow.cc b/src/aboutwindow.cc index 690679b..4cf1caa 100644 --- a/src/aboutwindow.cc +++ b/src/aboutwindow.cc @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** * aboutwindow.cc * @@ -7,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:58 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:25 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI diff --git a/src/aboutwindow.h b/src/aboutwindow.h index 85d7ac2..2e28569 100644 --- a/src/aboutwindow.h +++ b/src/aboutwindow.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** * aboutwindow.h * @@ -7,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:58 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:25 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI diff --git a/src/camera.cc b/src/camera.cc index 03aa87f..57f4a17 100644 --- a/src/camera.cc +++ b/src/camera.cc @@ -8,25 +8,32 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.14 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.13 2005/05/02 14:06:55 deva * Added unfreeze to decoder (called from camera). * @@ -45,20 +52,20 @@ * * Revision 1.8 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI #include "camera.h" -Camera::Camera() +Camera::Camera(Info *ginfo) { + info = ginfo; } void Camera::connect(const char *ip, const int port) { - errorstatus = new Error(); initialized = false; pthread_mutex_init (&mutex, NULL); @@ -77,55 +84,64 @@ void Camera::connect(const char *ip, const int port) sem_init(&encode_sem, 0, 0); sem_init(&player_sem, 0, 0); - decoder = new Decoder(errorstatus, + decoder = new Decoder(info, &encode_sem, &player_sem, encode_queue, player_queue, &mutex, &running); + /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (decoder)."); return; } - - encoder = new Encoder(errorstatus, + */ + encoder = new Encoder(info, ip, port, &encode_sem, encode_queue, &mutex, &running); + /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (encoder)."); return; } - - player = new Player(errorstatus, + */ + player = new Player(info, &running, &player_sem, player_queue, &mutex); + /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (player)."); return; } + */ pthread_create (&decodetid, NULL, thread_run, decoder); + /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (decoder thread)."); return; } + */ pthread_create (&encodetid, NULL, thread_run, encoder); + /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (encoder thread)."); return; } + */ pthread_create (&playertid, NULL, thread_run, player); + /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (player thread)."); return; } - + */ initialized = true; } @@ -147,15 +163,13 @@ Camera::~Camera() delete player_queue; delete encode_queue; - - delete errorstatus; } void Camera::setCpr(char *newcpr) { if(initialized) encoder->setCpr(newcpr); - else errorstatus->pushError("Camera not initialized."); + else info->error("Camera not initialized."); } @@ -166,7 +180,7 @@ void Camera::start() encoder->start(); decoder->start(); } else { - errorstatus->pushError("Camera not initialized."); + info->error("Camera not initialized."); } } @@ -176,7 +190,7 @@ void Camera::stop(n_savestate save) decoder->stop(save); encoder->stop(save); } else { - errorstatus->pushError("Camera not initialized."); + info->error("Camera not initialized."); } } @@ -187,7 +201,7 @@ void Camera::freeze() // encoder->freeze(); decoder->freeze(); } else { - errorstatus->pushError("Camera not initialized."); + info->error("Camera not initialized."); } } @@ -197,7 +211,7 @@ void Camera::unfreeze() player->start(); decoder->unfreeze(); } else { - errorstatus->pushError("Camera not initialized."); + info->error("Camera not initialized."); } } @@ -207,13 +221,8 @@ void Camera::snapshot(unsigned char *rgb) decoder->shoot(rgb); encoder->shoot(); } else { - errorstatus->pushError("Camera not initialized."); + info->error("Camera not initialized."); } } -Error *Camera::errorObject() -{ - return errorstatus; -} - #endif/* USE_GUI */ diff --git a/src/camera.h b/src/camera.h index eafaf27..a75acea 100644 --- a/src/camera.h +++ b/src/camera.h @@ -8,32 +8,39 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.10 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.9 2005/05/01 11:25:56 deva * Added code to read screenshot from frame queue, decode it to rgb and put it into a qimage. * * Revision 1.8 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI @@ -42,7 +49,7 @@ #include <string> using namespace std; -#include "error.h" +#include "info.h" #include <stdio.h> #include <stdlib.h> @@ -68,7 +75,7 @@ using namespace std; */ class Camera { public: - Camera(); + Camera(Info *ginfo); ~Camera(); void connect(const char *ip, const int port); @@ -82,12 +89,9 @@ public: void unfreeze(); void snapshot(unsigned char *rgb); - // Status methods - Error *errorObject(); - private: - // Error object passed to all sub objects. - Error *errorstatus; + // Info object passed to all sub objects. + Info *info; bool initialized; pthread_t playertid; diff --git a/src/cprquerydialog.cc b/src/cprquerydialog.cc index f72f4ee..faca073 100644 --- a/src/cprquerydialog.cc +++ b/src/cprquerydialog.cc @@ -8,32 +8,39 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.10 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.9 2005/05/02 20:03:24 deva * Added backspace arrow to cprquery dialog. (Replaced old ascii '<-') * * Revision 1.8 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI diff --git a/src/cprquerydialog.h b/src/cprquerydialog.h index 5b46c75..d862ae6 100644 --- a/src/cprquerydialog.h +++ b/src/cprquerydialog.h @@ -8,32 +8,39 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.8 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.7 2005/05/02 20:03:24 deva * Added backspace arrow to cprquery dialog. (Replaced old ascii '<-') * * Revision 1.6 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #ifndef __MIAV_CPRQUERYDIALOG_H__ #define __MIAV_CPRQUERYDIALOG_H__ diff --git a/src/debug.h b/src/debug.h index c5bb320..222c9af 100644 --- a/src/debug.h +++ b/src/debug.h @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifndef __MIAV_DEBUG_H__ #define __MIAV_DEBUG_H__ diff --git a/src/decoder.cc b/src/decoder.cc index 34c0185..2c68935 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -1,30 +1,47 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * decoder.cc + * + * Sat Feb 19 17:05:43 CET 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens * Copyright (C) 2004 Koen Otter and Glenn van der Meyden + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.27 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.26 2005/05/02 14:06:55 deva * Added unfreeze to decoder (called from camera). * @@ -44,8 +61,8 @@ * * Revision 1.21 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI /* @@ -69,7 +86,7 @@ #include "decoder.h" #include "debug.h" -Decoder::Decoder(Error* err, +Decoder::Decoder(Info *ginfo, sem_t *gencode_sem, sem_t *gplayer_sem, Queue<Frame> *gencode_queue, @@ -77,7 +94,8 @@ Decoder::Decoder(Error* err, pthread_mutex_t *gmutex, volatile int *grunning) { - errobj = err; + info = ginfo; + encode_sem = gencode_sem; player_sem = gplayer_sem; encode_queue = gencode_queue; @@ -104,7 +122,7 @@ void Decoder::decode() bool local_freeze; bool local_record; - dv1394 dv_stream = dv1394(errobj); // Use default port and channel. + dv1394 dv_stream = dv1394(info); // Use default port and channel. while(*running) { uint8_t *ptr; diff --git a/src/decoder.h b/src/decoder.h index a2c4ad8..68247f8 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -1,29 +1,46 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * decoder.h + * + * Sat Feb 19 17:05:42 CET 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.12 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.11 2005/05/02 14:06:55 deva * Added unfreeze to decoder (called from camera). * @@ -35,15 +52,15 @@ * * Revision 1.8 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI #ifndef __RTVIDEOREC_DECODER_H #define __RTVIDEOREC_DECODER_H -#include "error.h" +#include "info.h" #include <stdio.h> #include <stdlib.h> @@ -58,7 +75,7 @@ class Decoder : public Thread { public: - Decoder(Error* err, + Decoder(Info *ginfo, sem_t *gencode_sem, sem_t *gplayer_sem, Queue<Frame> *gencode_queue, @@ -84,7 +101,7 @@ private: volatile bool b_shoot; volatile bool b_record; - Error *errobj; + Info *info; AVCodecContext dvcodec; sem_t *encode_sem; @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifndef __MIAV_DV_H__ #define __MIAV_DV_H__ diff --git a/src/dv1394.cc b/src/dv1394.cc index 7a0a0ed..d6d86cb 100644 --- a/src/dv1394.cc +++ b/src/dv1394.cc @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.7 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.6 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "dv1394.h" @@ -112,22 +119,22 @@ static int raw_reader( raw1394handle_t handle, int channel, size_t length, quadl return 0; } -dv1394::dv1394(Error *e, int port, int channel) +dv1394::dv1394(Info *ginfo, int port, int channel) { - errobj = e; + info = ginfo; int n_ports; struct raw1394_portinfo pinf[ 16 ]; // Get handle to firewire channels handle = raw1394_new_handle(); if(!handle) { - errobj->pushError("raw1394 - failed to get handle: %s.", strerror( errno ) ); + info->error("raw1394 - failed to get handle: %s.", strerror( errno ) ); return; } // how many adapters are hooked in? if((n_ports = raw1394_get_port_info(handle, pinf, 16)) < 0 ) { - errobj->pushError("raw1394 - failed to get port info: %s.", strerror( errno ) ); + info->error("raw1394 - failed to get port info: %s.", strerror( errno ) ); raw1394_destroy_handle(handle); handle = NULL; return; @@ -135,7 +142,7 @@ dv1394::dv1394(Error *e, int port, int channel) // Tell raw1394 which host adapter to use if(raw1394_set_port(handle, port) < 0 ) { - errobj->pushError("raw1394 - failed to set port: %s.", strerror( errno ) ); + info->error("raw1394 - failed to set port: %s.", strerror( errno ) ); raw1394_destroy_handle(handle); handle = NULL; return; diff --git a/src/dv1394.h b/src/dv1394.h index ba8900d..7c24699 100644 --- a/src/dv1394.h +++ b/src/dv1394.h @@ -6,48 +6,56 @@ * Copyright 2005 Bent Bisballe * deva@aasimon.org ****************************************************************************/ + /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifndef __MIAV_DV1394_H__ #define __MIAV_DV1394_H__ #include <libraw1394/raw1394.h> -#include "error.h" +#include "info.h" class dv1394 { public: - dv1394(Error *e = NULL, int port = 0, int channel = 63); // 63 is default channel... sucks. + dv1394(Info* ginfo, int port = 0, int channel = 63); // 63 is default channel... sucks. ~dv1394(); unsigned char *readFrame(); private: raw1394handle_t handle; - Error *errobj; + Info *info; }; #endif/*__MIAV_DV1394_H__*/ diff --git a/src/encoder.cc b/src/encoder.cc index 0af6ad4..6568578 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -1,32 +1,48 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * encoder.cc + * + * Tue Apr 19 12:10:34 CEST 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens * Copyright (C) 2004 Koen Otter and Glenn van der Meyden + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ - * Revision 1.25 2005/05/02 20:34:38 deva + * Revision 1.26 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. * + * Revision 1.25 2005/05/02 20:34:38 deva * Some hacked borky ugly scumm code to check for errors! :( * * Revision 1.24 2005/05/02 10:35:23 deva @@ -54,14 +70,14 @@ * * Revision 1.17 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI #include "encoder.h" -Encoder::Encoder(Error* err, +Encoder::Encoder(Info *ginfo, const char *gip, const int gport, sem_t *gsem, @@ -69,7 +85,7 @@ Encoder::Encoder(Error* err, pthread_mutex_t *gmutex, volatile int *grunning) { - errobj = err; + info = ginfo; strcpy(ip, gip); port = gport; @@ -110,8 +126,7 @@ void Encoder::encode() frame = queue->pop(); - // If errors has occurred we better not try sending something over the network! - if(frame && !errobj->hasError()) { + if(frame) { if(frame->freeze) frozen = true; if(frame->shoot) frozen = false; @@ -121,18 +136,9 @@ void Encoder::encode() // If no connection is present, make a new one if(!s) { - s = new Socket(port, errobj); + s = new Socket(port, info); s->sconnect(ip); - n = new Network(s, errobj); - // FIXME: This is darn ugly! - if(errobj->hasError()) { - delete n; - delete s; - s = NULL; - n = NULL; - // break; - goto getout; - } + n = new Network(s, info); } n_header h; @@ -161,7 +167,6 @@ void Encoder::encode() } } } - getout: if(frame) delete frame; } } diff --git a/src/encoder.h b/src/encoder.h index 80552ef..2054f92 100644 --- a/src/encoder.h +++ b/src/encoder.h @@ -1,29 +1,46 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * encoder.h + * + * Thu Apr 14 19:29:55 CEST 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.12 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.11 2005/05/02 10:35:23 deva * Fixed wrongly showed snapshot thumbnails. * @@ -38,15 +55,15 @@ * * Revision 1.7 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI #ifndef __RTVIDEOREC_ENCODER_H #define __RTVIDEOREC_ENCODER_H -#include "error.h" +#include "info.h" #include <stdio.h> #include <stdlib.h> @@ -70,7 +87,7 @@ */ class Encoder : public Thread { public: - Encoder(Error* err, + Encoder(Info* ginfo, const char *gip, const int gport, sem_t *gsem, @@ -96,7 +113,7 @@ public: volatile int *running; private: - Error *errobj; + Info *info; int port; char ip[32]; diff --git a/src/error.cc b/src/error.cc deleted file mode 100644 index d739a46..0000000 --- a/src/error.cc +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/*************************************************************************** - * error.cc - * - * Sat Mar 26 10:57:07 CET 2005 - * Copyright 2005 Bent Bisballe - * deva@aasimon.org - ****************************************************************************/ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -/* - * $Id$ - */ -/* - * $Log$ - * Revision 1.6 2005/05/01 09:56:26 deva - * Added Id and Log tags to all files - * - */ -#include <config.h> -#include "error.h" - -#include <stdio.h> -#include <stdarg.h> - -Error::Error() -{ - // Initialize - lastError = NULL; - pthread_mutex_init (&mutex, NULL); -} - - -Error::~Error() -{ -} - - -bool Error::hasError() -{ - return lastError != NULL; -} - - -string Error::popErrorString() -{ - pthread_mutex_lock(&mutex); - if(lastError == NULL) return string(""); - - _err_entry *err = lastError; - string le = err->errstr; - lastError = err->prev; - delete err; - pthread_mutex_unlock(&mutex); - return le; -} - - -void Error::pushError(char *fmt, ...) -{ - char buf[1024]; - - pthread_mutex_lock(&mutex); - // Beginning of safezone - - va_list argp; - va_start(argp, fmt); - fprintf(stderr, "New Error: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); - vsprintf(buf, fmt, argp); - va_end(argp); - - _err_entry *err = new _err_entry; - - err->errstr = string(buf); - err->prev = lastError; - lastError = err; - - // End of safezone - pthread_mutex_unlock(&mutex); -} - - -void Error::removeAllErrors() -{ - while(lastError) popErrorString(); -} diff --git a/src/error.h b/src/error.h deleted file mode 100644 index 06aa4b1..0000000 --- a/src/error.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/*************************************************************************** - * error.h - * - * Sat Mar 26 10:57:07 CET 2005 - * Copyright 2005 Bent Bisballe - * deva@aasimon.org - ****************************************************************************/ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -/* - * $Id$ - */ -/* - * $Log$ - * Revision 1.5 2005/05/01 09:56:26 deva - * Added Id and Log tags to all files - * - */ -#include <config.h> -#ifndef __MIAV_ERROR_H__ -#define __MIAV_ERROR_H__ - -#include <string> -using namespace std; - -#include <pthread.h> -#include <semaphore.h> - -/** - * This struct contains one error, and a pointer to the previous one. - */ -typedef struct __err_entry { - string errstr; - struct __err_entry *prev; -} _err_entry; - - -class Error { -public: - Error(); - ~Error(); - - // Status methods - bool hasError(); - string popErrorString(); - - // Set methods - void pushError(char* fmt, ...); - // void pushError(string &errstr); - void removeAllErrors(); - -private: - pthread_mutex_t mutex; - - // A pointer to the last error. - _err_entry *lastError; -}; - -#endif/*__MIAV_ERROR_H__*/ diff --git a/src/frame.cc b/src/frame.cc index ee86888..002ab43 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.6 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.5 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "frame.h" diff --git a/src/frame.h b/src/frame.h index 2ef53ff..aebe3cb 100644 --- a/src/frame.h +++ b/src/frame.h @@ -8,32 +8,39 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.5 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.4 2005/05/02 09:50:22 deva * Rewrote freeze, shoot and record flags, from encoder to frame. * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifndef __FRAME_H__ #define __FRAME_H__ diff --git a/src/img_encoder.cc b/src/img_encoder.cc index 9af9db6..eeddec3 100644 --- a/src/img_encoder.cc +++ b/src/img_encoder.cc @@ -1,34 +1,51 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * img_encoder.cc + * + * Mon Nov 15 19:45:07 CET 2004 + * Copyright 2004 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens * Copyright (C) 2004 Koen Otter and Glenn van der Meyden + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.7 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.6 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include "img_encoder.h" #include <stdio.h> //#include <setjmp.h> diff --git a/src/img_encoder.h b/src/img_encoder.h index 3c000b6..693bba2 100644 --- a/src/img_encoder.h +++ b/src/img_encoder.h @@ -1,33 +1,50 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * img_encoder.h + * + * Mon Nov 15 19:45:07 CET 2004 + * Copyright 2004 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.6 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.5 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #ifndef __RTVIDEOREC_IMGENCODER_H #define __RTVIDEOREC_IMGENCODER_H diff --git a/src/info.h b/src/info.h new file mode 100644 index 0000000..e8884fd --- /dev/null +++ b/src/info.h @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * info.h + * + * Tue May 3 09:04:04 CEST 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + * $Id$ + */ + +/* + * $Log$ + */ + +#include <config.h> +#ifndef __MIAV_INFO_H__ +#define __MIAV_INFO_H__ + +class Info { +public: + Info() {} + ~Info() {} + + virtual void error(char* fmt, ...) = 0; + virtual void warn(char* fmt, ...) = 0; + virtual void info(char* fmt, ...) = 0; +}; + +#endif/*__MIAV_INFO_H__*/ diff --git a/src/info_console.cc b/src/info_console.cc new file mode 100644 index 0000000..6acfd4f --- /dev/null +++ b/src/info_console.cc @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * info_console.cc + * + * Tue May 3 09:35:03 CEST 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + * $Id$ + */ + +/* + * $Log$ + */ + +#include <config.h> +#include "info_console.h" + +#include <stdio.h> +#include <stdarg.h> + +InfoConsole::InfoConsole(): Info() +{ +} + +InfoConsole::~InfoConsole() +{ +} + +void InfoConsole::error(char *fmt, ...) +{ + char buf[1024]; + + pthread_mutex_lock(&mutex); + // Beginning of safezone + + va_list argp; + va_start(argp, fmt); + fprintf(stderr, "Error: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); + vsprintf(buf, fmt, argp); + va_end(argp); + + // End of safezone + pthread_mutex_unlock(&mutex); +} + +void InfoConsole::warn(char *fmt, ...) +{ + char buf[1024]; + + pthread_mutex_lock(&mutex); + // Beginning of safezone + + va_list argp; + va_start(argp, fmt); + fprintf(stderr, "Warning: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); + vsprintf(buf, fmt, argp); + va_end(argp); + + // End of safezone + pthread_mutex_unlock(&mutex); +} + +void InfoConsole::info(char *fmt, ...) +{ + char buf[1024]; + + pthread_mutex_lock(&mutex); + // Beginning of safezone + + va_list argp; + va_start(argp, fmt); + fprintf(stderr, "Info: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); + vsprintf(buf, fmt, argp); + va_end(argp); + + // End of safezone + pthread_mutex_unlock(&mutex); +} diff --git a/src/info_console.h b/src/info_console.h new file mode 100644 index 0000000..019c8b7 --- /dev/null +++ b/src/info_console.h @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * info_console.h + * + * Tue May 3 09:35:03 CEST 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + * $Id$ + */ + +/* + * $Log$ + */ + +#include <config.h> +#ifndef __MIAV_INFO_CONSOLE_H__ +#define __MIAV_INFO_CONSOLE_H__ + +#include "info.h" + +#include <pthread.h> +#include <semaphore.h> + +class InfoConsole: public Info { +public: + InfoConsole(); + ~InfoConsole(); + + void error(char* fmt, ...); + void warn(char* fmt, ...); + void info(char* fmt, ...); + +private: + pthread_mutex_t mutex; +}; + +#endif/*__MIAV_INFO_CONSOLE_H__*/ diff --git a/src/info_gui.cc b/src/info_gui.cc new file mode 100644 index 0000000..0718021 --- /dev/null +++ b/src/info_gui.cc @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * info_gui.cc + * + * Tue May 3 09:34:59 CEST 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + * $Id$ + */ + +/* + * $Log$ + */ + +#include <config.h> +#include "info_gui.h" + +#include <stdio.h> +#include <stdarg.h> + +InfoGui::InfoGui(): Info() +{ +} + +InfoGui::~InfoGui() +{ +} + +void InfoGui::error(char *fmt, ...) +{ + char buf[1024]; + + pthread_mutex_lock(&mutex); + // Beginning of safezone + + va_list argp; + va_start(argp, fmt); + fprintf(stderr, "Error: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); + vsprintf(buf, fmt, argp); + va_end(argp); + + // End of safezone + pthread_mutex_unlock(&mutex); +} + +void InfoGui::warn(char *fmt, ...) +{ + char buf[1024]; + + pthread_mutex_lock(&mutex); + // Beginning of safezone + + va_list argp; + va_start(argp, fmt); + fprintf(stderr, "Warning: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); + vsprintf(buf, fmt, argp); + va_end(argp); + + // End of safezone + pthread_mutex_unlock(&mutex); +} + +void InfoGui::info(char *fmt, ...) +{ + char buf[1024]; + + pthread_mutex_lock(&mutex); + // Beginning of safezone + + va_list argp; + va_start(argp, fmt); + fprintf(stderr, "Info: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); + vsprintf(buf, fmt, argp); + va_end(argp); + + // End of safezone + pthread_mutex_unlock(&mutex); +} diff --git a/src/info_gui.h b/src/info_gui.h new file mode 100644 index 0000000..28860b6 --- /dev/null +++ b/src/info_gui.h @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * info_gui.h + * + * Tue May 3 09:34:59 CEST 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + * $Id$ + */ + +/* + * $Log$ + */ + +#include <config.h> +#ifndef __MIAV_INFO_GUI_H__ +#define __MIAV_INFO_GUI_H__ + +#include "info.h" + +#include <pthread.h> +#include <semaphore.h> + +class InfoGui: public Info { +public: + InfoGui(); + ~InfoGui(); + + void error(char* fmt, ...); + void warn(char* fmt, ...); + void info(char* fmt, ...); + +private: + pthread_mutex_t mutex; +}; + +#endif/*__MIAV_INFO_GUI_H__*/ diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 80b99b6..eda7dc9 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -8,25 +8,32 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.24 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.23 2005/05/02 20:34:38 deva * * Some hacked borky ugly scumm code to check for errors! :( @@ -41,9 +48,6 @@ * Cpr now sent to decoder. And saved prioer to editing, in order to be able * to disable editing session and revert to old cpr. * - * Revision 1.20 2005/05/01 12:17:41 deva - * *** empty log message *** - * * Revision 1.19 2005/05/01 12:13:50 deva * Removed bitmap readin. * @@ -56,6 +60,7 @@ * Revision 1.16 2005/05/01 09:56:26 deva * Added Id and Log tags to all files */ + #include <config.h> #ifdef USE_GUI @@ -89,17 +94,14 @@ MainWindow::MainWindow( QWidget* parent, const char* name ) : QWidget( parent, name, WStyle_Customize | WStyle_NoBorder ) { - Error *error = config->getErrorObj(); + info = new InfoGui(); + video_width = config->readInt("video_width"); video_height = config->readInt("video_height"); int resolution_w = config->readInt("pixel_width"); int resolution_h = config->readInt("pixel_height"); - while(error->hasError()) { - show(); - MessageBox(this, TXT_ERROR_TITLE, error->popErrorString().c_str(), - TYPE_OK, ICON_ERROR).exec(); - } + unit = ((float)resolution_w / (float)(config->readFloat("screensize") * 3.1f)); move(0,0); @@ -137,25 +139,16 @@ MainWindow::MainWindow( QWidget* parent, const char* name ) createGui(); show(); - camera = new Camera(); + camera = new Camera(info); camera->connect(config->readString("server_addr")->c_str(), config->readInt("server_port")); - cam_error = camera->errorObject(); - while(cam_error->hasError()) { - MessageBox(this, TXT_ERROR_TITLE, cam_error->popErrorString().c_str(), - TYPE_OK, ICON_ERROR).exec(); - } - recording = false; frozen = false; // Open the CPR Dialog cpr_clicked(); - errtimer = new QTimer(this); - connect(errtimer, SIGNAL(timeout()), SLOT(check_errors())); - errtimer->start(2000); } MainWindow::~MainWindow() @@ -331,14 +324,6 @@ void MainWindow::cpr_clicked() } } -void MainWindow::checkErrors() -{ - while(cam_error->hasError()) { - MessageBox(this, TXT_ERROR_TITLE, cam_error->popErrorString().c_str(), - TYPE_OK, ICON_ERROR).exec(); - } -} - void MainWindow::rec_clicked() { if(!recording) { @@ -348,7 +333,6 @@ void MainWindow::rec_clicked() timer->start(100); btn_rec->setPixmap(*pix_stop); camera->start(); - checkErrors(); } else { switch(MessageBox(this, TXT_ASK_SAVE_TITLE, @@ -382,7 +366,6 @@ void MainWindow::rec_clicked() case MSG_CANCEL: break; } - checkErrors(); } } @@ -393,7 +376,6 @@ void MainWindow::shoot_clicked() QImage image(720, 576, 32); camera->snapshot(image.bits()); - checkErrors(); image = image.smoothScale(img_history[0]->width(), img_history[0]->height()); @@ -407,7 +389,6 @@ void MainWindow::shoot_clicked() if(frozen) { camera->unfreeze(); btn_freeze->setPixmap(*pix_freeze); - checkErrors(); btn_freeze->setOn(false); frozen = false; } @@ -418,25 +399,14 @@ void MainWindow::freeze_clicked() if(frozen) { camera->unfreeze(); btn_freeze->setPixmap(*pix_freeze); - checkErrors(); btn_freeze->setOn(false); frozen = false; } else { camera->freeze(); btn_freeze->setPixmap(*pix_unfreeze); - checkErrors(); btn_freeze->setOn(true); frozen = true; } } -void MainWindow::check_errors() -{ - while(cam_error->hasError()) { - MessageBox(this, TXT_ERROR_TITLE, cam_error->popErrorString().c_str(), - TYPE_OK, ICON_ERROR).exec(); - } -} - - #endif /*USE_GUI*/ diff --git a/src/mainwindow.h b/src/mainwindow.h index 2390c21..78bdd75 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -8,25 +8,32 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.11 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.10 2005/05/02 20:34:38 deva * * Some hacked borky ugly scumm code to check for errors! :( @@ -38,8 +45,8 @@ * * Revision 1.8 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI @@ -59,7 +66,7 @@ using namespace std; #include "camera.h" #include "cprquerydialog.h" -#include "error.h" +#include "info_gui.h" #define NUM_HISTORY 3 @@ -105,16 +112,14 @@ public slots: void shoot_clicked(); void freeze_clicked(); void redraw_edge(); - void check_errors(); private: - Error *error; + Info *info; - void checkErrors(); void createGui(); Camera *camera; - Error *cam_error; + Info *cam_info; QPixmap *pix_unfreeze; QPixmap *pix_freeze; diff --git a/src/messagebox.cc b/src/messagebox.cc index 75e095e..0f4b803 100644 --- a/src/messagebox.cc +++ b/src/messagebox.cc @@ -8,25 +8,32 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.9 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.8 2005/05/01 16:45:48 deva * Icons added to messagebox. * diff --git a/src/messagebox.h b/src/messagebox.h index 7f43e72..d7aee03 100644 --- a/src/messagebox.h +++ b/src/messagebox.h @@ -8,29 +8,37 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.7 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.6 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * */ + #include <config.h> #ifdef USE_GUI diff --git a/src/miav.cc b/src/miav.cc index 2316413..daac99d 100644 --- a/src/miav.cc +++ b/src/miav.cc @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** * miav.cc * @@ -7,33 +8,40 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.7 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.6 2005/05/02 19:47:43 deva * Fixed overlapping cpr numbers on the server (now it saves one cpr pr. * connection, and ignores any changes sent) * * Revision 1.5 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "server.h" @@ -47,6 +55,9 @@ #include "miav_config.h" +#include "info_console.h" +#include "info_gui.h" + #include <stdio.h> enum { @@ -112,8 +123,6 @@ int server(int argc, char *argv[]) { int main(int argc, char *argv[]) { - Error conferr; - config = new MiavConfig(ETC"/miav.conf", &conferr); int mode = MODE_GRAB; @@ -128,9 +137,17 @@ int main(int argc, char *argv[]) switch(mode) { case MODE_GRAB: - return grab(argc - 2, &argv[2]); + { + InfoGui info; + config = new MiavConfig(ETC"/miav.conf", &info); + return grab(argc - 2, &argv[2]); + } case MODE_SERVER: - return server(argc - 2, &argv[2]); + { + InfoConsole info; + config = new MiavConfig(ETC"/miav.conf", &info); + return server(argc - 2, &argv[2]); + } } return 0; } @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifndef __LIBMIAV_H__ #define __LIBMIAV_H__ diff --git a/src/miav_config.cc b/src/miav_config.cc index 9a209ba..9a6233b 100644 --- a/src/miav_config.cc +++ b/src/miav_config.cc @@ -6,38 +6,46 @@ * Copyright 2005 Bent Bisballe * deva@aasimon.org ****************************************************************************/ + /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.8 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.7 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "miav_config.h" MiavConfig *config; -MiavConfig::MiavConfig(char *file, Error* err) +MiavConfig::MiavConfig(char *file, Info *ginfo) { - error = err; + info = ginfo; configs = NULL; filename = string(file); @@ -46,9 +54,7 @@ MiavConfig::MiavConfig(char *file, Error* err) FILE* fp = fopen(file, "r"); if(!fp) { - char errbuf[256]; - sprintf(errbuf, "Error reading configuration file %s\n", file); - if(error) error->pushError(errbuf); + info->error("Error reading configuration file %s\n", file); return; } fseek(fp, 0, SEEK_END); @@ -83,8 +89,7 @@ MiavConfig::~MiavConfig() _cfg *MiavConfig::parseError(char* msg, char* line) { char errbuf[512]; - sprintf(errbuf, "Error parsing file %s at line:\n\t%s\n\t%s\n", filename.c_str(), line, msg); - if(error) error->pushError(errbuf); + info->error("Error parsing file %s at line:\n\t%s\n\t%s\n", filename.c_str(), line, msg); return NULL; } @@ -259,12 +264,6 @@ _cfg *MiavConfig::findNode(char* node) cfg = cfg->next; } char errbuf[256]; - sprintf(errbuf, "Request for nonexisting node \"%s\"!\n", node); - if(error) error->pushError(errbuf); + info->error("Request for nonexisting node \"%s\"!\n", node); return NULL; } - -Error* MiavConfig::getErrorObj() -{ - return error; -} diff --git a/src/miav_config.h b/src/miav_config.h index 756d0f4..5d1fa29 100644 --- a/src/miav_config.h +++ b/src/miav_config.h @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.6 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.5 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifndef __MIAV_MIAV_CONFIG_H__ #define __MIAV_MIAV_CONFIG_H__ @@ -38,7 +45,7 @@ #include <string> using namespace std; -#include "error.h" +#include "info.h" typedef struct __cfg { string *name; @@ -51,7 +58,7 @@ typedef struct __cfg { class MiavConfig { public: - MiavConfig(char *file, Error* err = NULL); + MiavConfig(char *file, Info* ginfo); ~MiavConfig(); int readInt(char *node); @@ -59,11 +66,12 @@ public: string *readString(char *node); float readFloat(char *node); - Error* getErrorObj(); + Info* getInfoObj(); private: + Info *info; + string emptyString; - Error* error; string filename; _cfg *addConfig(_cfg *parent, char* conf); int parse(char* conf); diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc index d86c638..9554d09 100644 --- a/src/mov_encoder.cc +++ b/src/mov_encoder.cc @@ -1,37 +1,54 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * mov_encoder.cc + * + * Sat Feb 19 14:13:19 CET 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens * Copyright (C) 2004 Koen Otter and Glenn van der Meyden + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.10 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.9 2005/05/02 10:59:44 deva * Reverted to mpg file format (accidentally used avi with mpeg2) * * Revision 1.8 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include "mov_encoder.h" #include "debug.h" diff --git a/src/mov_encoder.h b/src/mov_encoder.h index 511c71d..2e3eca3 100644 --- a/src/mov_encoder.h +++ b/src/mov_encoder.h @@ -1,33 +1,48 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * mov_encoder.h + * + * Sat Feb 19 14:13:19 CET 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.5 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.4 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #ifndef __RTVIDEOREC_ENCODER_H #define __RTVIDEOREC_ENCODER_H diff --git a/src/network.cc b/src/network.cc index 67ad413..05835c0 100644 --- a/src/network.cc +++ b/src/network.cc @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "network.h" @@ -39,9 +46,9 @@ #include <string.h> #include <sys/socket.h> -Network::Network(Socket *gs, Error* err) +Network::Network(Socket *gs, Info *ginfo) { - error = err; + info = ginfo; s = gs; } @@ -52,17 +59,13 @@ Network::~Network() int Network::write(void *buf, int size) { if(!s->isConnected()) { - char errbuf[] = "Write attempted to a socket not connected!\0"; - if(error) error->pushError(errbuf); - else fprintf(stderr, errbuf); + info->error("Write attempted to a socket not connected!"); return 0; } int n = send(s->ssocket, buf, size, MSG_WAITALL); if(n == -1) { - char errbuf[] = "An error occurred!\0"; - if(error) error->pushError(errbuf); - else fprintf(stderr, errbuf); + info->error("An error occurred!"); } return n; @@ -71,17 +74,13 @@ int Network::write(void *buf, int size) int Network::read(void *buf, int size) { if(!s->isConnected()) { - char errbuf[] = "Read attempted from a socket not connected!\0"; - if(error) error->pushError(errbuf); - else fprintf(stderr, errbuf); + info->error("Read attempted from a socket not connected!"); return 0; } int n = recv(s->ssocket, buf, size, MSG_WAITALL); if(n == -1) { - char errbuf[] = "An error occurred!\0"; - if(error) error->pushError(errbuf); - else fprintf(stderr, errbuf); + info->error("An error occurred!"); } return n; @@ -117,9 +116,7 @@ int Network::sendPackage(n_header *h, void* buf, int bufsz) int n = sendmsg(s->ssocket, &msg, 0); if(n < 0) { - char errbuf[] = "A network error ocurred during sendPackage!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("A network error ocurred during sendPackage!"); return -1; } @@ -145,16 +142,12 @@ int Network::recvPackage(n_header *h, void* buf, int bufsz) int n = recvmsg(s->ssocket, &msg, MSG_WAITALL); if(n < 0) { - char errbuf[] = "A network error ocurred during recvPackage!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("A network error ocurred during recvPackage!"); return -1; } if(msg.msg_iovlen != 2) { - char errbuf[] = "Wrong package format!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("Wrong package format!"); return -1; } return n; diff --git a/src/network.h b/src/network.h index 8064d5b..4d92307 100644 --- a/src/network.h +++ b/src/network.h @@ -8,40 +8,47 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifndef __MIAVLIB_NETWORK_H__ #define __MIAVLIB_NETWORK_H__ #include "socket.h" #include "package.h" -#include "error.h" +#include "info.h" class Network { public: - Network(Socket *gs, Error* err = NULL); + Network(Socket *gs, Info* ginfo); ~Network(); // Raw communication @@ -53,7 +60,7 @@ public: int recvPackage(n_header *h, void* buf, int bufsz); private: - Error *error; + Info *info; Socket *s; }; diff --git a/src/package.h b/src/package.h index d209cb4..9f09648 100644 --- a/src/package.h +++ b/src/package.h @@ -8,25 +8,32 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * diff --git a/src/player.cc b/src/player.cc index a14b8d5..aa80605 100644 --- a/src/player.cc +++ b/src/player.cc @@ -1,34 +1,51 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * plsyer.cc + * + * Wed Nov 3 21:23:14 CET 2004 + * Copyright 2004 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens * Copyright (C) 2004 Koen Otter and Glenn van der Meyden + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.23 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.22 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI @@ -40,7 +57,7 @@ #include <time.h> -Player::Player(Error *err, +Player::Player(Info *ginfo, volatile int *grunning, sem_t *gsem, Queue<Frame> *gqueue, @@ -50,7 +67,7 @@ Player::Player(Error *err, noErrors = true; char errbuf[256]; - errobj = err; + info = ginfo; running = grunning; sem = gsem; @@ -60,8 +77,7 @@ Player::Player(Error *err, sem_init(&play_sem, 0, 1); if(SDL_Init(SDL_INIT_VIDEO) < 0) { - sprintf(errbuf, "Unable to init SDL: %s.", SDL_GetError()); - errobj->pushError(errbuf); + info->error("Unable to init SDL: %s.", SDL_GetError()); noErrors = false; return; } @@ -72,9 +88,8 @@ Player::Player(Error *err, SDL_HWSURFACE | SDL_ANYFORMAT | SDL_HWACCEL); if(!screen) { - sprintf(errbuf, "Unable to set %dx%d video: %s.", + info->error("Unable to set %dx%d video: %s.", DISPLAYWIDTH, DISPLAYHEIGHT, SDL_GetError()); - errobj->pushError(errbuf); noErrors = false; return; } @@ -84,8 +99,7 @@ Player::Player(Error *err, SDL_YUY2_OVERLAY, // Match for the libdv decoder output screen); if(!overlay) { - sprintf(errbuf, "Unable to create SDL overlay: %s.", SDL_GetError()); - errobj->pushError(errbuf); + info->error("Unable to create SDL overlay: %s.", SDL_GetError()); noErrors = false; return; } diff --git a/src/player.h b/src/player.h index 93fb454..e516a33 100644 --- a/src/player.h +++ b/src/player.h @@ -1,40 +1,58 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * player.h + * + * Fri Feb 25 20:23:19 CET 2005 + * Copyright 2005 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * * Copyright (C) 2004 Bent Bisballe - * Copyright (C) 2004 B. Stultiens + * + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.7 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.6 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI #ifndef __RTVIDEOREC_PLAYER_H #define __RTVIDEOREC_PLAYER_H -#include "error.h" +#include "info.h" #include <stdio.h> #include <stdlib.h> @@ -60,7 +78,7 @@ */ class Player : public Thread { public: - Player(Error* err, + Player(Info *ginfo, volatile int *grunning, sem_t *gsem, Queue<Frame> *gqueue, @@ -73,7 +91,7 @@ public: void run(); private: - Error *errobj; + Info *info; void player(); diff --git a/src/queue.h b/src/queue.h index 3dc6909..475eabf 100644 --- a/src/queue.h +++ b/src/queue.h @@ -1,33 +1,51 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * queue.h + * + * Tue Nov 9 10:57:20 CET 2004 + * Copyright 2004 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * - * Copyright (C) 2004 Bent Bisballe * Copyright (C) 2004 B. Stultiens + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.13 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.12 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * */ + #include <config.h> #ifndef __RTVIDEOREC_QUEUE_H #define __RTVIDEOREC_QUEUE_H diff --git a/src/server.cc b/src/server.cc index c8a359e..d91a4e5 100644 --- a/src/server.cc +++ b/src/server.cc @@ -1,31 +1,39 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** - * miav-rec.cc + * server.cc * * Mon Nov 8 11:35:01 CET 2004 * Copyright 2004 Bent Bisballe * deva@aasimon.org ****************************************************************************/ + /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. + * + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.11 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.10 2005/05/02 19:47:43 deva * Fixed overlapping cpr numbers on the server (now it saves one cpr pr. * connection, and ignores any changes sent) @@ -35,8 +43,8 @@ * * Revision 1.8 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include "server.h" #include "miav.h" @@ -59,6 +67,8 @@ #include "dv.h" +#include "info_console.h" + void saveFrameAsImage(char* cpr, Frame *f) { ImgEncoder imgenc; @@ -253,6 +263,7 @@ void newConnection(Socket *socket) char cpr[256]; bool hasCpr = false; ServerStatus status; + InfoConsole info; n_savestate savestate = LATER; n_header h; @@ -265,7 +276,7 @@ void newConnection(Socket *socket) printf("New connection[pid: %d]...\n", getpid()); - Network network = Network(socket); + Network network = Network(socket, &info); while(int ret = network.recvPackage(&h, frame->data, frame->size)) { status.checkPoint(); if(ret == -1) { diff --git a/src/server.h b/src/server.h index 214d4ce..200ce68 100644 --- a/src/server.h +++ b/src/server.h @@ -8,29 +8,37 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * */ + #ifndef __SERVER_H__ #define __SERVER_H__ diff --git a/src/server_status.cc b/src/server_status.cc index f3b8e92..66cc34c 100644 --- a/src/server_status.cc +++ b/src/server_status.cc @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "server_status.h" diff --git a/src/server_status.h b/src/server_status.h index 1d0d2b6..84f7273 100644 --- a/src/server_status.h +++ b/src/server_status.h @@ -8,29 +8,37 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * */ + #include <config.h> #ifndef __MIAV_SERVER_STATUS_H__ #define __MIAV_SERVER_STATUS_H__ diff --git a/src/socket.cc b/src/socket.cc index 351743c..4b282b4 100644 --- a/src/socket.cc +++ b/src/socket.cc @@ -8,43 +8,50 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "socket.h" -Socket::Socket(Error* _err) +Socket::Socket(Info *ginfo) { - error = _err; + info = ginfo; connected = false; err = 0; } -Socket::Socket(u_short port, Error* _err) +Socket::Socket(u_short port, Info *ginfo) { - error = _err; + info = ginfo; connected = false; err = 0; @@ -56,9 +63,7 @@ Socket::Socket(u_short port, Error* _err) if (ssocket < 0) { err = 1; - char errbuf[] = "Socket: socket() failed!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("Socket: socket() failed!"); } socketaddr.sin_family = AF_INET; // Use "internet protocol" IP @@ -81,9 +86,7 @@ Socket Socket::slisten() Socket s = Socket(); if(err) { - char errbuf[] = "Socket: No socket present!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("Socket: No socket present!"); return s; } if(!connected) { @@ -91,7 +94,7 @@ Socket Socket::slisten() err = bind(ssocket, (struct sockaddr*)&socketaddr, sizeof(socketaddr)); if (err) { - perror("Socket: bind() failed"); + info->error("Socket: bind() failed!"); return s; } @@ -99,9 +102,7 @@ Socket Socket::slisten() // requests (max 5 in queue) err = listen(ssocket, 5); if(err) { - char errbuf[] = "Socket: listen() failed!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("Socket: listen() failed!"); return s; } } @@ -115,9 +116,7 @@ Socket Socket::slisten() if (s.ssocket < 0) { err = 1; - char errbuf[] = "Socket: accept() failed!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("Socket: accept() failed!"); return s; } @@ -130,7 +129,7 @@ Socket Socket::slisten() int Socket::sconnect(char *ip) { if(err) { - perror("Socket: No socket present"); + info->error("Socket: No socket present!"); return err; } @@ -140,9 +139,7 @@ int Socket::sconnect(char *ip) err = connect(ssocket, (struct sockaddr*)&socketaddr, sizeof(socketaddr)); if (err) { - char errbuf[] = "Socket: connect() failed!\0"; - if(error) error->pushError(errbuf); - else perror(errbuf); + info->error("Socket: connect() failed!"); return err; } // fprintf(stderr, "Socket connected\n"); diff --git a/src/socket.h b/src/socket.h index c84868f..d81aea2 100644 --- a/src/socket.h +++ b/src/socket.h @@ -8,29 +8,37 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * */ + #include <config.h> #ifndef __MIAVLIB_SOCKET_H__ #define __MIAVLIB_SOCKET_H__ @@ -44,12 +52,12 @@ #include <sys/socket.h> #include <arpa/inet.h> -#include "error.h" +#include "info.h" class Socket { public: - Socket(Error *_err = NULL); - Socket(u_short port, Error *_err = NULL); + Socket(Info *ginfo = NULL); + Socket(u_short port, Info *ginfo = NULL); ~Socket(); Socket slisten(); int sconnect(char *ip); @@ -60,7 +68,7 @@ public: bool connected; private: - Error *error; + Info *info; int err; }; diff --git a/src/thread.cc b/src/thread.cc index ee072ac..1d59f74 100644 --- a/src/thread.cc +++ b/src/thread.cc @@ -8,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include "thread.h" diff --git a/src/thread.h b/src/thread.h index bbd7812..8f7bd41 100644 --- a/src/thread.h +++ b/src/thread.h @@ -8,29 +8,37 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * */ + #include <config.h> #ifndef __THREAD_H__ #define __THREAD_H__ diff --git a/src/util.cc b/src/util.cc index 67b9dd1..86689e5 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1,31 +1,50 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * util.cc + * + * Sun Oct 31 12:12:20 CET 2004 + * Copyright 2004 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * * Copyright (C) 2004 B. Stultiens + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #include <stdio.h> @@ -1,31 +1,51 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * util.h + * + * Mon Nov 8 10:49:33 CET 2004 + * Copyright 2004 Bent Bisballe + * deva@aasimon.org + ****************************************************************************/ + /* + * Originally from: * RTVideoRec Realtime video recoder and encoder for Linux * * Copyright (C) 2004 B. Stultiens + */ + +/* + * This file is part of MIaV. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * */ + #include <config.h> #ifndef __RTVIDEOREC_UTIL_H #define __RTVIDEOREC_UTIL_H diff --git a/src/videowidget.cc b/src/videowidget.cc index 7532466..4fadb1d 100644 --- a/src/videowidget.cc +++ b/src/videowidget.cc @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** * videowidget.cc * @@ -7,29 +8,36 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.3 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.2 2005/05/01 09:56:26 deva * Added Id and Log tags to all files - * */ + #include <config.h> #ifdef USE_GUI diff --git a/src/videowidget.h b/src/videowidget.h index 54ca2eb..4159bb9 100644 --- a/src/videowidget.h +++ b/src/videowidget.h @@ -7,25 +7,32 @@ ****************************************************************************/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This file is part of MIaV. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * MIaV is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * MIaV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MIaV; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + /* * $Id$ */ + /* * $Log$ + * Revision 1.4 2005/05/03 08:31:59 deva + * Removed the error object, and replaced it with a more generic info object. + * * Revision 1.3 2005/05/01 09:56:26 deva * Added Id and Log tags to all files * diff --git a/tools/MIaVAdd b/tools/MIaVAdd index 9125858..7f36037 100755 --- a/tools/MIaVAdd +++ b/tools/MIaVAdd @@ -11,24 +11,28 @@ function allfile() { echo " ****************************************************************************/" >> $1; echo "" >> $1; echo "/*" >> $1; - echo " * This program is free software; you can redistribute it and/or modify" >> $1; - echo " * it under the terms of the GNU General Public License as published by" >> $1; - echo " * the Free Software Foundation; either version 2 of the License, or" >> $1; - echo " * (at your option) any later version." >> $1; + echo " * This file is part of MIaV." >> $1; echo " *" >> $1; - echo " * This program is distributed in the hope that it will be useful," >> $1; - echo " * but WITHOUT ANY WARRANTY; without even the implied warranty of" >> $1; - echo " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" >> $1; - echo " * GNU Library General Public License for more details." >> $1; + echo " * MIaV is free software; you can redistribute it and/or modify" >> $1; + echo " * it under the terms of the GNU General Public License as published by" >> $1; + echo " * the Free Software Foundation; either version 2 of the License, or" >> $1; + echo " * (at your option) any later version." >> $1; echo " *" >> $1; - echo " * You should have received a copy of the GNU General Public License" >> $1; - echo " * along with this program; if not, write to the Free Software" >> $1; - echo " * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." >> $1; + echo " * MIaV is distributed in the hope that it will be useful," >> $1; + echo " * but WITHOUT ANY WARRANTY; without even the implied warranty of" >> $1; + echo " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" >> $1; + echo " * GNU General Public License for more details." >> $1; + echo " *" >> $1; + echo " * You should have received a copy of the GNU General Public License" >> $1; + echo " * along with MIaV; if not, write to the Free Software" >> $1; + echo " * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA." >> $1; echo " */" >> $1; + echo "" >> $1; echo "/*" >> $1; echo -n " * \$" >> $1; echo "Id$" >> $1; echo " */" >> $1; + echo "" >> $1; echo "/*" >> $1; echo -n " * \$" >> $1; echo "Log$" >> $1; |