summaryrefslogtreecommitdiff
path: root/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cc')
-rw-r--r--src/server.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/server.cc b/src/server.cc
index 370af2e..ee14132 100644
--- a/src/server.cc
+++ b/src/server.cc
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.15 2005/05/17 14:30:56 deva
+ * Added code, preparing threaded encoding.
+ *
* Revision 1.14 2005/05/16 16:00:57 deva
*
* Lots of stuff!
@@ -71,7 +74,8 @@
#include "miav_config.h"
-#include "mov_encoder.h"
+//#include "mov_encoder.h"
+#include "mov_encoder_thread.h"
#include "img_encoder.h"
#include "server_status.h"
@@ -181,9 +185,9 @@ struct tm
};
*/
-MovEncoder *newMovEncoder(char* cpr)
+MovEncoderThread *newMovEncoder(char* cpr)
{
- MovEncoder *enc;
+ MovEncoderThread *enc;
struct tm *ltime;
time_t t = time(NULL);
FILE *fp;
@@ -202,7 +206,7 @@ MovEncoder *newMovEncoder(char* cpr)
fprintf(stderr, "MIaV does not have write access to the server root [%s]\n", root->c_str());
fprintf(stderr, "Redirecting output to [/tmp/miav-%d.mpg]\n", r);
sprintf(fname, "/tmp/miav-%d.mpg", r);
- enc = new MovEncoder(fname);
+ enc = new MovEncoderThread(fname);
return enc;
}
fclose(fp);
@@ -214,7 +218,7 @@ MovEncoder *newMovEncoder(char* cpr)
fprintf(stderr, "Illigal CPR, it must have length 11, it had lentgh %d\n", strlen(cpr));
fprintf(stderr, "Redirecting output to [/tmp/miav-%d.mpg]\n", r);
sprintf(fname, "/tmp/miav-%d.mpg", r);
- enc = new MovEncoder(fname);
+ enc = new MovEncoderThread(fname);
return enc;
}
@@ -230,7 +234,7 @@ MovEncoder *newMovEncoder(char* cpr)
fprintf(stderr, "Not possible to create subfolder %s\n", fname);
fprintf(stderr, "Redirecting output to [/tmp/miav-%d.mpg]\n", r);
sprintf(fname, "/tmp/miav-%d.mpg", r);
- enc = new MovEncoder(fname);
+ enc = new MovEncoderThread(fname);
return enc;
}
@@ -241,7 +245,7 @@ MovEncoder *newMovEncoder(char* cpr)
fprintf(stderr, "Not possible to create subfolder %s\n", fname);
fprintf(stderr, "Redirecting output to [/tmp/miav-%d.mpg]\n", r);
sprintf(fname, "/tmp/miav-%d.mpg", r);
- enc = new MovEncoder(fname);
+ enc = new MovEncoderThread(fname);
return enc;
}
@@ -265,7 +269,7 @@ MovEncoder *newMovEncoder(char* cpr)
}
fprintf(stderr, "Success - using filename: [%s]\n", fname); fflush(stderr);
- enc = new MovEncoder(fname);
+ enc = new MovEncoderThread(fname);
return enc;
}
@@ -280,7 +284,7 @@ void newConnection(Socket *socket)
n_header h;
Frame *frame;
Frame *freeze_frame = NULL;
- MovEncoder *enc = NULL;
+ MovEncoderThread *enc = NULL;
// unsigned char dvbuf[DVPACKAGE_SIZE];
frame = new Frame(NULL, DVPACKAGE_SIZE);