summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO6
-rw-r--r--src/mov_encoder_writer.cc19
-rw-r--r--src/server.cc13
3 files changed, 20 insertions, 18 deletions
diff --git a/TODO b/TODO
index 5b4a053..5a2eca5 100644
--- a/TODO
+++ b/TODO
@@ -13,6 +13,12 @@ http://www.linuxmanpages.com/man3/fame_start_frame.3.php
// YUV420 format specification
http://encyclopedia.laborlawtalk.com/YUV_4:2:0
+
+Create mpgs with exclusive.
+Rewrite naming code!
+open64 ?
+Split files at some given (in config file) point?
+
==========================================================================
TASKS (client)
==========================================================================
diff --git a/src/mov_encoder_writer.cc b/src/mov_encoder_writer.cc
index 89ddc3d..2ed6879 100644
--- a/src/mov_encoder_writer.cc
+++ b/src/mov_encoder_writer.cc
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.3 2005/05/26 21:32:39 deva
+ * *** empty log message ***
+ *
* Revision 1.2 2005/05/26 12:48:36 deva
* *** empty log message ***
*
@@ -82,12 +85,8 @@ MovEncoderWriter::~MovEncoderWriter()
if(file != -1) close(file);
}
-//#define TEST_BIG_FILE 10*1024*1024
void MovEncoderWriter::run()
{
-#ifdef TEST_BIG_FILE
- char big_buf[TEST_BIG_FILE];
-#endif/* TEST_BIG_FILE*/
// fprintf(stderr, "\t\t\t\t\t\t\t\t\tFile Writer ready!\n"); fflush(stderr);
Frame *frame;
@@ -116,13 +115,9 @@ void MovEncoderWriter::run()
while(frame->number == frame_number) {
int ret;
-#ifdef TEST_BIG_FILE
- ret = write(file, big_buf, TEST_BIG_FILE);
-#else /* TEST_BIG_FILE */
- ret = write(file, frame->data, frame->size);
-#endif /* TEST_BIG_FILE */
- if(ret == -1) {
+ ret = write(file, frame->data, frame->size);
+ if(ret != frame->size) {
fprintf(stderr, "Error in filewriter\n"); fflush(stderr);
switch(errno) {
case EAGAIN: // Non-blocking I/O has been selected using O_NONBLOCK and the write would block.
@@ -161,11 +156,7 @@ void MovEncoderWriter::run()
}
}
// Do write again.
-#ifdef TEST_BIG_FILE
- ret = write(file, big_buf, TEST_BIG_FILE);
-#else /* TEST_BIG_FILE */
ret = write(file, frame->data, frame->size);
-#endif /* TEST_BIG_FILE */
if(ret == -1) {
fprintf(stderr, "Could not write to file: %s\n", strerror(errno)); fflush(stderr);
return;
diff --git a/src/server.cc b/src/server.cc
index 72df6b6..cdbe506 100644
--- a/src/server.cc
+++ b/src/server.cc
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.21 2005/05/26 21:32:39 deva
+ * *** empty log message ***
+ *
* Revision 1.20 2005/05/26 12:48:36 deva
* *** empty log message ***
*
@@ -173,16 +176,17 @@ 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", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d.jpg", 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", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d.jpg", root->c_str(), birthmonth, cpr, cpr, date, cnt);
fp = fopen(fname, "r");
}
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d", root->c_str(), birthmonth, cpr, cpr, date, cnt);
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.
@@ -274,16 +278,17 @@ MovEncoderThread *newMovEncoder(char* cpr)
ltime->tm_mday);
// Create filename: [serverroot]/[birthmonth]/[cpr]/[cpr]-[date]-[cnt].mpg
- sprintf(fname, "%s/%s/%s/%s-%s-%.3d", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d.mpg", 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", root->c_str(), birthmonth, cpr, cpr, date, cnt);
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d.mpg", root->c_str(), birthmonth, cpr, cpr, date, cnt);
fp = fopen(fname, "r");
}
+ sprintf(fname, "%s/%s/%s/%s-%s-%.3d", root->c_str(), birthmonth, cpr, cpr, date, cnt);
fprintf(stderr, "Success - using filename: [%s.mpg]\n", fname); fflush(stderr);
enc = new MovEncoderThread(fname);