summaryrefslogtreecommitdiff
path: root/src/encoder.cc
diff options
context:
space:
mode:
authordeva <deva>2005-05-03 08:31:58 +0000
committerdeva <deva>2005-05-03 08:31:58 +0000
commit16aeeeb8110893e14c2d134542981cdc0f257411 (patch)
treefbcd9ec22c27d9f82a049055ec9d37035a1e3c03 /src/encoder.cc
parenta8456a6a949178ff06ca66cc10c0079da9f9f067 (diff)
Removed the error object, and replaced it with a more generic info object.
Diffstat (limited to 'src/encoder.cc')
-rw-r--r--src/encoder.cc65
1 files changed, 35 insertions, 30 deletions
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;
}
}