summaryrefslogtreecommitdiff
path: root/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cc')
-rw-r--r--src/server.cc33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/server.cc b/src/server.cc
index f13d8df..72df6b6 100644
--- a/src/server.cc
+++ b/src/server.cc
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.20 2005/05/26 12:48:36 deva
+ * *** empty log message ***
+ *
* Revision 1.19 2005/05/22 16:34:44 deva
*
* Fix: Connection is now taken down when taking a sanpshot without recording.
@@ -117,8 +120,8 @@ void saveFrameAsImage(char* cpr, Frame *f)
if(!fp) {
int r = rand();
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);
+ fprintf(stderr, "Redirecting output to [/tmp/miav-%d.jpg]\n", r);
+ sprintf(fname, "/tmp/miav-%d", r);
imgenc.encode(f, fname, 100); // Quality is between 0...100, where 100 is best.
return;
}
@@ -130,7 +133,7 @@ void saveFrameAsImage(char* cpr, Frame *f)
int r = rand();
fprintf(stderr, "Illigal CPR, it must have length 11, it had length %d\n", strlen(cpr));
fprintf(stderr, "Redirecting output to [/tmp/miav-%d.jpg]\n", r);
- sprintf(fname, "/tmp/miav-%d.mpg", r);
+ sprintf(fname, "/tmp/miav-%d", r);
imgenc.encode(f, fname, 100); // Quality is between 0...100, where 100 is best.
return;
}
@@ -146,7 +149,7 @@ void saveFrameAsImage(char* cpr, Frame *f)
int r = rand();
fprintf(stderr, "Not possible to create subfolder %s\n", fname);
fprintf(stderr, "Redirecting output to [/tmp/miav-%d.jpg]\n", r);
- sprintf(fname, "/tmp/miav-%d.mpg", r);
+ sprintf(fname, "/tmp/miav-%d", r);
imgenc.encode(f, fname, 100); // Quality is between 0...100, where 100 is best.
return;
}
@@ -157,7 +160,7 @@ void saveFrameAsImage(char* cpr, Frame *f)
int r = rand();
fprintf(stderr, "Not possible to create subfolder %s\n", fname);
fprintf(stderr, "Redirecting output to [/tmp/miav-%d.jpg]\n", r);
- sprintf(fname, "/tmp/miav-%d.mpg", r);
+ sprintf(fname, "/tmp/miav-%d", r);
imgenc.encode(f, fname, 100); // Quality is between 0...100, where 100 is best.
return;
}
@@ -170,18 +173,18 @@ void saveFrameAsImage(char* cpr, Frame *f)
ltime->tm_mday);
// Create filename: [serverroot]/[birthmonth]/[cpr]/[cpr]-[date]-[cnt].mpg
- sprintf(fname, "%s/%s/%s/%s-%s-%.3d.jpg", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d", root->c_str(), birthmonth, cpr, cpr, date, cnt);
// test filename-[cnt] for existamce cnt++ until not existing.
fp = fopen(fname, "r");
while(fp) {
fclose(fp);
cnt++;
- sprintf(fname, "%s/%s/%s/%s-%s-%.3d.jpg", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d", root->c_str(), birthmonth, cpr, cpr, date, cnt);
fp = fopen(fname, "r");
}
- fprintf(stderr, "Success - using filename: [%s]\n", fname); fflush(stderr);
+ fprintf(stderr, "Success - using filename: [%s.jpg]\n", fname); fflush(stderr);
imgenc.encode(f, fname, 100); // Quality is between 0...100, where 100 is best.
}
/*
@@ -219,7 +222,7 @@ MovEncoderThread *newMovEncoder(char* cpr)
int r = rand();
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);
+ sprintf(fname, "/tmp/miav-%d", r);
enc = new MovEncoderThread(fname);
return enc;
}
@@ -231,7 +234,7 @@ MovEncoderThread *newMovEncoder(char* cpr)
int r = rand();
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);
+ sprintf(fname, "/tmp/miav-%d", r);
enc = new MovEncoderThread(fname);
return enc;
}
@@ -247,7 +250,7 @@ MovEncoderThread *newMovEncoder(char* cpr)
int r = rand();
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);
+ sprintf(fname, "/tmp/miav-%d", r);
enc = new MovEncoderThread(fname);
return enc;
}
@@ -258,7 +261,7 @@ MovEncoderThread *newMovEncoder(char* cpr)
int r = rand();
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);
+ sprintf(fname, "/tmp/miav-%d", r);
enc = new MovEncoderThread(fname);
return enc;
}
@@ -271,18 +274,18 @@ MovEncoderThread *newMovEncoder(char* cpr)
ltime->tm_mday);
// Create filename: [serverroot]/[birthmonth]/[cpr]/[cpr]-[date]-[cnt].mpg
- sprintf(fname, "%s/%s/%s/%s-%s-%.3d.mpg", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d", root->c_str(), birthmonth, cpr, cpr, date, cnt);
// test filename-[cnt] for existamce cnt++ until not existing.
fp = fopen(fname, "r");
while(fp) {
fclose(fp);
cnt++;
- sprintf(fname, "%s/%s/%s/%s-%s-%.3d.mpg", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d", root->c_str(), birthmonth, cpr, cpr, date, cnt);
fp = fopen(fname, "r");
}
- fprintf(stderr, "Success - using filename: [%s]\n", fname); fflush(stderr);
+ fprintf(stderr, "Success - using filename: [%s.mpg]\n", fname); fflush(stderr);
enc = new MovEncoderThread(fname);
return enc;
}